The busy box that is your brain is hard at work all day long—and it doesn’t quit when you’re asleep. Not only does your brain fill your slumber with dreams, it also goes right on solving the problems that plagued you during the day, often coming up with solutions by the time you wake up.
The idea of sleeping on a problem and seeing if you can get some clarity in the morning is a common one, but is it scientifically sound? A growing body of research says yes.
The latest piece of evidence that sleeping on a problem actually works comes courtesy of a small study recently published in the Journal of Neuroscience. A group of 25 people did a memorization task while wired up to an electroencephalograph (EEG) and magnetoencephalography (MEG) so the researchers could monitor which portions of their brains lit up as they worked. Everyone then took an afternoon nap, with brain sensors still in place.
The researchers were looking for sleep spindles: bursts of activity that occur in the brain during a relatively light stage of sleep. The location of the spindles can provide a clue as to what kind of information the brain is consolidating and processing at any particular time.
Read More: Why Do Some People Need More Sleep Than Others?
Spindle activity was especially high in the same areas of the brain that were used in the memorization task, and the greater the activity, the more people improved at the task when they tried it after the nap. “Brain rhythms occur everywhere in the brain during sleep,” said Dara Manoach, professor of psychiatry at Harvard University Medical School and a coauthor of the study, in a statement that accompanied its release. “But the rhythms in these regions increase after learning, presumably to stabilize and enhance memory.”
Alyssa Sinclair, a postdoctoral fellow at the University of Pennsylvania, found something similar in a study published last year. After sleeping on a difficult task, people were more level-headed the next day. “When we waited, when we let them sleep on it, they made somewhat more rational choices,” she says. “They were no longer quite as drawn to evaluating events based solely on their first impressions.”
This more measured take on things is due in large part to the region of the brain known as the hippocampus, which is responsible for processing short-term memories and, during sleep, for helping to determine which of those memories will be transferred to long-term storage and which will essentially be deleted.
“When we’re asleep,” says Sinclair, “the hippocampus is hard at work, consolidating those memories and experiences from throughout the day. It does this by replaying things that were important and pruning away the things that weren’t.”
Read More: How to Be More Spontaneous As a Busy Adult
The hippocampus is not alone in handling this work. Once it is done choosing the most relevant experiences, it transfers the keepers to the neocortex, where long-term memories are stored and integrated with existing memories. Those two brain regions do more than just file or trash information. They also analyze it—turning it this way and that and making connections that may not have been entirely obvious when we first encountered the information. It’s during sleep that this process often takes place.
“Sleep is critical for problem-solving, creativity, and emotional regulation,” says Daniela Grimaldi, a research associate professor at Northwestern University’s Feinberg School of Medicine. “Deep sleep, also called slow-wave sleep…provides the optimal conditions for this memory transfer to occur efficiently, ensuring that important experiences and learning are preserved, while less critical information is filtered out.”
“Your mind engages in informational alchemy,” says Matthew Walker, professor of neuroscience at the University of California, Berkeley, and the author of the book Why We Sleep, “reassembling memory fragments into a novel set of associations and colliding them with the back-catalogue of stored information.”
Deep sleep is not the only phase that plays a role in problem-solving and memory consolidation. The lightest of the four phases of sleep, known as N1 (for non-rapid eye movement stage one), can also yield profound cognitive benefits. One 2023 study in Science Advances found that when people were presented with a complex math problem, they tripled their chances of solving it if they spent as little as 15 seconds in N1 sleep after being exposed to the problem.
“Our findings suggest that there is a creative sweet spot within the sleep-onset period,” the researchers wrote, “and hitting it requires individuals balancing falling asleep easily against falling asleep too deeply.”
Read More: An Alzheimer’s Blood Test Might Predict Advanced Disease
None of this suggests that the conscious mind is a secondary player in learning and integrating and consolidating information. The cognitive muscle work of creativity—of art and scientific research and philosophical insight—is all conducted by wide-awake thinkers. But when the lights go off and consciousness winks out, another, deeper process goes to work.
“Creative problem solving improves after a period of sleep,” says Sinclair, “which helps us piece together those threads of what we’ve been thinking about, filter out irrelevant information, and come to a better conclusion when we wake up the next day.”
It’s possible to improve our chances of benefitting from all of that nocturnal work our brains are doing—if we know how. “Dream memories vanish rapidly upon waking, making instant recording crucial,” says Walker. “Keeping a dream journal or voice recorder bedside helps immensely. Upon waking, remain still with eyes closed for a moment, allowing dreams and insights to crystallize before the demands of daily life crowd them out. By creating this gentle routine, you enhance your chances of retaining the solutions your sleeping brain—through its unique informational alchemy—has woven overnight.”