Learning and Prediction Error: Learning Is Surprise: How a Brain Learns From What It Got Wrong

Article A2-05

Nobody tells your brain what is right. How does it learn anyway, and what does the so-called pleasure chemical have to do with it?

Explore the idea

In brief

A brain learns by comparing what happened with what it expected and correcting its expectation by a fraction of the miss. When an outcome is fully expected there is nothing to correct, so nothing is learned. Midbrain dopamine cells fire in the pattern that rule needs: they respond to a surprising reward, stay quiet for an expected one and dip when an expected reward fails to come. That picture is well supported in animals doing simple tasks and has been refined since, not overturned: dopamine does more than report surprise, and a newer idea says the cells carry a spread of optimistic and pessimistic guesses.

How to use this

When you want to learn or to teach something, look for the gap between what the learner expects and what happens. Practice that is already fully predicted teaches little, and learning follows the size of the surprise. (Common-sense reading of the rule, not a tested teaching method: a quiz that checks a guess before revealing the answer gives a surprise to learn from, while rereading what you already know gives none.) When you read that dopamine is the pleasure chemical or the learning chemical, ask which job the claim means: reporting a surprise is one job, and the research behind it covers mostly animals doing simple tasks, not all human learning.

What the story is about

Think of the bakery you walk past on the way to work. The first time you try its almond pastry it is a small delight, better than you expected. After a month the almond pastry is just what you were going to buy, and you feel almost nothing. Then one morning the shelf is empty, and the disappointment is bigger than the small pleasure of any one of the last ten pastries. So something in you was tracking the gap between what you expected and what you got, and what registered was the gap, more than the pastry itself. (Just to be a tad pedantic, that is an everyday picture, not a measurement.)

The gap in that bakery scene is called a prediction error. The brain guesses and corrects its guesses, as our the prediction machine article set out; this article is about how the correcting is done. The main point: learning happens in proportion to surprise. A brain corrects its expectation by a fraction of the miss, and midbrain dopamine cells appear to carry that miss as a signal. That simple story is well supported in animals doing simple tasks, and it has been tested hard and refined since.

The rule: correct by a fraction of the miss

Pavlov's dogs are the famous case: a bell comes before food, and after enough pairings the bell alone makes the dog salivate. Rescorla and Wagner (1972) proposed a rule for how that kind of learning works. The bell is a cue, a signal that comes before an outcome. On each trial the animal compares the outcome that arrived with the outcome all the present cues predicted, and moves its expectation toward the outcome by a fixed fraction of that gap, the learning rate. Nothing in the rule counts repetitions; what matters instead is how much the outcome still surprises.

Try running that same rule on the bakery example we gave in the opening. Let's assign the almond pastry a worth of 1, and start your expectation of it at 0, meaning you have no idea what to expect. Each morning you compare what you find in the bakery with what you expected to find. The difference between the pastry you expected and the pastry you actually get is the miss, the surprise. Then you nudge your expectation up toward the pastry by a fifth of that miss (a learning rate of 0.2 means a fifth). On the first morning the miss is 1, so you nudge your expectation up by a fifth of 1, and your expectation becomes 0.2. On the second morning the miss is smaller, 0.8, so the nudge is smaller too. Each morning's surprise is smaller than the last, so each nudge is smaller than the last. After five mornings your expectation is about 0.67, and after ten about 0.89. By the eleventh morning the miss is only about 0.11, a shrug. That is the opening scene: the pastry that once delighted you now barely registers because it is nearly what you expected. The learning curve every textbook draws, steep at first and then flat, is this shrinking surprise. Learning flattens because the surprise runs out, not because you got bored of the pastry.

Blocking: when a second clue teaches nothing

