Sleeping plays an important role in forming lasting memories, but controversy remains over whether the brain helps to create these by deleting unnecessary connections or by strengthening important ones.

Now the latest research suggests that both processes occur during sleep.

A study in the journal PLOS Computational Biology suggests that sleeping triggers the synapses in our brain to both strengthen and weaken which prompts the forgetting, strengthening or modification of our memories in a process known as long-term potentiation (LTP).

Scientists led by Sidarta Ribeiro at the Brain Institute of the Federal University of Rio Grande do Norte, Brazil, measured the levels of a protein related to LTP during the sleep cycle of rats.

The results show that sleep can have different effects depending on whether LTP is present or not.

A lack leads to memory erasure while the presence of LTP can either strengthen memories or prompt the emergence of new ones.

The research provides a framework to understand the mechanisms underlying the complex role of sleep for learning, which involves selective remembering as well as creativity.

This article was originally published by Business Insider.

More from Business Insider: