A diet that's high in either fat or sugar could promote changes in the gut bacteria community that could represent a significant knock to cognition in the domain of being able to adapt and adjust to changing situations, according to a new study.

"It's increasingly clear that our gut bacteria, or microbiota, can communicate with the human brain," says lead author Kathy Magnusson, a professor at Ohio State University.

Working with mice, the researchers concluded the effect was most severe for a high-sugar diet, with the additional consequences of early learning impairment for both long-term and short-term memory.

Previous research has suggested that cognitive function and behavior problems could be linked to changes in the microbiome, which is composed of more than 100 trillion microorganisms.

"Bacteria can release compounds that act as neurotransmitters, stimulate sensory nerves or the immune system, and affect a wide range of biological functions," says Magnusson. "We're not sure just what messages are being sent, but we are tracking down the pathways and the effects."

In the study, the mice were fed various diets and presented with cognitive and motor tasks such as water maze testing.

After just four weeks of eating a high-fat or high-sugar diet, their performance plummeted by comparison with their healthy-eating counterparts.

The effects were most pronounced in the domain of cognitive flexibility, the capability to adapt and adjust to the situation at hand.

"The impairment of cognitive flexibility in this study was pretty strong," says Magnusson. "Think about driving home on a route that's very familiar to you, something you're used to doing. Then one day that road is closed and you suddenly have to find a new way home."

For an individual whose cognitive flexibility is functioning fine, determining the next best route home and remembering to go the same way the next morning would go smoothly, however, it could be a different outcome if cognitive flexibility is limited.

The result of the experiment could be even more dramatic if the researchers worked with older mice, they say, for the young animals selected for the experiment were fitter and more able to resist pathological influences from their microbiota.

"We've known for a while that too much fat and sugar are not good for you," says Magnusson. "This work suggests that fat and sugar are altering your healthy bacterial systems, and that's one of the reasons those foods aren't good for you."

The study was published in the journal Neuroscience.