When humans are on the prowl for something to eat, something in our brains appears to drive us towards junk food. This is what some scientists call 'optimal foraging theory', and it suggests our spatial memory, or our 'cognitive maps', have evolved to prioritise the most calorically rewarding snacks.

For our hunter-gatherer ancestors, who never knew when their next meal would come, these mental 'drop pins' would likely have come in handy. For the modern person rummaging through their kitchen, new research suggests it can sometimes be a curse.

A test of spatial memory among 512 participants has now provided first-hand evidence that human spatial processing is implicitly biased toward high-calorie foods.

When put through a maze of food items, participants were more likely to remember the locations of chocolate brownies and potato chips than healthy foods like apples and tomatoes.

In the natural world, animals typically forage for high-energy foods first, but whether humans have this same impulse, and whether this involves a higher level of cognitive processing as opposed to a reflex remains up for debate.

In past studies, participants quickly categorised and memorised high-calorie and low-calorie food pictures, and brain imaging reveals high-calorie foods reliably engage reward-processing areas.

In 2013, a small study among women found spatial memory was enhanced for pictures of high-calorie snacks, compared to images of fruits and vegetables. This bias also predicted the BMI of participants, leading the authors to suggest our spatial memories, which evolved long ago, might be contributing to unhealthy eating and weight gain today.

The new research adds to this idea, and provides evidence of a cognitive system "optimized for energy-efficient foraging."

In a maze-like room, the study participants followed a specified route, sniffing and taste-testing 16 foods, both sweet and savoury, and high- and low-calorie.

For half the samples, the volunteers could only smell the food, while for the other half they could actually taste it, as well as smell it. Importantly, no one was told they were going to be tested on their spatial memory later.

When they were, however, their recall for junk food was roughly 27 to 28 percent better than healthy food, and this was true even after researchers controlled for other potentially overriding decisions like a person's familiarity with a food, the taste of the food, and their explicit desire to consume it. The protein and fat ratios of these foods were also balanced to stop people making any nutritional decisions.

Even when only a smell was available, participants were remarkably good at implicitly 'knowing' the caloric content of the sample; in fact, they were a percentage point more accurate in mapping the location of the high-calorie foods than in the taste tests.

Smell and memory are thought to be closely tied together in the brain, but a human's sense of smell is often seen as inferior to other foraging mammals.

"However, our observations showcase the intact ability of individuals to distinguish different odour types, deduce caloric properties of signalled foods from odour cues, and localize odour objects in space," the authors write.

"Indeed, a well-developed olfactory sense is thought to have conferred a survival advantage to (ancestral) hunter-gatherers."

Our memories may very well have been shaped by our need for food in a time of unpredictable hunting and foraging, but it's still too early to say how these cognitive processes influence our behaviour and food choices today.

More research is needed, because right now, there's a paucity of literature on high-calorie spatial memory and its behavioural effects in a modern day setting.

A small study by some of the same researchers, for instance, found a spatial memory bias for high-calorie foods, but their findings did not show any clear effects on actual eating behaviour.

Still, if this optimal foraging theory proves to be true in humans, it might help explain why it's so hard to make healthy dietary decisions in a modern world.

"An enhanced memory for high-calorie food locations could make high-calorie options relatively easier to obtain within a diverse food environment, especially for those with a greater expression of the bias," the authors write.

"In this manner, the cognitive bias may facilitate high-calorie food choice, by capitalizing on the tendency of individuals to prefer convenient easily-accessible items when making food decisions."

Thanks a lot, brain.

The study was published in Scientific Reports.