At Stanford University, a rat faces a choice. If it presses one lever, it gets a fixed amount of sugar liquid. If it presses a second lever, it usually gets less but occasionally wins a sweet bonanza. This choice between a safe bet and a risky gamble is one of life’s most recurring and most important. It affects whether an animal gets a meal or a teenager drunkenly climbs behind a wheel, whether an entrepreneur rakes in the cash or a global financial system collapses. And, if the Stanford rats are any indicator, it’s a choice whose outcome can be predicted and controlled.

By studying the brains of these rodents, Kelly Zalocusky from Stanford University has identified a specific group of neurons that are involved in risky decision-making. Their activity reveals whether a rat is about to make a safe choice or take a punt on a bigger payoff. And by silencing these neurons at the right time, Zalocusky’s team, led by Karl Deisseroth, could instantly (and temporarily) convert the risk-taking rodents into risk-avoiders.

If the same applies to humans, the study may have implications for treating addictive disorders. But perhaps more importantly, it reveals something about how we make decisions and where our attitudes toward risk come from. It’s not about what we gain from winning, but about how we deal with losing.

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.

She could also sway their decisions. If she stimulated the D2 neurons just as the rats were choosing between the levers, the risk-seeking ones suddenly became risk-averse. By contrast, the risk-averse animals were not affected.

“We are now that much closer to solving that most fascinating of questions: How does the brain use patterns of neural activity to make decisions?” says Catharine Winstanley from the University of British Columbia. The D2 neurons in the NAc are clearly important, but the team’s technique is “the real breakthrough”—scientists can use it to study other groups of neurons, and work out how the brain integrates all this information when we make choices. “Such information is revolutionary for neuroscience, but will also help us to understand what has gone wrong in disorders of maladaptive decision-making, such as gambling and substance-use disorder,” Winstanley adds.

It’s telling that pramipexole, the Parkinson’s drug, sometimes causes compulsive gambling or addictive behaviours—it works by stimulating D2 receptors, which suggests that Zalocusky’s rat experiments will also apply to humans. And if that’s the case, drugs that neutralize the D2 receptors might be useful in treating addictive disorders.

The study could also reframe how we think about such disorders in the first place. “You might think that people really into gambling are just interesting in winning, and that’s why they get into these patterns of behavior,” says Zalocusky. “But instead, it’s more that they’re not as motivated by losing as the average individual.

This fits with a longstanding concept from economics called loss aversion, which suggests that losses loom larger than gains in our minds. “It’s easier to fall into patterns of addiction if you feel you have nothing to lose. So, if we’re using therapy with gamblers, maybe we shouldn’t try talk them out of seeking big gains but reinforce how important it is to not lose things,” says Zalocusky. “And maybe, when we write laws that remove the risk from large banks, when we tell people in finance that they’re too big to fail, we’re only reinforcing high-risk behaviors. Perhaps that’s bad policy.”