Dopamine builds habits by signalling a reward prediction error: the gap between the reward you expected and the reward you got. Midbrain dopamine neurons fire a burst when an outcome is better than forecast, stay flat when it is exactly as forecast, and dip below baseline when it is worse. With repetition the burst moves from the reward to the earliest cue that predicts it, so the cue, not the reward, starts driving the behaviour.
- Prediction error: dopamine neurons report "better or worse than expected", not pleasure.
- 55–80% of midbrain dopamine neurons share the same phasic reward response.
- The burst moves to the cue: after learning, the light that predicts juice fires the neurons, not the juice.
- Wanting is not liking: dopamine drives the pull; small opioid hot spots make the pleasure.
- 59–66 days: median time for a habit to become automatic, with a 4 to 335 day range.
The popular version, where every like or sweet gives you a "dopamine hit" of pleasure, gets the job description wrong. The recordings that settled this were made in trained monkeys in the 1980s and 1990s and tied to a learning algorithm from computer science in a 1997 paper in Science by Wolfram Schultz, Peter Dayan and Read Montague.
Once you see what the signal actually encodes, three everyday puzzles make sense:
- why the notification sound pulls harder than the message;
- why a habit feels automatic after a few months;
- why "dopamine detox" is the wrong fix for the right problem.
What does dopamine actually signal?
Dopamine neurons in the ventral tegmental area and substantia nigra signal surprise about reward, not reward itself.
Wolfram Schultz trained in medicine, and when he set up his own laboratory at the University of Fribourg in Switzerland in 1977 he chose dopamine neurons because of Parkinson's disease: he wanted his work to connect to something that goes wrong in human brains. The plan was to find how these cells drive movement. His team did find some movement-related activity, but by his own account it was not very satisfying.
So they kept recording from macaques and refining the behavioural tests. What stood out was the reward. When a monkey got fruit juice, the dopamine cells fired, and the pattern shifted as the animal learned which cues predicted it. Schultz later recalled that at first the team could not believe the signal and suspected a mistake, which is why they went on to check other brain areas. The finding won him a share of the 2018 Gruber Neuroscience Prize.
Gruber Foundation, Yale: Wolfram Schultz, 2018 Neuroscience PrizeThe juice, the light and the missing juice
In the experiments Schultz summarised, a drop of fruit juice delivered without warning made most dopamine neurons fire a short burst. After a light was paired with the juice over several days of training, the juice alone no longer produced a burst. The light did.
The third condition is the decisive one. On trials where the light came on but the juice never arrived, the same neurons fell silent below their normal background rate, and the dip landed at the precise moment the juice should have appeared, more than a second after the light.
A pleasure chemical cannot fall silent at the exact moment a reward fails to arrive. A forecasting system can.Why the omission trial settled the question
Three lines and one number
Schultz, Dayan and Montague put it in three lines:
- a positive signal when an event is better than predicted;
- no signal when it matches;
- a negative signal when it is worse.
They also note that the response is homogeneous: different dopamine neurons respond alike, and an apple morsel and a juice drop produce similar bursts. Aversive events such as an air puff do not produce the burst.
That uniformity is what lets one small population of cells broadcast a single "better or worse than expected" number to the striatum, the nucleus accumbens and the frontal cortex.
| Condition | What the animal expects | What happens | Dopamine response | Prediction error |
|---|---|---|---|---|
| Before learning | Nothing | Juice arrives | Burst at juice | Positive |
| After learning | Juice after the light | Juice arrives on time | Burst at light, none at juice | Zero at juice |
| After learning, error trial | Juice after the light | No juice | Burst at light, dip below baseline at expected time | Negative |
| Unexpected bonus | Small reward | Larger reward | Burst (better than predicted) | Positive |
The paper reviews single-neuron recordings from midbrain dopamine cells in alert monkeys doing simple conditioning tasks, and shows that their firing matches the temporal difference (TD) error from reinforcement learning. Before training, juice triggers a burst; after several days of light-then-juice pairings the burst moves to the light; when the juice is withheld, firing drops below baseline at the expected moment, more than a second after the cue. The phasic response appears in 55 to 80% of dopamine neurons. The limit: these are trained animals in tightly timed lab tasks, and later work shows dopamine also carries signals about movement, novelty and salience that a pure TD account does not cover.
Read the paper (free)Why does a prediction error teach the brain anything?
A prediction error is useful because it says exactly how much to adjust. The temporal difference rule that Richard Sutton and Andrew Barto brought into psychology in the early 1980s defines the error at each moment as the reward just received, plus the discounted value of the next state, minus the value you predicted for the current state:
- If \( \delta \) is positive, the weights linking the current cues to value go up.
- If it is negative, they go down.
- If it is zero, nothing changes, because nothing new was learned.
Why value creeps backwards to the cue
The clever part is the "next state" term. The brain does not have to wait for the juice to know it was right; the moment a reliable cue appears, the value of the whole situation jumps, and that jump is itself an error that can teach the step before it.
Run the loop for long enough and value propagates backwards through a chain of cues: from juice to light, from light to the sound that precedes the light. That backward creep is why the dopamine burst migrates to the earliest reliable predictor, and why your hand reaches for the phone at the buzz before you have read anything.
The same family of algorithms, temporal difference reinforcement learning, is still used to train artificial agents, which is part of why neuroscientists treat the 1997 match as one of the field's strongest theory-to-data links. The debate since then is about scope, not about whether the error signal exists.
Use this to check what you just read. It runs the simplest version of the update, \( V \leftarrow V + \alpha\,\delta \), for the same reward on every trial, so you can watch the error shrink as the forecast catches up.
Watch a prediction error shrink with practice

