Thanks to a new study on the brains of genetically engineered mice, researchers finally have a better idea of why dreams are likely to be put on hold when the ambient temperature is too hot or too cold. Answer: it's too busy saving your skin.

Neuroscientists from the University of Bern in Switzerland broke a receptor gene in mice and watched how changes in temperature affected their sleep state, demonstrating the brain prioritises temperature control over dreaming.

When we're comfortable enough, our brains easily drift between a quiet state of rest and one described by the movement of our eyes: Rapid Eye Movement sleep (REM).

Far from being a chillout session, watching your own personal Netflix series while asleep can be a real mental workout. Your breathing can increase, your eyes keep track of imagined characters, and your limbs twitch as they fight the urge to move.

There must be some good reason for all this effort. Hypotheses have generally settled on dreams being our way of mentally processing the day's events. Given babies - who are actively processing various newly found skills - spend half of their sleep in this state, compared with about a quarter for adults, this seems like a sound bet.

But it's also a common-enough experience that dreams just don't come as easily at times when your sleeping space is running too hot or too cold.

What's more, when 'warm-blooded' animals like us do dream, temperature regulation is suppressed. Sweating, shivering, panting and flushing just isn't as effective at maintaining our core temperature once REM sleep kicks in.

"This loss of thermoregulation in REM sleep is one of the most peculiar aspects of sleep, particularly since we have finely-tuned mechanisms that control our body temperature while awake or in non-REM sleep", says neuroscientist Markus Schmidt from the University of Bern and the Department of Neurology at Bern University Hospital.

It's a short leap of logic to assume our brain makes a choice – process the events of that day, or let it go in favour of keeping your body from freezing or frying. Because for some reason it just can't do both.

To put this assumption to the test, Schmidt and his team focussed in on the hypothalamus deep inside the brains of lab mice, a part of the brain that plays a role in both thermoregulation and generating non-REM sleep.

Following on from research showing melanin-concentrating hormone (MCH) neurons are involved in dream-state sleep, the researchers tinkered with the genes for MCH receptors, either knocking them out or forcefully activating them through a process called optogenetics.

Putting normal old laboratory mice into a temperature-controlled environment, the team found that REM sleep increases in duration as the temperature is raised to a pleasantly warm degree.

By comparison, mice without functioning MCH receptors don't show any change in REM sleep as it warms, as if their hypothalamuses are oblivious to the outside temperature.

Switching the MCH system on and off  by using targeted light further indicated that melanin-concentrating hormone neurons are key to the brain's management of REM sleep with respect to temperature.

"It shows that the amount and timing of REM sleep are finely tuned with our immediate environment when we do not need to thermoregulate," says Schmidt.  

"It also confirms how dream sleep and the loss of thermoregulation are tightly integrated".

Fine-tuning body temperature and running a big brain are two of the most energy-intensive activities on a mammal's to-do list, so it seems reasonable to think these two vital tasks are going to come into conflict at some point.

Since we can't simply get up and move to a better spot when we're asleep, our bodies need to do a prime job of keeping our core at a nice temperature.

If conditions don't require that effort, it seems, our brains have evolved to use that energy for some account-keeping instead.

"These new data suggest that the function of REM sleep is to activate important brain functions specifically at times when we do not need to expend energy on thermoregulation, thus optimising use of energy resources," says Schmidt.

This research was published in Current Biology.