That learning rule makes a strange prediction, and it holds. Suppose an animal has learned that a light bulb turning on means a reward is coming. Next, a tone sounds at the same moment as the light, and the same reward follows, again and again. Now the animal has two clues that come with the reward. Then you play the tone on its own. If being paired with the reward were enough, the animal would treat the tone as a sign of reward, as it does the light. Instead, you try, and the animal barely reacts. The rule we introduced above explains why. When the tone first joined the light, the light already predicted the reward in full, so the reward was no surprise. With no miss to correct, nothing was added to the tone: the light got there first and blocked learning about the tone. This is called blocking, described by Kamin (1969). In monkeys, reviewers report the same result: a new cue added to an already predictive one gained no strength, because no error occurred when the pair appeared (Nasser et al., 2017). So the tone is ignored not because it is weaker than the light, but because it added no surprise. Pairing alone does not teach; surprise does.

Where in the brain: the monkey and the juice

The surprise signal has a likely home in the midbrain, in cells that release the chemical dopamine, and the recordings that showed it match the bakery example. Picture a monkey whose dopamine cells are being recorded. A drop of juice arrives with no warning, and the cells fire: a pleasant surprise. Now a light comes on shortly before the juice every time. After a while the cells stop responding to the juice when it arrives, because it is expected, and fire when the light comes on, because the light is the new news (Schultz, 1998). Finally the light comes on and the juice never does. The cells dip below their usual rate at the moment the juice was due, the monkey's version of the empty shelf (Hollerman and Schultz, 1998; Schultz, 2016). Schultz et al. (1997) described these primate neurons as ones whose output "apparently signals changes or errors in the predictions of future salient and rewarding events".

This explains a popular mistake. Dopamine is often called the pleasure chemical, a common-sense belief we could not trace to a research source. Reviews that took the question on found that dopamine is more about wanting, the pull toward a thing, than liking, the enjoyment of having it: Berridge and Robinson (1998) concluded that dopamine lends rewards their pull, what they called incentive salience, and Berridge (2007) that dopamine is chiefly behind wanting a reward rather than enjoying it or learning about it. Wanting Is Not Liking tells that story; here dopamine is the teacher's red pen, not the pleasure.

Is the signal really the teacher?

A recorded signal need not be a teaching one, so two kinds of test go further. In rats, switching dopamine cells on with light at the moment an expected reward arrived made the animals learn about a blocked cue they would otherwise have ignored (Steinberg et al., 2013), and briefly switching them off when a reward was due worked like a real disappointment (Chang et al., 2016). In people the evidence is indirect: a drug that raises dopamine strengthened the brain-scan signal for reward errors, and a drug that blocks it weakened the signal, with choices shifting toward reward in the study (Pessiglione et al., 2006). The scan measures blood flow, not dopamine, so this fits the idea without proving it for human learning. Machine reinforcement learning uses the same error term. The dopamine signal is thought to carry the prediction error of a standard model-free reinforcement learning method (Nasser et al., 2017). How that cheap, habit-like learner differs from one that plans ahead with a model of the world is the subject of our article on mental models.

The newer idea: a spread of guesses

The standard picture had the dopamine cells as sending one shared number: how far the outcome was from the average expected. Consider a machine that pays 1 coin half the time and 9 coins the other half. Its average payout is 5, an amount it never actually pays. Machine learners had begun to keep the whole spread of outcomes, not only the average (Bellemare, Dabney and Munos, 2017), and Dabney et al. (2020) asked whether the brain does it. Re-reading earlier recordings from mouse dopamine cells in a midbrain area, they found the cells differ in an orderly way. Each cell switches from worse than expected to better than expected at its own reward size: some only for large rewards, like an optimist who expects plenty, others at small ones, like a pessimist. Cells that switched at larger sizes also reacted more steeply to better-than-expected news, and from the cells together the researchers could reconstruct the spread of rewards the mice had met.

