A new study suggests both a high-fat and high-sugar diet could cause changes in gut bacteria that trigger significant decreases of certain cognitive functions.

These types of diets were found to be related to a loss of "cognitive flexibility," meaning the power to adapt to changing situations, Oregon State University reported.The effect was more dramaric with the high-sugar diet, which was also linked to impairments in long-term and short-term memory. 

"It's increasingly clear that our gut bacteria, or microbiota, can communicate with the human brain," said Kathy Magnusson, a professor in the OSU College of Veterinary Medicine and principal investigator with the Linus Pauling Institute. "Bacteria can release compounds that act as neurotransmitters, stimulate sensory nerves or the immune system, and affect a wide range of biological functions. We're not sure just what messages are being sent, but we are tracking down the pathways and the effects."

After only four weeks on a high-fat or a high-sugar diet, researchers observed the performance of mice on a number of mental and physical function tests significantly declined, and the most dramatic change was in cognitive flexibility.

"The impairment of cognitive flexibility in this study was pretty strong," Magnusson said. "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 example, a person with high levels of cognitive flexibility would be able to immediately determine the next best route home if their usual path was blocked, while someone with poor cognitive flexibility would have a long and stressful ride home.

"We've known for a while that too much fat and sugar are not good for you," Magnusson said. "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. It's not just the food that could be influencing your brain, but an interaction between the food and microbial changes."

The findings were published in a recent edition of the journal Neuroscience.