Many animals, including humans, bonobos, bees, and songbirds, tend to be risk-averse. But there are always individuals who gamble, who take chances, who consistently pursue uncertain large rewards over certain small ones. Zalocusky’s rats were no exception. Over many days of testing, most preferred to avoid risks while a minority preferred to pursue them.

Note “preferred.” Each individual rat varied in its behavior, and did so in a remarkably human way. The rodents were more likely to make a risky choice if an earlier gamble paid off, and less likely to do so if they suffered a loss—the same win-stay-lose-switch strategy we ourselves use. The rats even reacted to human medications in the same way. Pramipexole, a drug used to treat Parkinson’s, can sometimes trigger compulsive gambling, shopping, or eating; Zalocusky found that it drove her animals towards similarly risk-seeking behavior.

But why? What’s going on in the heads of these rodents as they make their choices?

Take a brain, turn it upside-down and prod its center: that’s the ventral tegmental area (VTA) and it contains neurons that produce dopamine, a chemical involved in feelings of reward and pleasure. These dopamine-making cells extend into a deeper region called the nucleus accumbens (NAc), whose neurons carry docking stations that allow them to respond to dopamine. These stations are called receptors and they come in several types—D1, D2, D3, and so on.

These dopamine circuits have been strongly implicated in our attitudes to risk, and the way we deal with wins and losses. When something unexpectedly positive happens to us, it’s thought that neurons in the VTA release more dopamine, which is sensed by neurons in the NAc that carry the D2 receptor. The receptors react by shutting down. Conversely, when we’re disappointed, the VTA stops making dopamine for a hot second; this hiatus frees the NAc’s neurons, allowing them to fire.

So the D2-carrying neurons of the NAc could potentially act as loss detectors. They react when something falls short of our expectations.

This idea fits with a lot of earlier work, but it has been hard to test directly because the NAc is a hodgepodge of many neurons, only some of which carry D2. The team solved that problem by developing a clever technique that tags the D2-bearing cells—and only those cells—with a indicator molecule. When the neurons fire, the indicator glows green.

“People often talk about parts of the brain lighting up when they are active but with [our technique], that’s literally true,” Zalocusky says. By watching these tiny green starbursts with an optic fiber, she could monitor the D2 neurons in her rats, while they made decisions in real-time.

She saw that these neurons reflect both a rat’s past decisions, and its future ones. They fire more strongly if the animal experienced a loss after its previous choice, and also if it was about to make a safe one. And they fired especially strongly if the animals were naturally more risk-averse. Based on their activity, Zalocusky could predict which way rats tend to lean in their decisions, and which way they lean in any particular decision. “While they’re deciding, we could look at that one population of neurons and say with a fair degree of certainty how risky they were going to be,” she says.