Honoré de Balzac is said to have consumed the equivalent of fifty cups of coffee a day at his peak. He did not drink coffee, though—he pulverized coffee beans into a fine dust and ingested the dry powder on an empty stomach. He described the approach as “horrible, rather brutal,” to be tried only by men of “excessive vigor.” He documented the effects of the process in his 1839 essay “Traité des Excitants Modernes” (“Treatise on Modern Stimulants”): “Sparks shoot all the way up to the brain” while “ideas quick-march into motion like battalions of a grand army to its legendary fighting ground, and the battle rages.”

Balzac’s novels and plays endure, but modern science is challenging his view of caffeine causing ideas to “quick-march into motion.” While caffeine has numerous benefits, it appears that the drug may undermine creativity more than it stimulates it.

When we drink a caffeinated beverage, the caffeine quickly crosses the blood-brain barrier—an interface of sorts between the brain and the body’s circulatory system, designed to protect the central nervous system from chemicals in the blood that might harm it—and proceeds to block the activity of a substance called adenosine. Normally, a central function of adenosine is to inhibit the release of various chemicals into the brain, lowering energy levels and promoting sleep, among other regulatory bodily functions. When it’s blocked, we’re less likely to fall asleep on our desks or feel our focus drifting. According to a recent review of some hundred studies, caffeine has a number of distinct benefits. Chief among them are that it boosts energy and decreases fatigue; enhances physical, cognitive, and motor performance; and aids short-term memory, problem solving, decision making, and concentration.

But all of that comes at a cost. Science is only beginning to unravel the full complexity behind different forms of creative accomplishment; creativity is notoriously difficult to study in a laboratory setting, and the choice of one approach over another limits the way that creativity can be measured. Still, we do know that much of what we associate with creativity—whether writing a sonnet or a mathematical proof—has to do with the ability to link ideas, entities, and concepts in novel ways. This ability depends in part on the very thing that caffeine seeks to prevent: a wandering, unfocussed mind.

Creative insights and imaginative solutions often occur when we stop working on a particular problem and let our mind move on to something unrelated. In one recent study, participants showed marked improvements on a task requiring creative thought—thinking of alternative uses for a common object, such as a newspaper—after they had engaged in a different, undemanding task that facilitated mind wandering. The more their mind wandered when they stepped away, the better they fared at being creative. In fact, the benefit was not seen at all when the subjects engaged in an unrelated but demanding task.

In other words, a break in intense concentration may increase unconscious associative processing. That, in turn, allows us to perceive connections that we would otherwise miss. Letting our minds wander may also increase communication between the brain’s default mode network—the parts of our brain that are more active when we’re at rest—and its executive areas, which are used in so-called higher reasoning and decision-making functions. These two regions become activated right before we solve problems of insight. Caffeine prevents our focus from becoming too diffuse; it instead hones our attention in a hyper-vigilant fashion.

Caffeine also inhibits another mental process that’s necessary for creative thinking: sleep. A 2009 study showed that people who experienced REM sleep performed better on two tests of creative thinking than those who simply rested or napped without entering the REM cycle. During REM, their brains were able to integrate unassociated information so that, upon waking up, they were more adept at solving problems they had been primed with earlier. Without sound sleep, the effect dissipated. Sleep deprivation has also been linked to negative effects on other elements associated with creativity and thought clarity: it diminishes emotional intelligence, constructive thinking, and the ability to cope with stress.

In one study, consuming two hundred milligrams of caffeine significantly increased the amount of time it took for people to fall asleep later that night. (An eight-ounce cup of brewed coffee contains ninety-five to two hundred milligrams of caffeine, according to the Mayo Clinic.) It also had a profound effect on the quality of that sleep: it lowered sleep efficiency; the duration of stage-two sleep (the point at which our bodies prepare to enter deep sleep); and the spectral power of delta-wave frequencies (which are closely associated with the depth and quality of sleep). Other studies have linked caffeine to diminished sleep quality and efficiency, along with an increase in the number of times people wake during the night and how tired they feel in the morning.

It may be possible to reap the positive effects of caffeine without the creativity-diminishing side effects, however. Some research has found that attributes like increased alertness and focus can be replicated by the placebo effect. In a 2011 study at the University of East London, a group of psychologists examined the effects of caffeine on problem-solving ability and emotional responses. In the double-blind study, eighty-eight habitual coffee drinkers were given cups of caffeinated and decaffeinated coffee at random. Half were told that they were receiving regular coffee, and half were informed that they were given decaf. Each participant then completed tasks that measured things like reaction time, self-control, reward motivation, and mood. In the Stroop task, which measures reaction time, improved accuracy was observed in subjects who believed they had ingested caffeinated coffee, even if they had only consumed decaf. Subjects who received caffeine and were told they were drinking decaf did not show an improved reaction time. Likewise, in a measure of reward motivation, the Card Arranging Reward Responsivity Objective Test, the participants who believed they had consumed caffeine sorted the cards more quickly than those who believed they’d consumed decaf.

Balzac, then, may not have been personally quite as far off the mark as it seems. If he expected caffeine to have a certain effect, he may have been able to attain it simply by believing it, regardless of whether the caffeine itself was causing those effects. And, ultimately, for the hours of research and focussed thinking that form the raw material of most any creative endeavor—in Balzac’s case, the endless pages of plot and character development—an extremely caffeinated approach may be productive, as long as the mind is allowed to wander every now and again.

Maria Konnikova is the author of the New York Times best-seller “Mastermind: How to Think Like Sherlock Holmes.” She has a Ph.D. in Psychology from Columbia University._

Photograph by Elliott Erwitt/Magnum.