In the quest to decode what is happening while we’re sleeping, researchers at the Massachusetts Institute of Technology in Cambridge are hoping to turn the way we think about the matter upside down.

While researchers have known for decades that memory is enhanced during sleep, the most common approach to understanding memory has been to provide a stimulus in waking life and then seeing how things work mentally once the stimuli are received. Instead of that method, which requires a conscious subject, the researchers have developed tools to figure out how dream patterns affect learning and memory, according to a new paper published Wednesday in the Journal Scientific Reports.

“The content of memory is hidden during sleep and therefore requires tools for decoding content that do not require a priori measurements gathered during behavioral tests,” Matthew Wilson, a professor at MIT and senior principle investigator on the paper, said.

One of the biggest challenges — and most interesting pieces of the puzzle — is that, compared to waking life, the thoughts and memories shown in the hippocampus appear to be encrypted. That portion of the brain is critical for spatial memories and remembering specific events. The researchers hope decoding this activity will help us to understand our memories and dreams better.

There are plenty of theories as to why we dream and what it may say about us. Those include the musings of Sigmund Freud, who said that dreaming represents repressed longing — but also modern theories like the “threat simulation theory,” which contends that animals dream because it gives them an advantage by being able to simulate potential threats even when resting.

It is widely believed that our dreams help us develop and understand our daily experiences, as well, contributing to better memories of events and facts. In controlled environments, students have been shown to remember things they study better if they get a good night sleep, uninterrupted during key parts of the sleep cycle.