When you learn to ride a bike or play a song on a piano, your brain keeps practicing even while you sleep. Scientists have long known that sleeping helps us remember things, but a new study from University College London in London reveals something surprising about how our brains handle learned skills.

The research, led by Scott J. Thompson and his team, shows that while you sleep, your brain replays the activity patterns from when you learned a skill like riding a bike. Scientists previously thought this replay always started in the hippocampus, a brain region shaped like a seahorse that helps form memories of facts and events. But Thompson's study found that skills and habits follow a completely different path.

The researchers trained 7 mice with damaged hippocampi and 6 healthy mice to learn a new motor skill through repeated practice. They planted tiny electrodes in the animals' brains to watch which neurons fired during learning and during sleep afterward. They found that both groups of mice showed the same brain activity patterns during sleep that occurred while they were practicing the skill. Even the mice missing their entire hippocampus still had this replay happening in a brain region called the dorsal striatum, which helps control movement and form habits.

The study also found something useful: the specific patterns of replay during sleep could predict how much better the mice would perform the skill after waking up. "Neural sequences linked to salient behavioral events were prioritized for replay, with positive and negative behavioral outcomes having opposing effects on individual replay events," the researchers wrote. In simple terms, good experiences during practice led to more replay of those good moments, while bad outcomes led to less replay of those moments.

Published in Nature Neuroscience, the findings suggest our brains have separate systems working in parallel to lock in different kinds of memories. Declarative memories like memorizing a phone number might still rely on the hippocampus, while procedural memories like learning to swim or type apparently use the dorsal striatum instead.

The discovery could eventually help scientists develop better ways to strengthen memories during sleep or improve learning after brain injuries. For now, it gives us one more reason to value a good night's rest: while you're dreaming, your brain is quietly rehearsing how to get better at the things you learned that day.