The evidence base for the spread-of-guesses idea is smaller than that sounds. Those recordings were first reported by Eshel et al. (2016), who read the same cells as sharing one common response. The 2020 re-analysis covered 31 cells from 5 mice in one task and 40 cells from about 5 to 6 mice in another, all head-fixed mice getting water, with the cells very unevenly spread across the animals, with no experiment that changes the code and no link to behaviour. Other labs have since supported and extended the idea, and we found no published failure. Three examples: new mouse recordings that also tie the code to the animals' anticipatory behaviour (Sousa et al., 2025), a matching pattern in monkey cortical cells rather than dopamine cells (Muller et al., 2024), and a mouse study in which the pattern lines up with where the cells send their output (Avvisati et al., 2024). The careful reading is that a spread-of-guesses code is a well-motivated, partly supported idea and not yet a settled one.

What the surprise story leaves out

Dopamine does more than report surprise. A rat study finds that dopamine released in a reward area called the nucleus accumbens also tracks how much a reward is worth and how motivated the animal is (Hamid et al., 2016), and a review counts learning, motivation and vigour among its several jobs (Berke, 2018). Slow value-like and fast surprise-like signals can be pulled apart (Mohebi et al., 2019). A rival account says dopamine reports, after the fact, which earlier event caused a reward, rather than the surprise itself (Jeong et al., 2022). That rival account is a serious challenge, resting on one main line of work, and it has not replaced the surprise account.

The simple surprise rule also misses something. In rodent data, a response that has faded after a cue stopped paying out (extinction) often comes back later. That fits an animal that kept its old knowledge and infers which situation it is in, more than a rule that simply unlearns (Gershman, Blei and Niv, 2010). For the learning rate as a measure of individual differences, see Computational Phenotyping.

Where this leaves us

The settled part of the surprise story is the logic. An expectation is corrected by a fraction of the miss, a fully expected outcome teaches nothing, and blocking shows this in animals. Midbrain dopamine cells carry a signal that matches the logic in monkeys and mice, and in rats switching it on changes learning while switching it off mimics a disappointment. The human evidence is indirect.

What has not held is the tidy version. Dopamine carries more than a reward error, a rival account is live, the spread-of-guesses idea rests on a few recordings from a few mice, and the simple rule cannot explain why an extinguished response returns. So back at the bakery, the sting of the empty shelf is a fair picture of how learning works: the pastry was never the point, the gap was.

References

Avvisati, R. et al. (2024) 'Distributional coding of associative learning in discrete populations of midbrain dopamine neurons', Cell Reports, 43(4), 114080. Available at: https://doi.org/10.1016/j.celrep.2024.114080 (Accessed: 27 October 2026).

Bellemare, M.G., Dabney, W. and Munos, R. (2017) 'A distributional perspective on reinforcement learning', Proceedings of the 34th International Conference on Machine Learning (PMLR 70). Available at: https://arxiv.org/abs/1707.06887 (Accessed: 27 October 2026).

Berke, J. D. (2018) 'What does dopamine mean?', Nature Neuroscience, 21(6), 787-793. Available at: https://doi.org/10.1038/s41593-018-0152-y (Accessed: 27 October 2026).

Berridge, K. C. (2007) 'The debate over dopamine’s role in reward: the case for incentive salience', Psychopharmacology, 191(3), 391-431. Available at: https://doi.org/10.1007/s00213-006-0578-x (Accessed: 27 October 2026).

Berridge, K. C. and Robinson, T. E. (1998) 'What is the role of dopamine in reward: hedonic impact, reward learning, or incentive salience?', Brain Research Reviews, 28(3), 309-369. Available at: https://doi.org/10.1016/S0165-0173(98)00019-8 (Accessed: 27 October 2026).

Chang, C. Y. et al. (2016) 'Brief optogenetic inhibition of dopamine neurons mimics endogenous negative reward prediction errors', Nature Neuroscience, 19(1), 111-116. Available at: https://doi.org/10.1038/nn.4191 (Accessed: 27 October 2026).

Dabney, W. et al. (2020) 'A distributional code for value in dopamine-based reinforcement learning', Nature, 577(7792), 671-675. Available at: https://doi.org/10.1038/s41586-019-1924-6 (Accessed: 27 October 2026).

