The calculation of prediction error, that is, the difference between the expected reward from a task and the actual result, is important for associative learning. It is calculated by ventral tegmental area dopaminergic (VTA DA) neurons, but the mechanism is not known. In a classical conditioning paradigm, changing the temporal expectation of a reward resulted in alterations in VTA DA neuron activity — when a cue correctly predicted a reward, VTA DA neuron activity would be suppressed (and vice versa). These activity changes, achieved by a subtraction computation, were found to be mediated by local GABAergic inputs that encode reward expectation, indicating a role for this circuit in reinforcement learning.