Our elders and betters often counsel us to learn from our mistakes. Learning theory states that we learn that a stimulus is paired with a reward only if, initially, we don't expect it — there must be a 'prediction error' for learning to occur. Now Waelti et al. have shown that dopamine neurons in the midbrain seem to follow the same rules. Their study is a compelling example of the direct testing of a prediction that arises from associative learning.

Classical learning theory predicts that learning will occur whenever a stimulus is paired with a reward, and this seems intuitively sensible. But more recent work has led to the idea that learning only occurs when a prediction error is present. This can be shown using a 'blocking' procedure. First, an animal learns, by repeated trials, that stimulus A — a bell, perhaps — is always followed by a reward – say, some fruit juice. After a while, the animal will lick at the juice spout every time it hears the bell, in anticipation of the juice. If the animal then sees a coloured light (stimulus X) together with the bell before the juice is delivered, we might expect that it would learn to associate the light with the juice, and lick the spout even if it saw the light alone. But this does not happen — because the juice is already fully predicted by the bell, there is no prediction error, so the animal never learns to associate the light and the juice.

Waelti et al. have recorded the activity of dopamine neurons in the midbrain during this type of training, with various coloured shapes as stimuli. Dopamine signalling is thought to be important for reward systems, and there is evidence that the activity of dopamine neurons may code the prediction error.

In fact, in the new study, Waelti et al. found that dopamine neurons were activated by the reward-predicting stimulus A, but not by a stimulus that was not paired with reward. When the authors trained their animals using a blocking procedure, they found that the compound stimulus set (AX) activated the dopamine neurons, but X alone did not.

By contrast, if another stimulus, B — perhaps a different coloured light — is not normally paired with reward, but then B and Y (a whistle) are together paired with the juice, the animal will learn that Y predicts juice even in the absence of B. This is because B does not predict any reward, so when the two stimuli are paired with the juice, there is a prediction error, which leads to learning. After training, the animals' dopamine neurons were strongly activated by stimulus Y.

The neuronal responses precisely reflected the behavioural responses of the animals, which showed much more anticipatory licking following Y than after X. When a reward was presented after stimulus X, it strongly activated the dopamine neurons — exactly as we would expect if the neurons code prediction error. By contrast, after stimulus Y, which the animals had learned to associate with reward, the presentation of fruit juice would create no prediction error and, correspondingly, it produced no increase in dopamine activity.

The dopamine neurons appear to 'learn' the stimulus–reward association, and their responses conform precisely to the predictions of learning theory. Neuronal learning requires the presence of a prediction error, and the neuronal responses appear to code this prediction error. It is possible that similar approaches that aim to integrate electrophysiological recording and behavioural learning rules will lead to important insights into the cellular basis of learning.