Eshel, N. et al. (2016) 'Dopamine neurons share common response function for reward prediction error', Nature Neuroscience, 19(3), 479-486. Available at: https://doi.org/10.1038/nn.4239 (Accessed: 27 October 2026).

Gershman, S. J. et al. (2010) 'Context, learning, and extinction', Psychological Review, 117(1), 197-209. Available at: https://doi.org/10.1037/a0017808 (Accessed: 27 October 2026).

Hamid, A. A. et al. (2016) 'Mesolimbic dopamine signals the value of work', Nature Neuroscience, 19(1), 117-126. Available at: https://doi.org/10.1038/nn.4173 (Accessed: 27 October 2026).

Hollerman, J. R. and Schultz, W. (1998) 'Dopamine neurons report an error in the temporal prediction of reward during learning', Nature Neuroscience, 1(4), 304-309. Available at: https://doi.org/10.1038/1124 (Accessed: 27 October 2026).

Jeong, H. et al. (2022) 'Mesolimbic dopamine release conveys causal associations', Science, 378(6626). Available at: https://doi.org/10.1126/science.abq6740 (Accessed: 27 October 2026).

Kamin, L.J. (1969) 'Predictability, surprise, attention, and conditioning', in Campbell, B.A. and Church, R.M. (eds) Punishment and aversive behavior. New York: Appleton-Century-Crofts. Book chapter, no DOI; cited by print record and through Nasser et al. (2017).

Mohebi, A. et al. (2019) 'Dissociable dopamine dynamics for learning and motivation', Nature, 570(7759), 65-70. Available at: https://doi.org/10.1038/s41586-019-1235-y (Accessed: 27 October 2026).

Muller, T. H. et al. (2024) 'Distributional reinforcement learning in prefrontal cortex', Nature Neuroscience, 27(3), 403-408. Available at: https://doi.org/10.1038/s41593-023-01535-w (Accessed: 27 October 2026).

Nasser, H. M. et al. (2017) 'The Dopamine Prediction Error: Contributions to Associative Models of Reward Learning', Frontiers in Psychology, 8. Available at: https://doi.org/10.3389/fpsyg.2017.00244 (Accessed: 27 October 2026).

Pessiglione, M. et al. (2006) 'Dopamine-dependent prediction errors underpin reward-seeking behaviour in humans', Nature, 442(7106), 1042-1045. Available at: https://doi.org/10.1038/nature05051 (Accessed: 27 October 2026).

Rescorla, R.A. and Wagner, A.R. (1972) 'A theory of Pavlovian conditioning: variations in the effectiveness of reinforcement and nonreinforcement', in Black, A.H. and Prokasy, W.F. (eds) Classical conditioning II: current research and theory. New York: Appleton-Century-Crofts. Book chapter, no DOI; cited by print record and through Schultz (2016) and Nasser et al. (2017).

Schultz, W. (1998) 'Predictive Reward Signal of Dopamine Neurons', Journal of Neurophysiology, 80(1), 1-27. Available at: https://doi.org/10.1152/jn.1998.80.1.1 (Accessed: 27 October 2026).

Schultz, W. (2016) 'Dopamine reward prediction error coding', Dialogues in Clinical Neuroscience, 18(1), 23-32. Available at: https://doi.org/10.31887/DCNS.2016.18.1/wschultz (Accessed: 27 October 2026).

Schultz, W. et al. (1997) 'A Neural Substrate of Prediction and Reward', Science, 275(5306), 1593-1599. Available at: https://doi.org/10.1126/science.275.5306.1593 (Accessed: 27 October 2026).

Sousa, M. et al. (2025) 'A multidimensional distributional map of future reward in dopamine neurons', Nature, 642(8068), 691-699. Available at: https://doi.org/10.1038/s41586-025-09089-6 (Accessed: 23 November 2026).

Steinberg, E. E. et al. (2013) 'A causal link between prediction errors, dopamine neurons and learning', Nature Neuroscience, 16(7), 966-973. Available at: https://doi.org/10.1038/nn.3413 (Accessed: 27 October 2026).