The use of invertebrate preparations has contributed greatly to our understanding of the neural basis of learning. The leech is especially useful for studying behavioral changes and their underlying neuronal mechanisms. Learning in the leech is essentially identical to that found in other animals, both vertebrate and invertebrate. Using anatomical and physiological techniques on leeches as they learn, we have begun to characterize the properties of individual neurons and neuronal networks that play a role in learning. We have been able to show two neuronal mechanisms that have not been previously associated with associative conditioning. The first has to do with the importance of contingency: one stimulus [the conditional stimulus (CS)] becomes associated with a second stimulus [the unconditional stimulus, (US)] in proportion to the ability of the CS to predict the US. We have found that important properties for encoding predictability, such as circuit reconfiguration, may lie in the US pathway. The firing of the serotonergic Retzius cells is taken as the US; consistent CS prediction of a US prevents "dropout" of a critical component of one US pathway. Throughout training, predicted USs continue to elicit a barrage of action potentials in these cells. Recurring unpredicted USs degrade both the learning and the response of the Retzius cell to the US. A second insight is that at least two US pathways contribute to learning, the Retzius cell pathway and the nociceptive (N) cell pathway. This second pathway persists after the elimination of the Retzius cell pathway. The observation of multiple US pathways raises a host of issues concerning CS-US convergence and the functional significance of distinct US pathways, and our results are discussed in terms of implications to current models of learning.