How does that signal turn actions into habits?
Habits form when the dopamine-driven learning moves control from deliberate, goal-directed choice to cue-triggered responding in the dorsal striatum. Henry Yin and Barbara Knowlton's 2006 review in Nature Reviews Neuroscience lays out the distinction used in animal work:
| Test | Goal-directed action | Habit |
|---|---|---|
| Outcome is devalued | Responding falls | Responding largely continues |
| What drives it | Expectation of the outcome | The preceding stimulus (cue) |
| Main striatal region | Dorsomedial (associative) | Dorsolateral (sensorimotor) |
How the error does the training

Every time a cue, an action and a reward line up, the cue-action link gets strengthened. Early on the reward is surprising, the error is large and learning is fast.
As the reward becomes fully predicted, the error at the reward shrinks to zero, yet the behaviour does not fade, because by then the cue carries the value and the striatal circuit fires the routine on sight of it. This is why a mature habit feels effortless and joyless at the same time: you are no longer learning, you are executing.
The human habit curve
It also explains the shape of the habit curve in humans. In Phillippa Lally's 2010 study at University College London, 96 volunteers chose one eating, drinking or exercise behaviour to repeat daily in the same context for 12 weeks; 82 finished.
Automaticity rose steeply in the first weeks and then flattened, the asymptotic curve you would expect from an error signal that shrinks as prediction improves. Missing one day did not reset progress.
See the data as a table
| Days to automaticity (days) | |
|---|---|
| Lally 2010: fastest participant | 18 |
| Singh 2024: lowest study median | 59 |
| Lally 2010: typical (median) | 66 |
| Singh 2024: lowest study mean | 106 |
| Singh 2024: highest study mean | 154 |
| Lally 2010: slowest (extrapolated) | 254 |
| Singh 2024: longest individual | 335 |
Source: Singh et al., Healthcare 2024; Lally et al., Eur J Soc Psychol 2010 (via BPS Research Digest) · The 254-day figure is an extrapolation; Lally's study ran 84 days.
The University of South Australia team pooled 20 intervention studies with 2,601 participants (mean ages 21.5 to 73.5) covering physical activity, diet, flossing, drinking water and similar behaviours. Four studies reported time to automaticity: medians of 59 to 66 days, means of 106 to 154 days, and individual times from 4 to 335 days. Habit strength rose with a standardised mean difference of 0.69 (95% CI 0.49 to 0.88). Morning routines and self-chosen habits grew stronger. The limit: 11 of the 20 studies had a high risk of bias, and almost all rely on self-reported automaticity scales.
Read the paper (free)If dopamine is not pleasure, what makes things feel good?
Pleasure and desire run on partly separate circuits, and dopamine belongs mainly to desire. Kent Berridge and Morten Kringelbach's 2015 review in Neuron separates "wanting", the motivational pull toward a reward, from "liking", the felt pleasure of getting it.
Wanting is generated by a large, distributed system in which mesolimbic dopamine plays a big part. Liking comes from a much smaller set of hedonic hot spots, each about a cubic millimetre in rats, in the nucleus accumbens, the ventral pallidum and the brainstem parabrachial nucleus. Mu-opioid stimulation inside the accumbens hot spot can at least double the 'liking' reactions rats show to sucrose.
Evidence that dopamine is not the pleasure
The review goes further: some of the best-known textbook candidates for pleasure, including the classic "pleasure electrodes" of the 1950s and the mesolimbic dopamine system, may not generate pleasure at all. Two lines of evidence:
- raising dopamine in the accumbens increases how hard animals work for sweet rewards without increasing their liking reactions;
- Parkinson's patients with heavy dopamine loss still rate sweet tastes as normally pleasant.
In daily life this is the gap you notice when you crave the scroll and do not enjoy it. The cue keeps its wanting value long after the liking has gone flat.
| Feature | Wanting (incentive salience) | Liking (hedonic impact) |
|---|---|---|
| Main chemistry | Mesolimbic dopamine | Opioid, endocannabinoid and orexin signalling in hot spots |
| Size of system | Large and distributed | Small, specific hot spots |
| What it does | Makes cues attractive and drives effort | Makes the reward itself feel good |
| After a habit forms | Stays high for the cue | Can fade with repetition |
A review of animal and human neuroimaging work on pleasure. It concludes that diverse pleasures, from food to music to money, activate surprisingly similar circuitry, that wanting is produced by a large brain system while liking comes from a few hedonic hot spots, and that mesolimbic dopamine is a poor candidate for generating pleasure itself. The limit: most of the causal evidence on hot spots comes from rodent microinjection and taste-reactivity studies, and mapping those findings onto human feelings still relies on imaging correlations.
Read the paper (free)Why can you scroll for hours but not study for twenty minutes?
Feeds are built on variable, unpredictable rewards, which is exactly the schedule that keeps prediction errors alive. A post is sometimes great, sometimes dull, and the refresh costs one thumb movement.
Because the outcome never becomes fully predicted, each pull can still produce a positive error, and the cue (the app icon, the red badge, the buzz) gathers strong wanting value. Study is the opposite schedule: the effort is up front, the payoff is weeks away and uncertain, and nothing in the first ten minutes beats your forecast.
An interest problem, not a focus problem
A popular May 2024 thread on r/getdisciplined put it as an interest problem rather than a focus problem, since the same person can concentrate fine on a game. The prediction error account backs that up.
Attention is not broken; it is being allocated by a learning system that has been trained, very efficiently, on a different reward schedule. The fix is to change the schedule and the cues, not to starve the chemical. I cover the practical side in why you can scroll but can't study, and the cost of jumping between the two in attention residue and task switching.

