The next time you tune out and find your mind wandering, know that you are actually boosting your mental performance, a new study indicates.

Normally when focusing on a mental puzzle at hand, the brain's executive control network for externally focused, goal-oriented thinking activates, while the network for internally directed thinking - like mind-wandering and daydreaming - must be turned down to avoid interference. At least, that's what scientists had long assumed.

But new research shows for the first time that when the brain wanders and reminisces, so-called "off task" mental activities, it can actually boost performance on some challenging mental tasks.

This realization completely changes researchers' understanding of how externally and internally focused neural networks interact to facilitate complex thought.

"The prevailing view is that activating brain regions referred to as the default network impairs performance on attention-demanding tasks because this network is associated with behaviors such as mind-wandering," study leader Nathan Spreng, a neuroscientist at Cornell University, said in a statement. "Our study is the first to demonstrate the opposite - that engaging the default network can also improve performance."

Previous research has shown that mental processes associated with default network, like daydreaming, conflict with task goals. For example, if you're thinking about what you did last weekend during a lecture, clearly you're not going to retain any of the information your professor is talking about.

However, Spreng and his team developed a new approach in which off-task processes such as reminiscing can support rather than conflict with the aims of the experimental task.

They had 36 young adults view sets of famous and anonymous faces in sequence and then identify whether the current face matched the one presented two faces back. The team found participants were faster and more accurate when matching famous faces than when matching anonymous faces, and that this better short-term memory performance was associated with greater activity in the default network.

Thus, it's possible that daydreaming isn't always bad. So when you're picturing you and your prince charming riding into the distance on the back of a white horse, believe it or not, you may in fact be boosting your mental performance.

The findings were published in the Journal of Neuroscience.