Back in high school, when tests were an unfortunately regular aspect of my life, I figured out a way to avoid as much studying as possible while also still getting a passing grade: sleep. I realized that when I would study just before going to bed, I would wake up in the morning with the information from the night before still fresh in my mind and ready to be regurgitated for the exam. My evidence for this "brain hack" was anecdotal, but as it turns out there is quite a bit of research that buoys my hunch: Sleep does help fortify memories.

The question, however, is whether the role of sleep in consolidating memories can be enhanced, paving the way for controlled memory manipulation in the future. According to new research from the Institute for Basic Science in South Korea, the answer appears to be yes.

As detailed in Neuron, researchers at the IBS Center for Cognition and Sociality demonstrated for the first time that they were able to affect the memory of mice—for better and worse—by artificially modulating certain types of brainwaves called spindles using optogenetics, a method of manipulating neurons with light.

During "deep" or slow-wave sleep (SWS), groups of neurons fire in concert and generate brain-waves with triple rhythms called slow oscillations, spindles, and ripples. Slow oscillations are produced by neurons in the cerebral cortex, the area of the brain associated with everything from language to consciousness. Spindles are produced in the thalamic reticular nucleus, which is kind of like a relay station for signals coming from the cerebral cortex. And ripples are produced in the hippocampus, which is associated with spatial memory.

"Often during the night a regular pattern is manifested, where a slow oscillation from the cortex is immediately followed by a thalamic spindle and while this happens, a hippocampal ripple appears in parallel," Charles Francois V. Latchoumane, a research fellow at the IBS, said. "We believe that the correct timing of these three rhythms acts like a communication channel between different parts of the brains that facilitates memory consolidation."

Current research suggests that a memory is consolidated during sleep when the same neurons that were fired when a memory was formed are reactivated in the same pattern—kind of like tracing over a line you drew with a pen to make it thicker and more permanent. But Latchoumane and his colleagues wanted to know if this process could be artificially enhanced by modulating the triple rhythm of brain waves during slow-wave sleep.

Read More: Four Leading Theories on Why Humans Need to Sleep

To test their hypothesis, the researchers exposed mice to a noise and then immediately administered a mild electric shock to the mice. The following day, the mice would be re-exposed to the same noise in order to monitor their fear reaction as a test of memory.

During the night between the two days, the researchers used a technique called optogenetics, which allows for the manipulation of genetically modified neurons with light, to change the patterns of the spindles in sleeping mice. According to the researchers, they chose to focus on spindle patterns because previous research has shown that the number of spindles is associated with memorization, and the number of spindles during SWS increases following a day packed with new information.

The researchers divided the mice into two groups, one of which received artificial spindles that were in sync with slow oscillations and ripples, and the other which received artificial spindles that were out of step with the slow oscillations and ripples.

The following day, the mice in the first group were frozen in fear 40 percent of the time even in the absence of the noise, whereas mice in the control and second groups only froze 20 percent of the time. This suggests that introducing the artificial spindles into slow-wave sleep did indeed abet memory consolidation in the mice. The researchers also found that memory recall was reduced when the number of spindles was suppressed during sleep.

A lot more research needs to be done before this information can be used for memory doping in humans. But this study does point to the fundamental role that timing plays in memory formation.