Does a dopamine detox work?
Not in the way the name promises. You cannot lower your baseline dopamine by skipping your phone for a day, and dopamine is not a stock that runs out and refills.
What a "detox" can do is break the cue-response link for a while: no phone in the room means no buzz, no badge, no trigger, so the habit loop has nothing to fire on. That is a cue-control strategy, and cue control is one of the better-supported habit tools. The confused name is the problem, not the behaviour.
Why the first days feel worse
The prediction error model adds a second, less obvious point. When you remove a reliably rewarding cue, you get negative prediction errors at the expected times, the same below-baseline dip Schultz recorded when the juice failed to come.
That is felt as restlessness and craving, and it fades only as the forecast updates. So the first days of cutting back feel worse than the steady state, which is useful to know before you judge whether it is working. The full evidence review is in does dopamine detox work.
What does this mean for building a habit?
It means designing for the learning signal rather than for motivation. A context-stable cue gives the error something to attach to. Early, reliable reward makes the first repetitions teach fast.
Repetition over roughly two months moves the behaviour into the cue-driven system, with large differences between people, which is why a fixed "21 days" promise fails so many of them. The 2024 review also found morning routines and self-chosen habits grew stronger, which fits: a morning slot is a stable context, and a habit you chose carries more wanting from the start.
- Cue: one specific trigger, same place and time. Vague intentions give the striatum nothing to learn.
- Routine: start smaller than feels necessary; the error signal rewards completion, not ambition.
- Reward: make it immediate. A delayed payoff (fitness in six months) teaches almost nothing on day one.
- Patience: expect a median near two months, and treat a missed day as noise, as Lally's data show.
For a ranked list of habit methods by evidence, see habit techniques ranked by evidence, and for a step-by-step plan, how to build a habit that lasts. The wider Manthan world, where these posts sit, is at Manthan.
What's new
- Uchida lab finds the TD-error circuit in mouse striatum and dopamine cells appears to be in place before learning The Transmitter, Jun 2026
- Oxford model explains why dopamine ramps up as a reward gets close, using two interacting learning systems PsyPost (eLife paper), Aug 2026
- Systematic review puts habit formation at a median of about two months, with a 4 to 335 day range Healthcare (MDPI), Dec 2024
Questions people ask
Is dopamine the pleasure chemical?
No. Dopamine mainly signals reward prediction error and drives wanting, the pull toward a reward. The felt pleasure, liking, comes from small hedonic hot spots driven by opioid, endocannabinoid and orexin signalling. Raising dopamine makes animals work harder for sugar without making them like it more.
Why do I get a rush from the notification, not the message?
Because the notification is the earliest reliable predictor of a possible reward. After repeated pairings, the dopamine response moves from the reward to the cue that predicts it, exactly as Schultz recorded when the burst moved from juice to the light. The message itself is often already predicted, so it produces little or no error.
How long does it really take to form a habit?
The best current estimate is a median of about 59 to 66 days, with individual times from 4 to 335 days, according to the 2024 systematic review by Singh and colleagues. The popular 21-day figure has no support in these studies, and the type of habit, its timing and whether you chose it all change the speed.
Does dopamine fasting reset your brain?
It does not reset dopamine levels. What helps is removing cues so the habit loop has no trigger, and enduring the short period of negative prediction errors, felt as craving, while your forecasts update. Treat it as cue control, not as a chemical cleanse.
Sources
- Schultz W, Dayan P, Montague PR. A neural substrate of prediction and reward. Science 275:1593-1599 (1997)
- Singh B, Murphy A, Maher C, Smith AE. Time to form a habit: a systematic review and meta-analysis. Healthcare 12(23):2488 (2024)
- Berridge KC, Kringelbach ML. Pleasure systems in the brain. Neuron 86(3):646-664 (2015)
- Yin HH, Knowlton BJ. The role of the basal ganglia in habit formation. Nature Reviews Neuroscience 7:464-476 (2006)
- Lally P, van Jaarsveld CHM, Potts HWW, Wardle J. How are habits formed: modelling habit formation in the real world. European Journal of Social Psychology 40:998-1009 (2010)
- British Psychological Society Research Digest: How to form a habit (summary of Lally et al.) (2009)
- Gruber Foundation, Yale University: Wolfram Schultz, 2018 Gruber Neuroscience Prize (his account of the discovery) (2018)
- The Transmitter: Reward learning algorithm hardwired into dopamine circuit (2026)
- PsyPost: A new dual-process theory solves the mystery of dopamine ramps (2026)
- Reddit r/Neuropsychology: Does dopamine detox work? (2024)
