Conditioning
What, exactly, is learned when a signal comes to mean food?
Pavlov's dogs salivate to a signal paired with food; the response fades in extinction and part of it returns the next day. Thorndike's cats escape a puzzle box faster and faster, gradually: the law of effect. Watson builds behaviourism on it and conditions one infant to fear a white rat, a demonstration that grew in the retelling. Skinner's chamber records every response: shaping by successive approximation, and four schedules of reinforcement, each with its signature. Then the turn: Rescorla's random control shows that pairing teaches nothing without contingency, and Kamin's blocking that a paired cue teaches nothing when the outcome is already predicted. Rescorla and Wagner write surprise as one line, gradient descent on a squared prediction error, which predicts blocking, inhibition and overexpectation, and whose asymptote is the contingency itself. Its failures, latent inhibition, recovery and renewal, show that extinction is new learning bound to context; attention, time and choice extend it, and the matching law follows from melioration. Biology sets limits: taste goes with sickness, animals drift back to instinct, children learn by watching.
What you need. Part 2's experimental designs, Part 12's detection theory and Part 14's latent causes. Derivatives and the idea of a gradient; a little probability.
- Hook
- Pavlov's dogs; Kamin's blocked rats
- Ideas, models and mathematics
- classical and operant conditioning, contingency, blocking, Rescorla–Wagner derived, attention models, schedules, the matching law, extinction and its return, preparedness
- Psyche gains
- an associative learner, an operant chamber and a meliorating chooser
- On you
- the gardener's game: predict the plants, reveal your ΔP
What you will be able to do
Psych 101 and the major
- Describe acquisition, extinction, spontaneous recovery, generalization and the four schedules.
- Explain why contingency, not pairing, drives learning, and what blocking shows.
- Explain why extinguished fears return, and what that means for exposure therapy.
Graduate
- Derive the Rescorla-Wagner rule as gradient descent and run it on the classic designs.
- Prove that its asymptote with a context cue is the contingency, delta P.
- Derive the matching law from melioration, and show where melioration is a trap.
Research
- Weigh associative against propositional and latent-cause accounts of human conditioning.
- Assess the reliability of blocking and the evidence for reconsolidation.
Practice
- Explain how exposure therapy, contingency management and animal training use conditioning.
- Recognize variable-ratio schedules in product design, and what the evidence on loot boxes shows.
Contents
Each chapter has a home level. Choose a track to see what to read and watch: Psych 101 and the major 42 min · Graduate 46 min · Research 57 min · Practice 46 min.
- 0A response that comes backPsych 101 and the major4 min
- 1Pavlov's methodPsych 101 and the major3 min
- 2The law of effectPsych 101 and the major4 min
- 3Skinner's boxPsych 101 and the major4 min
- 4Contingency, not pairingPsych 101 and the major3 min
- 5BlockingPsych 101 and the major2 min
- 6The Rescorla-Wagner rulePsych 101 and the major4 min
- 7What the rule predictsResearch3 min
- 8What the rule gets wrongPsych 101 and the major4 min
- 9Attention to cuesResearch2 min
- 10TimeResearch2 min
- 11ChoicePsych 101 and the major3 min
- 12Biology's limitsPsych 101 and the major6 min
- 13The LedgerPsych 101 and the major4 min
- 14In practice: therapy, training and gamesPractice4 min
- 15Frontier: links, beliefs and hidden causesResearch3 min
- Recap, problems, and the road aheadAll tracks3 min
Also on this page: Lecture · Key results · Try it · Lab · Problems · Notes and sources · Build the film.
Lecture
The text of each chapter is the film's narration, as it is spoken, so you can read along or revise without the film. The pictures are in the film.
A response that comes backPsych 101 and the major4 min
In 1904 Ivan Pavlov won the Nobel Prize, not for anything to do with psychology, but for his work on digestion. His dogs had a habit that spoiled his measurements: they began to salivate before the food arrived. At the sight of the dish, at footsteps, at the attendant who fed them. Pavlov turned the nuisance into a method. A small tube from a salivary gland carried the secretion outside, where it could be counted, drop by drop. Then he paired a neutral signal with food, again and again, and counted. The signals were metronomes, buzzers, lights and touches on the skin. The bell everyone remembers is mostly legend: in decades of his laboratory's records, his biographer Daniel Todes found it used only rarely.
Here is the pattern his laboratory found, run on Psyche. Pair the signal with food, and over a few dozen trials the signal alone brings more and more saliva. That's acquisition. Now present the signal without food. The response fades, trial by trial, until nothing comes. That's extinction. It looks like forgetting. But wait a day and present the signal again, and part of the response is back. Something was learned in extinction, but it wasn't the erasure of the first lesson. That puzzle, a response that can come back from nothing, will take us to the end of this part.
Here's a puzzle to carry through the part. Two dogs each get forty pairings of a signal with food. For the first, food never comes any other way. For the second, food also arrives, just as often, when there's no signal at all. Do they learn the same thing? On the view Pavlov's work made standard, they should: same pairings, same learning. In 1968 an experiment of exactly this design, with rats and mild shocks instead of dogs and food, showed that the second animal learns nothing at all about the signal. Learning isn't about pairing. It's about prediction.
Act Three was about the senses: how the mind measures the world. Act Four is about how it changes with experience, and it starts here. When a signal comes to mean food, what has changed? A reflex, a link between two ideas, or a prediction? Why does a cue that is perfectly paired with food sometimes teach an animal nothing? How do rewards shape what animals do, and how they divide their time between options? And why do fears that therapy has extinguished come back?
This is Part 16 of Psychology, Built: conditioning. We'll start with the three founders: Pavlov's method, Thorndike's law of effect, and Skinner's schedules of reinforcement. Then the discovery that learning follows contingency rather than pairing, with a game for you to play. Then blocking, and the idea that animals learn only when they're surprised. Then one line of algebra, the Rescorla-Wagner rule, which we'll derive as gradient descent and run on every classic design. Then what it gets wrong: extinction that is new learning, attention, and time. And at the end, how animals divide their choices, the limits that biology sets, and where all this is used: in therapy, animal training, treatment for addiction, and the design of games that are hard to put down.
What it does: Pavlov's laboratory; acquisition, extinction and recovery on Psyche; two dogs with the same pairings; objectives
1Pavlov's methodPsych 101 and the major3 min
Pavlov's method came with a vocabulary, and it's still the vocabulary of the field. Food in the mouth produces saliva without any learning. Food is the unconditioned stimulus, the US, and salivation is the unconditioned response. A metronome, at first, produces nothing but a turn of the head. After pairings with food it produces saliva on its own: the metronome has become a conditioned stimulus, a CS, and the saliva it brings is the conditioned response. The English word is a slip of translation. Pavlov wrote of conditional reflexes: reflexes that depend on conditions, on the animal's history. That is the better word, because the whole question of this part is what those conditions are.
Two more findings from Pavlov's laboratory. Train a dog on a tone of a thousand hertz, then test others. Nearby tones also bring saliva, and the further from the trained tone, the less. The response spreads along a gradient, here drawn on Psyche, with octaves as the distance. Now feed the dog after the thousand-hertz tone but never after fourteen hundred. The dog learns to respond to one and not the other, and the gradient sharpens. That's discrimination, and it became a way to ask animals what they can perceive. Pavlov also pushed it too far. When a circle signalled food and an ellipse didn't, and the ellipse was made rounder and rounder, some dogs became agitated and stopped working altogether. He called it experimental neurosis, an early and uncomfortable model of anxiety.
So what is learned? Pavlov's own answer was stimulus substitution: the signal becomes a stand-in for the food, wired in the brain to the same reflex. If that were right, the conditioned response would copy the unconditioned one. Often it doesn't. A shock makes a rat jump, but a tone that predicts a shock makes it freeze. And cues that predict a drug can produce the opposite of the drug's effect, the conditioned tolerance we met in Part 10, which is why an overdose is more likely in an unfamiliar place. The response is a preparation for what is coming. The signal doesn't stand in for the food. It predicts it. Robert Rescorla, whose experiments fill the middle of this part, put it this way in 1988: conditioning isn't the low-level reflex business of the textbooks. It's how animals learn the relations among events in their world.
What it does: US, UR, CS, CR; generalization and discrimination; substitution against preparation
2The law of effectPsych 101 and the major4 min
While Pavlov was studying digestion, a young American, Edward Thorndike, was putting cats in boxes. A hungry cat goes into a slatted crate with food outside. One act opens the door: pulling a loop of string, say, or pressing a lever. The cat scratches, bites, squeezes, and eventually, by accident, pulls the loop and gets out. Thorndike put it back and timed it again. The times fell, but gradually and unevenly, not in the sudden drop you'd expect if the cat had understood. Here is Psyche's cat, a learner that just strengthens whatever act preceded escape, with the median of two hundred such cats. Thorndike called the principle the law of effect: acts followed by a satisfying state of affairs are stamped in, and acts followed by discomfort are stamped out. Pavlov's dogs learned what signals what. Thorndike's cats learned what to do.
In 1913 John Watson published a manifesto. Psychology, he said, should give up studying consciousness by introspection, the method of Part 1, and study behaviour instead. Its goal was the prediction and control of behaviour, by the methods of Pavlov and Thorndike. And Watson made a bold claim: human emotions, fears, loves and habits, are conditioned responses, learned, and so could be learned differently. For about forty years much of American psychology followed him. To show the claim in action, he ran one experiment on one baby.
The experiment is famous, and the version most people know isn't quite the one in the paper, so here are Watson and Rayner's own notes. Albert, the son of a wet nurse at a Baltimore hospital, was tested at about nine months with a white rat, a rabbit, a dog, masks and cotton wool. He showed no fear of any of them. A hammer struck on a steel bar behind his head made him start and, on the third blow, cry. At eleven months, as he reached for the rat, the bar was struck. Twice. A week later, five more pairings, seven in all, and now he cried and crawled away from the rat alone. Five days later the fear had spread: to a rabbit, a dog, a sealskin coat, a Santa Claus mask, but not to his toy blocks. A month later it was weaker but still there. That day Albert left the hospital, and the experimenters noted that they had lost the chance to remove the fear. Nobody did.
So what does it show? One infant, with the results kept as notes and a film, and no measure scored by anyone blind to the condition. In 1979 the historian Ben Harris traced how textbooks retold it. The story grew: more objects, stronger fear, and in some versions a cure that never happened. Even Albert's identity is disputed. Historians have proposed two different children, one who died of hydrocephalus at six, and one who lived to eighty-seven, and never knew. It's a demonstration that fear can be conditioned in a child, and a lesson in what research ethics now forbids. It isn't evidence for a theory of phobias. The Ledger has its row.
What it does: Thorndike's cats; behaviourism; Little Albert as recorded, and as retold
3Skinner's boxPsych 101 and the major4 min
In the 1930s, B. F. Skinner made Thorndike's method automatic. In his chamber a rat or a pigeon is free to respond whenever it likes, and every press of a lever or peck at a key is recorded. Food arrives by a rule the experimenter sets. Skinner called this behaviour operant, because it operates on the world, and its consequences change how often it happens. Pavlov's responses were elicited by a signal; operant responses are emitted. His most important instrument was a pen. It moves steadily across a roll of paper and steps up once at every response, so the slope of the line is the rate of responding. A whole session fits on one picture.
How do you teach an animal something it never does? You can't reinforce a response that doesn't happen. Psyche's rat is to rear up to a height of three, and its rears vary around a height of zero. If you wait for a three, you'll wait for ever: the red line barely moves, and almost nothing is rewarded. Instead, reward whatever is better than most recent attempts, and keep raising the bar. Each reward pulls the typical response toward it, and the green line climbs to the target and beyond. Skinner called it shaping by successive approximation. It's how he taught pigeons to play a kind of ping-pong, and how guide dogs, and many human skills, are trained today.
Skinner and Charles Ferster spent years on a single question: what happens when not every response is rewarded? The rule that decides which ones are is a schedule of reinforcement, and each leaves its own signature on the record. Here are Psyche's. On a fixed ratio, every twentieth press pays. The record is a staircase: a pause after each reward, then a fast run to the next. On a variable ratio, a press pays at random, one time in twenty on average. There's no point in pausing, and the rate is the highest of all: this is the slot machine's schedule. On a fixed interval, the first press after sixty seconds pays. Animals learn the time. They stop after each reward and speed up as the interval ends, and the record curves upward in a scallop. On a variable interval, rewards become available at unpredictable times. The rate is moderate and remarkably steady, which is why it became the workhorse of the laboratory.
Schedules also decide what happens when the rewards stop. Take the food away and pressing extinguishes, as Pavlov's salivation did. But an animal rewarded on every press gives up quickly, while one rewarded only sometimes keeps going far longer. It's called the partial reinforcement extinction effect, and it's one of the most reliable findings in the field. One way to see it: after intermittent reward, a long run of failures is normal, so it takes a long time to notice that anything has changed. The practical lesson is uncomfortable. A parent who gives in to a tantrum now and then, but not always, is running a variable schedule, and trains the most persistent tantrums of all.
What it does: The chamber and the recorder; shaping; four schedules; partial reinforcement, drawn as two press records
4Contingency, not pairingPsych 101 and the major3 min
Before the history, a game. You're a gardener testing a fertilizer. Twenty-four plants: some get the fertilizer, marked with a blue bag, and some don't, and each one either blooms or doesn't. Watch them go by. Don't count. Just form an impression.
Now rate it. How strongly does the fertilizer make the plants bloom, from minus a hundred, it prevents blooming, through zero, no effect, to plus a hundred? Pause and pick a number.
Here are the counts. Of the twelve fertilized plants, nine bloomed. That's what you notice: fertilizer, then flowers, again and again. But of the twelve plants with no fertilizer, nine bloomed too. The chance of blooming is three in four either way. The right measure is the contingency, delta P: the probability of the outcome with the cause, minus the probability without it. Here it's exactly zero. The fertilizer does nothing. If you gave it a positive number, you're in good company. When an outcome is common, people often judge a useless cause to be working, the outcome-density effect, and it's the engine of many folk remedies: most colds get better whatever you take. Even so, when Edward Wasserman and colleagues had people rate many such contingencies in 1993, the ratings followed delta P closely. People, like rats, are mostly tracking contingency, not pairing.
In 1968 Robert Rescorla ran the animal version, with exactly the puzzle from the start of this part. Eighty rats heard a two-minute tone, twelve times a session, for five sessions. In every two-minute stretch there was some chance of a brief shock while the tone was on, and some other chance while it was off. Ten groups had ten different pairs of chances. Fear of the tone was measured afterwards, by how much it made the rats stop pressing a lever for food. The result was clean. Whenever the two chances were equal, the shaded squares, the rats learned little or no fear of the tone, even in the group that heard it paired with shock again and again. With the chance during the tone held fixed, adding shocks when the tone was off reduced the fear. Fear followed the difference between the two chances, the contingency, not the number of pairings. The obvious next question is what kind of learning machine computes a contingency. The answer came four years later, after one more experiment.
What it does: The fertilizer game; ΔP and the outcome-density effect; Rescorla's ten groups
5BlockingPsych 101 and the major2 min
The one more experiment was Leon Kamin's, published in 1969, and it's the most important design in this part. Rats in the blocking group first learn that a noise predicts a shock. Then the noise and a light come on together, followed by the same shock. A control group gets only this second phase. Finally the light is tested alone. Both groups had exactly the same pairings of light with shock. The control rats learned to fear the light strongly. The blocking rats learned almost nothing about it. For them the noise already predicted the shock, so the light told them nothing new. Learning about the noise had blocked learning about the light.
Kamin's interpretation is the turning point of this part. An animal learns about a cue only when the outcome that follows it is surprising. He tested the idea directly. If the shock in phase two is made stronger than the one the noise predicts, the outcome is a surprise again, and now the light is learned. That's called unblocking. So pairing isn't enough, and even contingency isn't quite the point. What drives learning is the error in a prediction: the difference between what happened and what was expected. Blocking is built into nearly every theory of learning since, and Part 17 finds its signature in the firing of dopamine neurons. It's also less reliable than the textbooks suggest, and the Ledger will say how much less.
What it does: Kamin's design; surprise and unblocking
6The Rescorla-Wagner rulePsych 101 and the major4 min
In 1972 Robert Rescorla and Allan Wagner wrote the idea of surprise as a single line. Every cue X carries a number, V of X: the strength of its association with the outcome, which you can read as the prediction it makes. On each trial an outcome happens, lambda: one if the food or shock arrives, zero if nothing does. The cues present make a prediction together, the sum of their strengths. That sum is the important move: cues share the prediction, so they compete for it. The difference between what happened and what was predicted is the prediction error, Kamin's surprise. Every cue present changes its strength in proportion to that error, scaled by two learning rates, alpha for the cue's salience and beta for the outcome's. If the outcome was fully predicted, the error is zero, and nothing is learned.
Here's why the rule has lasted. Define the error of a trial as half the square of the prediction error. The x's say which cues are present: one if present, zero if not. Differentiate with respect to cue X's strength, and you get minus the prediction error, times x. Step a little way downhill, against the gradient, and you have exactly the Rescorla-Wagner rule, with the step size alpha times beta. Conditioning, on this account, is gradient descent on the squared error of a prediction. Engineers had found the same rule twelve years earlier: Bernard Widrow and Ted Hoff's delta rule, which still runs in the echo cancellers of telephones. And it's the least-mean-squares learning inside a linear neuron, which the series built from scratch in AI, Built. A rat, an echo canceller and a neural network learn by the same principle.
Run it on Pavlov's dog. At first the cue predicts nothing, the error is large and the strength jumps. As the prediction improves, the error and the steps shrink, and the curve bends over toward lambda. Each step is a fixed fraction of the remaining error, so the approach is exponential: the negatively accelerated learning curve seen in experiment after experiment. Now stop the food. Lambda is zero, the error is negative, and the strength falls back toward zero by the same rule. Notice what the model has said: that extinction is unlearning, a return to the state before training. Pavlov's dogs, with their recovery the next day, have already told us that's wrong. We'll come back to it.
Here is blocking, in pictures. On a trial with both the noise and the light, the error depends on the two strengths. The surface is shaded by that error, and it's zero all along the line where the two strengths add up to one. The control rats start at the origin, knowing nothing. The gradient points straight along the diagonal, so both cues gain strength equally, and they meet the line at a half each. The blocking rats start at one comma zero: the noise already predicts the shock fully. They're already on the line. There's no error, no gradient, and the light never leaves zero. Nobody told the rule about blocking. It falls out of the sum: cues share one prediction, so a cue gains strength only by reducing an error that something else has not already removed.
What it does: The rule; its derivation as gradient descent; acquisition and extinction; blocking on the error surface
7What the rule predictsResearch3 min
Blocking was the rule's first success. Here are three more. Overshadowing. Train a loud cue and a faint one together. Both are paired with the outcome every time, but the salient one, learning faster, takes most of the prediction, and the faint one ends far below where it would be trained alone. Pavlov saw this. Conditioned inhibition. Cue A is followed by food, but whenever X accompanies A, no food comes. X can't become negative by being paired with nothing, on its own. But A's prediction creates an error when A and X appear together, and X goes below zero: it becomes a safety signal, a cue that the outcome won't happen. And overexpectation, the prediction nobody expected. Train A and B separately, each until it fully predicts the food. Then present them together, with the same food. Together they predict two helpings, the error is negative, and both lose strength, even though both are still being reinforced on every trial. The rule predicts that reward can weaken learning. In 1978 Edward Kremer tested it with rats, and found exactly that.
Now the puzzle of the two dogs. How can a rule built from pairings compute a contingency? The trick is the context: the box, the room, is a cue too, and it's present on every trial. On trials with the cue, the cue and the context share the prediction. At equilibrium the expected change is zero, so the two strengths add up to the probability of the outcome with the cue. On trials without the cue, the context alone predicts, so its strength settles at the probability of the outcome without the cue. Subtract, and the cue's strength is the difference: delta P. In the random group, the context predicts the shocks perfectly well by itself, and the tone, adding nothing, ends at zero. Gretchen Chapman and Steven Robbins pointed out in 1990 that, with equal learning rates for outcomes and their absence, the rule's asymptote is exactly the contingency, which ties the rat's learning to the gardener's judgment.
And here is Rescorla's 1968 experiment, run on Psyche with the paper's schedule: eight simulated rats in each of the ten groups, the median shown, and a low bar meaning more fear. The four groups with equal chances, in red, stay close to point five: little or no fear, however many pairings they had. In the others, fear grows as the chance of shock without the tone falls, just as the paper reported. The exact numbers depend on choices Psyche makes, the learning rates and how fear turns into suppression. The pattern doesn't: it's the contingency, and the rule computes it from nothing but pairings and a context.
What it does: Overshadowing, inhibition, overexpectation; why the asymptote is ΔP; Rescorla's groups on Psyche
8What the rule gets wrongPsych 101 and the major4 min
The rule's successes are real, and so are its failures, and the failures taught the field as much. First: show a rat a tone many times with nothing following, then pair it with shock. It learns more slowly than a rat that never heard the tone. Second: an extinguished response comes back with time, as Pavlov's dogs showed. Third: it also comes back when the animal is moved to a different place. In the rule, all three are impossible for the same reason. A cue's whole state is one number. A tone that has never been trained and a tone that was trained and then extinguished both sit at zero, and the rule can't tell them apart. Animals can.
Take the first. In 1959 Robert Lubow and Ulrich Moore preexposed sheep and goats to a signal, unpaired with anything, and then conditioned them with it. Conditioning came more slowly than to a fresh signal. They named it latent inhibition. In Rescorla-Wagner, preexposure does nothing at all: with no outcome and no prediction, the error is zero, and the grey curve is the same either way. Something else changed during preexposure: the animal learned to ignore a cue that predicts nothing. The red curve is a model in which attention is learned, and it comes in the next chapter.
The third failure turned into a theory. In 1979 Mark Bouton and Robert Bolles trained fear of a tone in one box, A, extinguished it completely in a different box, B, and then tested the tone back in A. The fear came back, at the level of rats that had never been extinguished. Bouton's reading: extinction doesn't erase the first learning. It adds a second memory, the cue now means nothing, and it's that second meaning which depends on the context where it was learned. Psyche's version keeps two memories. An excitatory one, from training, that holds everywhere, and inhibitory ones, from extinction, each tagged with its context and expressed fully only there. Extinguish and test in the same box, and the response stays gone. Test anywhere else, and it comes back. And here's where Psyche is wrong. It predicts the same return when training and extinction share a box and the test is somewhere new. Real animals show that too, but usually less: some of the first learning is tied to its context as well.
Spontaneous recovery fits the same idea. Bouton argued that time works like a context: the longer the gap, the less the moment of the test resembles the moment of extinction. In Psyche, the extinction memory is expressed less as that resemblance fades, and the response climbs back toward its trained level. This matters far beyond the laboratory. A fear extinguished in a therapist's office, this week, is extinguished there and then. That it can come back later, and at home, isn't a failure of the patient. It's what extinction is.
What it does: Latent inhibition; renewal and a two-memory model; spontaneous recovery
9Attention to cuesResearch2 min
Latent inhibition says that animals learn not only what cues predict but which cues to pay attention to. In Rescorla-Wagner, a cue's learning rate, alpha, is fixed. Two theories let it learn, and they disagree about how. Nicholas Mackintosh, in 1975: attend to the cues that predict best. A cue whose own prediction is better than the others' gains attention; a cue that does worse loses it. That explains blocking a second way: the light is a worse predictor than the noise, so the rat stops attending to it. John Pearce and Geoffrey Hall, in 1980, said nearly the opposite: attend to the cues whose consequences are still uncertain. A cue followed by surprises keeps its attention; once you know what a cue means, you can stop watching it. That explains latent inhibition: a tone followed, reliably, by nothing becomes boring, and is learned about slowly afterwards.
Give both models one history. Cue A is always followed by food. Cue B is followed by food half the time, at random. Mackintosh's animal learns to attend to A, the cue that predicts reliably, and to tune B out. Pearce and Hall's animal does the reverse: A has been figured out and loses attention, while B, which keeps producing surprises, holds it. Same experience, opposite attention.
Which one describes real animals? In people, cues that were good predictors in one task are learned about faster in the next, which is Mackintosh's signature, and it shows in where people look. But people also attend more to cues whose outcomes were uncertain, which is Pearce and Hall's. So the current answer is both, perhaps for different purposes: exploiting what predicts, and exploring what doesn't yet. Hybrid models combine the two, and reviews of human learning find evidence for each. Attention that is itself learned from prediction errors is where conditioning meets the study of attention, in Part 18.
What it does: Mackintosh against Pearce and Hall; one history, opposite attention; both, it seems
10TimeResearch2 min
In Rescorla-Wagner, time doesn't exist: there are only trials. Animals, though, learn when. In the peak procedure, a reward arrives a fixed time after a signal starts, and now and then a long trial comes with no reward at all. On those trials, responding rises, peaks around the trained time, and falls away. The longer the interval, the wider the peak, and the width grows in proportion to the interval. Divide time by the trained interval and the curves fall on top of each other. That's the scalar property, Weber's law from Part 11, applied to time: an animal timing twenty seconds is as precise, relatively, as one timing sixty.
Time also breaks the rule in a deeper way. In autoshaping, a key lights up before food, and pigeons come to peck it. Spread the trials further apart and the birds need fewer of them to learn: across many experiments, the number of rewards needed falls in proportion to the ratio of the gap between trials to the length of the signal, about three hundred divided by that ratio. Only the ratio matters. Double the gap and the signal together and nothing changes. Rescorla-Wagner, counting trials and letting the context compete, barely notices the spacing. Randy Gallistel and John Gibbon proposed a different machine. The animal doesn't strengthen links at all. It estimates two rates of reward, one while the signal is on and one overall, and starts to respond when their ratio is clearly greater than one. The ratio of rates is set by I over T, so the law falls out. Associations or computations of rate: the argument isn't settled, and the ratio law itself turns out to have exceptions.
What it does: Scalar timing; the I/T law and rate estimation
11ChoicePsych 101 and the major3 min
So far one response, one reward. Real animals choose. In 1961 Richard Herrnstein gave pigeons two keys, each paying off on its own variable-interval schedule, and varied how rich each one was. The pigeons divided their pecks between the keys in the same proportion as the rewards: a key giving seventy percent of the food got about seventy percent of the pecks. That's the matching law. Here it is on Psyche, for seven pairs of schedules: the points lie along the diagonal. Fitted on log ratios, the slope is the sensitivity to reward. William Baum surveyed over a hundred data sets in 1979: matching on average, with slopes often a little below one, which is called undermatching, as if the animals spread their bets a little too evenly.
Why would an animal match? Herrnstein's answer was a process he called melioration. Each key has a local rate of return: rewards per response spent on it. A meliorator moves its responses toward whichever key is paying better per response, right now. It stops moving only when the two local rates are equal. Write that down, rewards over pecks on the left equal to rewards over pecks on the right, and rearrange: it's the matching law. Psyche's chooser knows nothing about matching. It just meliorates, and matches. The same chooser on two ratio keys, where each response has a fixed chance of paying, finds that the local rates can never be equal, and drifts to the richer key almost entirely. Pigeons do that too.
Melioration usually works. Sometimes it's a trap. Here are two options. A always pays one point more than B, at that moment. But both pay according to f, the share of your recent choices that were B. Every time you choose A, you lower what both options will pay later. A meliorator follows the better local return, chooses A again and again, and slides down to about one point a choice. Choosing B every time, which always feels worse in the moment, earns three. Herrnstein and Drazen Prelec proposed this as a model of addiction: each drink or dose is better than the alternative at the time it's taken, while the habit lowers the value of everything, including the drug. Part 17 builds learners that look further ahead, Part 26 returns to choices over time, and Part 41 to addiction.
What it does: The matching law; melioration derives it; when melioration is a trap
12Biology's limitsPsych 101 and the major6 min
Every result so far assumed that any cue can be linked to any outcome, the same rule for a tone and a taste, for food and shock. John Garcia broke that assumption. With Robert Koelling, in 1966, he gave rats water that was flavoured, and that also flashed a light and made a click whenever they licked. Then some rats were made mildly ill, with X-rays or a lithium injection, and others got a shock. The sick rats came to avoid the taste, but not the light and click. The shocked rats avoided the light and click, but not the taste. And with illness, one pairing could be enough, with hours between the drink and the sickness, a delay that would make any other conditioning impossible. Journals turned the work down at first: it didn't fit the laws. But it fits an animal's life. Sickness usually comes from something eaten, hours earlier, and pain from something seen or heard. If you've ever been unable to face a food after a bout of sickness that probably wasn't its fault, you've met Garcia's effect.
The same lesson came from the most practical animal trainers of their day. Keller and Marian Breland had studied with Skinner, and went into business training animals for fairs and television. A raccoon was to earn food by dropping coins into a box. It learned, and then began holding on to the coins and rubbing them together, as raccoons rub and wash their food, even though that cost it its reward. Pigs carrying wooden tokens to a piggy bank began dropping them and rooting them along the ground. The reinforced behaviour drifted back toward the species' own way of handling food. In 1961 they published it, under a title that teased their teacher: The Misbehavior of Organisms. Martin Seligman later called the general idea preparedness. Evolution makes some links easy to learn, like fear of snakes or of heights, and others hard, which is why phobias of electrical sockets are rare.
One last limit, of a different kind. In 1961 Albert Bandura, Dorothea Ross and Sheila Ross ran an experiment with seventy-two children at the Stanford nursery school. Some watched an adult attack an inflatable clown doll, punching it, kicking it, hitting it with a mallet. Others watched a quiet adult, or no one. Later, left in a room with the doll, the children who had seen the attack reproduced it, often move for move. Nobody was rewarded for anything. The children learned by watching, which neither Pavlov's nor Skinner's account allowed. How far a doll made to be hit tells us about real aggression is still argued. Animals do it too. Monkeys raised in a laboratory, with no fear of snakes, acquire it by watching another monkey react to one. Shown the same reaction to a flower, edited into the film, they don't learn to fear flowers. Observation and preparedness, together.
Bandura then asked what the watching had actually taught. In 1965 he showed sixty-six nursery-school children a short film of an adult attacking the doll, with one of three endings. In one, another adult rewarded the model with sweets and praise. In another, the model was scolded and spanked. In the third, nothing followed. Then each child was left with the doll. Those who had seen the model punished copied fewer of the attacks than the others. What happened to the model worked on the watchers, which Bandura called vicarious reinforcement. Then came the twist. An experimenter came back and offered every child fruit juice and stickers for each of the model's acts they could show. The differences between the groups almost vanished. The children who had seen the punishment had learned the acts as well as anyone; they had simply not chosen to perform them. That is the distinction between learning and performance. On this view, reward decides what we do with what we know, not whether we learn it, and the learning itself can happen by watching alone.
Bandura built these results into a theory. In his 1977 book, Social Learning Theory, people learn from what others do and from what happens to them. Whether an act is copied depends on attention, on memory, on being able to do it, and on a reason to. The same year he added self-efficacy: a person's belief that they can carry out an action, which shapes whether they try it, and how long they keep going. Imitation itself has a good record. In 1963 the same team found that children copied an aggressive model on film, even one dressed as a cartoon cat, much as they copied one in the room, and imitation of models has been found in many settings since. The leap from the doll to violence in the world is another matter. In 2010 Craig Anderson and colleagues pooled studies of violent video games and found small effects on aggressive thoughts, feelings and behaviour. Christopher Ferguson argued that the effects shrink once weak measures and unpublished studies are allowed for, and in 2017 a reanalysis by Joseph Hilgard, Christopher Engelhardt and Jeffrey Rouder found the experimental effects overstated. So children learn by watching, and that is solid. Whether watching violence makes for violence is still argued, and a doll made to be hit cannot settle it. That is where the Ledger takes over.
What it does: Garcia and Koelling; instinctive drift and preparedness; learning by watching; learning against performance; social learning theory
13The LedgerPsych 101 and the major4 min
Six rows today. The first: a cue paired with an outcome that another cue already predicts acquires little or no association. The original: Kamin, 1969, with rats. The record: blocking has been reported in many species and procedures since. But in 2016 Tom Beckers's group published fifteen careful experiments, in people and in rodents, using procedures like or identical to published ones, and found no blocking in any of them. Critics answered that most used cues of the same sense, which theory says should weaken blocking. Either way, it's weaker and less dependable than the textbooks imply. Replicated, smaller.
The second: rats readily learn to avoid a taste followed by illness, even hours later, and a light or sound followed by shock, but not the reverse pairings. The original: Garcia and Koelling, 1966. The record: Domjan and Wilson, in 1972, found the same selectivity with the cues delivered the same way, answering the objection that taste and light differed in timing, and taste aversions have been found in many species, including people. It's among the most robust findings in learning. Replicated.
The third is a row Part 10 promised: tolerance to a drug is partly a conditioned response to the cues that come with it, so the same dose is more dangerous somewhere new. The original: Shepard Siegel and colleagues, 1982. Rats given heroin in one room were then given a large dose. A third died in the usual room, two thirds in a new one. The record: repeated with many drugs and species, reviewed by Siegel and Ramos in 2002. In people the evidence comes from survivors' reports and studies of reactions to drug cues: consistent, but observational. Replicated.
The fourth: an infant was conditioned to fear a white rat, the fear spread to furry things, and it showed how phobias are learned. The original: Watson and Rayner, 1920: one infant, seven pairings. The record: Harris, in 1979, on how the story grew in the retelling; Powell and colleagues, in 2014, on whether we even know who Albert was. One child, unblinded notes, no removal of the fear: a demonstration, and an ethical lesson, not evidence. Story and record.
The fifth: given two sources of reward, animals divide their responses in proportion to the rewards each provides. The original: Herrnstein, 1961, with pigeons. The record: Baum's 1979 survey of a hundred and three data sets from twenty-three studies: matching on average, with undermatching common. It holds across species, people included, and across kinds of reward, as a description of choice between interval schedules. Replicated.
The sixth: a fear extinguished in one context returns when the cue is met in the context where the fear was learned. The original: Bouton and Bolles, 1979. The record: reviewed by Vervliet, Craske and Hermans in 2013, renewal has been found across species, including human fear conditioning and patients after exposure therapy. Extinction adds learning tied to its context; it doesn't erase the first. Replicated.
What it does: Blocking; taste aversion; conditioned tolerance; Little Albert; matching; renewal
14In practice: therapy, training and gamesPractice4 min
The most important use of conditioning is in treating fear. A phobia, or the fear after a trauma, behaves like a conditioned response: a cue predicts danger, and avoiding the cue keeps the prediction from ever being tested. Exposure therapy is extinction. The patient meets the feared cue, again and again, and the feared outcome doesn't come. The prediction error does the work. It's among the best-supported treatments for anxiety disorders, and Parts 40 and 42 weigh the evidence. But chapter eight applies to patients too. Extinction is tied to its context, and fear treated in a clinic can return at home, or months later. So modern exposure is designed around Bouton's results: practice in many places, at different times, with varied cues, and arrange sessions to violate the patient's predictions as strongly as possible, rather than simply to bring the fear down.
Skinner's methods are everywhere animals are trained. A clicker is a conditioned reinforcer: a sound paired with food until the sound itself rewards, and unlike food it can be delivered at the exact instant of the right movement. Shaping by successive approximation trains dolphins, guide dogs and laboratory monkeys. Trainers have largely moved from punishment to reward, partly because punishment teaches a lesson nobody intended: fear of the trainer. People were trained too. In the 1960s some psychiatric wards ran token economies, paying patients in tokens, exchangeable for privileges, for dressing, cleaning and work. Behaviour on the ward changed, often a great deal. It often didn't last after discharge, where nobody paid tokens, and the practice raised hard questions about consent that helped shape today's rules for patients' rights.
The plainest application of the law of effect is in treating addiction. In contingency management, a urine test free of the drug earns a reward: a voucher, or a draw from a bowl of prizes, given at once, every time. A 2006 meta-analysis of forty-seven comparisons found an average effect of about point four standard deviations, and larger for cocaine and opiates. The effects fade after the rewards stop: for prize-based programmes, about point four six at the end of treatment, a third of a standard deviation three months later, and nothing detectable at six. Extinction, again. For stimulants such as cocaine and methamphetamine, where no medicine works well, it's among the strongest treatments there are, and among the least used, because paying people not to take drugs strikes many as wrong.
And conditioning is used on all of us. In many video games you can pay for a loot box: a random prize, usually ordinary, now and then rare. That's a variable-ratio schedule, the one that in chapter three produced the highest and most persistent responding. The boxes open with sounds, lights and near-misses, conditioned reinforcers paired with winning, as in a slot machine. In 2018 David Zendle and Paul Cairns surveyed over seven thousand gamers. The more people spent on loot boxes, the more severe their problem gambling, a link much stronger than for other spending in games. A survey can't say whether the boxes cause gambling problems or attract people who already have them. Some countries now treat paid loot boxes as gambling. How products are designed around minds is Part 52.
What it does: Exposure; clickers and token economies; contingency management; loot boxes
15Frontier: links, beliefs and hidden causesResearch3 min
Here's where things stand. Solid: acquisition, extinction, spontaneous recovery and renewal; learning that follows contingency and prediction error; the signatures of schedules, the matching law and taste aversion; and extinction as new learning tied to its context. Argued: how dependable blocking is; whether animals learn links or compute rates; whether conditioning in people is really reasoning; and whether a fear memory can be rewritten. The last three are the frontier.
The first question is what conditioning is, in people. In 2009 Chris Mitchell, Jan De Houwer and Peter Lovibond argued that human associative learning isn't the stamping-in of links at all, but reasoning: people form beliefs, propositions, about what causes what. Their evidence: tell someone that a tone will be followed by a shock, and they fear the tone before a single pairing. Blocking in people depends on whether they believe that two causes add up, which you can change with instructions. And people who can't say what predicts what show little conditioning. Defenders of links reply that automatic learning plainly exists too, in animals and in fast human responses. The live question is which system does what.
The second is a new account of why extinction doesn't erase. In 2010 Sam Gershman, David Blei and Yael Niv proposed that an animal is always inferring which hidden cause is producing what it experiences, like the latent states of Part 14's perceptual inference. When shocks stop abruptly, the likeliest explanation is that the world has changed, a new cause, so a new memory is started and the old one is left intact. Bring back the old context, and the old cause becomes likely again: renewal and recovery. The theory makes an unusual prediction. Make the change gradual, thinning the shocks out slowly rather than stopping them, and the animal should conclude it's the same world, slowly changing, and revise the old memory instead of filing a new one. In rats, gradual extinction did reduce the return of fear. Whether it helps patients is being tested.
The last question is the most hopeful. When a memory is retrieved, it may become briefly changeable before it's stored again, a process called reconsolidation. In 2010 Daniela Schiller and colleagues reminded people of a conditioned fear, then ran extinction within the next few hours, and reported that the fear didn't return, even a year later. Attempts to repeat it have been mixed: some laboratories find the effect, others don't, and nobody yet knows exactly when it works. If it holds up, extinction could rewrite a fear rather than compete with it. How memories are rewritten each time they're used is Part 21.
What it does: What is solid and argued; propositions; latent causes; reconsolidation
Recap, problems, and the road aheadAll tracks3 min
Part sixteen in ten lines. A conditioned response comes, goes in extinction, and comes back. Pavlov's signals come to predict, and the response prepares the animal for what's coming. Thorndike and Skinner showed consequences shaping action, and schedules of reward leaving their signatures. Little Albert was a demonstration, retold larger than it was. Rescorla showed that learning follows contingency, not pairing, and Kamin that it is driven by surprise. The Rescorla-Wagner rule is gradient descent on a prediction error, and its asymptote is the contingency. Extinction is new learning tied to its context, which is why fears return. Attention is learned, time is measured on a scale of its own, and choices match their rewards by melioration. And biology sets limits: taste goes with sickness, animals drift back to instinct, and people learn by watching.
Kant's wager. Today the first objection, that mathematics can't apply to the mind, lost more ground than in any part so far. One line of algebra, a gradient on a squared error, predicts blocking, inhibition, overexpectation and Rescorla's ten groups. And the second objection, that the mind can't be experimented on, met Rescorla's random control: a design that separates pairing from prediction, which no amount of watching could have done.
Where this comes back. Prediction errors in the firing of dopamine neurons are next time, Part 17. Attention learned from prediction is Part 18. Memories rewritten each time they're used are Part 21. Choices over time are Part 26. Fear, exposure and relapse are Part 40, addiction is Part 41, and products designed around our habits are Part 52.
Seven problems, with full solutions in this part's README. One runs the rule by hand. One derives it as gradient descent. One proves that its asymptote is the contingency. One works out overexpectation. One derives the matching law from melioration. One uses Psyche to fix the model's mistake about renewal. And the last, with the star, asks you to design the experiment that separates the two theories of attention. Pause here if you'd like to try them.
The books and papers behind this part are listed here and in the README. Mark Bouton's Learning and Behavior is the place to start.
That opens Act Four, on learning and memory. Rescorla and Wagner wrote their rule for trials, as if nothing happened between the start of a signal and the reward. Next time we let time back in, and the same idea, learning from errors in prediction, becomes temporal-difference learning. In the 1990s it turned up in the firing of single dopamine neurons in a monkey's brain. It's Part 17: reward and prediction.
Where it goes next. Prediction errors in dopamine neurons and temporal-difference learning are Part 17, learned attention Part 18, memory rewritten in use Part 21, choices over time Part 26, fear and exposure Part 40, addiction Part 41, and products built around habits Part 52.
Key results
The part's results in one place, for revision.
Try it
Lab 16 · Conditioning: prediction errors, contingency, extinction and choice
Run the Rescorla-Wagner rule on acquisition, blocking, inhibition and overexpectation; check that it is gradient descent; solve its asymptote and see the contingency appear; reproduce the ordering of Rescorla's ten groups; extinguish in one context and test in another; let attention learn; read the signatures of the four schedules; and watch a meliorating chooser match.
python -m videos.psychology.labs 16
needs numpy, scipy, matplotlib · download lab16.py ·
source on GitHublargest gap between the rule's gradient and a numerical one 3.4e-11
blocking: V of the added cue, after pretraining and without 0.004, 0.500
conditioned inhibitor X; overexpectation, A before and after the compound -1.00; 1.00 -> 0.50
P(US|X) = 0.6, P(US|no X) = 0.2: asymptote of V_X and delta P +0.400, +0.400
P(US|X) = 0.75, P(US|no X) = 0.75: asymptote of V_X and delta P +0.000, +0.000
P(US|X) = 0.2, P(US|no X) = 0.6: asymptote of V_X and delta P -0.400, -0.400
Rescorla 1968 on Psyche, suppression ratio: 0.4/0.4, 0.4/0.2, 0.4/0.1, 0.4/0 0.44, 0.14, 0.06, 0.01
renewal: response at test in AAA, ABA, ABC, AAB 0.00, 0.85, 0.85, 0.85
spontaneous recovery: at once, and 48 hours later 0.00, 0.63
attention to A (reliable) and B (uncertain): Mackintosh; Pearce-Hall 1.00, 0.11; 0.01, 0.59
responses a minute on FR 20, VR 20, FI 60 s, VI 60 s 67, 111, 53, 46
generalized matching: sensitivity a and bias log b 0.94, -0.01
The rule is gradient descent; it blocks, makes inhibitors and overexpects; with a context cue its asymptote is exactly delta P, which orders Rescorla's groups as the paper did. Extinction stored with its context returns elsewhere and with time. Mackintosh attends to the reliable cue, Pearce and Hall to the uncertain one. Ratio schedules give the highest rates, and a meliorating chooser matches.
The code (97 lines; it asserts its own result)
"""Lab 16: the Rescorla-Wagner rule on the classic designs and as gradient descent; its asymptote, the contingency;
Rescorla's (1968) ten groups; renewal and spontaneous recovery in a two-memory model of extinction; Mackintosh's and
Pearce and Hall's attention; the four schedules; and the matching law from melioration."""
import numpy as np
from videos.coursekit import labs
from explainer.psychology.psyche import conditioning as K
TITLE = "Conditioning: prediction errors, contingency, extinction and choice"
GOAL = ("Run the Rescorla-Wagner rule on acquisition, blocking, inhibition and overexpectation; check that it is "
"gradient descent; solve its asymptote and see the contingency appear; reproduce the ordering of Rescorla's "
"ten groups; extinguish in one context and test in another; let attention learn; read the signatures of the "
"four schedules; and watch a meliorating chooser match.")
TASKS = [
"Give the outcome a larger learning rate than its absence (beta = 1 and 0.5). Where does V_X settle when "
"P(US | X) = P(US | no X) = 0.8, and when both are 0.2? Is the asymptote still the contingency?",
"Change extinction_in_context so that a share of acquisition is bound to its context (problem 6 in the README) "
"and find a share that makes ABA > ABC > AAB.",
"Run concurrent with a changeover rule: after switching keys, no reward for the next 2 seconds. What does it do to "
"the generalized matching sensitivity?",
]
def run(seed=0):
out = labs.Lab()
rng = np.random.default_rng(seed)
# 1. the rule and its gradient
v, x = rng.normal(size=3), np.array([1.0, 1.0, 0.0])
eps = 1e-6
num = np.array([((1 - x @ (v + eps * e)) ** 2 - (1 - x @ (v - eps * e)) ** 2) / (4 * eps) for e in np.eye(3)])
assert np.allclose(K.rw_gradient(v, x, 1.0), num, atol=1e-6), "the rule is gradient descent"
out.row("largest gap between the rule's gradient and a numerical one", f"{np.abs(K.rw_gradient(v, x, 1.0) - num).max():.1e}")
_, Vb = K.rescorla_wagner(K.sequence([("A+", 30), ("AX+", 20)]))
_, Vc = K.rescorla_wagner(K.sequence([("AX+", 20)]))
out.row("blocking: V of the added cue, after pretraining and without", f"{Vb[-1, 1]:.3f}, {Vc[-1, 1]:.3f}")
_, Vi = K.rescorla_wagner(K.sequence([("A+ AX-", 300)]))
_, Vo = K.rescorla_wagner(K.sequence([("A+ B+", 80), ("AB+", 60)]))
out.row("conditioned inhibitor X; overexpectation, A before and after the compound",
f"{Vi[-1, 1]:.2f}; {Vo[80, 0]:.2f} -> {Vo[-1, 0]:.2f}")
# 2. the asymptote is the contingency
for p1, p0 in ((0.6, 0.2), (0.75, 0.75), (0.2, 0.6)):
_, V = K.rw_asymptote([("CX", 0.3, p1), ("C", 0.7, p0)])
assert abs(V[1] - (p1 - p0)) < 1e-9
out.row(f"P(US|X) = {p1}, P(US|no X) = {p0}: asymptote of V_X and delta P", f"{V[1]:+.3f}, {p1 - p0:+.3f}")
med = {g: np.median([K.rescorla_1968(*g, rng=np.random.default_rng(s)) for s in range(8)])
for g in K.RESCORLA_1968_GROUPS}
out.row("Rescorla 1968 on Psyche, suppression ratio: 0.4/0.4, 0.4/0.2, 0.4/0.1, 0.4/0",
", ".join(f"{float(K.suppression_ratio(med[g])):.2f}" for g in ((0.4, 0.4), (0.4, 0.2), (0.4, 0.1), (0.4, 0.0))))
# 3. extinction bound to context
ren = {d: K.renewal(d) for d in ("AAA", "ABA", "ABC", "AAB")}
out.row("renewal: response at test in AAA, ABA, ABC, AAB", ", ".join(f"{v:.2f}" for v in ren.values()))
probes, _ = K.extinction_in_context([("A", 1.0, 20), ("A", 0.0, 40), ("test", "A", 0.0), ("test", "A", 48.0)],
tau=48.0)
out.row("spontaneous recovery: at once, and 48 hours later", f"{probes[0]:.2f}, {probes[1]:.2f}")
# 4. attention
seq = K.sequence([("A+ B+ A+ B-", 160)])
_, _, Am = K.mackintosh(seq)
_, _, Ap = K.pearce_hall(seq)
out.row("attention to A (reliable) and B (uncertain): Mackintosh; Pearce-Hall",
f"{Am[-1, 0]:.2f}, {Am[-1, 1]:.2f}; {Ap[-1, 0]:.2f}, {Ap[-1, 1]:.2f}")
# 5. schedules and choice
rates = {}
for kind, val in (("FR", 20), ("VR", 20), ("FI", 60), ("VI", 60)):
r, _ = K.schedule(kind, val, duration=900.0, rng=np.random.default_rng(7))
rates[kind] = len(r) / 15.0
out.row("responses a minute on FR 20, VR 20, FI 60 s, VI 60 s", ", ".join(f"{v:.0f}" for v in rates.values()))
Bs, Rs = [], []
for k, (a, b) in enumerate(((15, 135), (30, 90), (45, 45), (90, 30), (135, 15))):
B, R = K.concurrent(means=(float(a), float(b)), minutes=300, rng=np.random.default_rng(100 + k))
Bs.append(B)
Rs.append(R)
sens, bias = K.generalized_matching(np.array(Bs), np.array(Rs))
out.row("generalized matching: sensitivity a and bias log b", f"{sens:.2f}, {bias:+.2f}")
out.note = ("The rule is gradient descent; it blocks, makes inhibitors and overexpects; with a context cue its "
"asymptote is exactly delta P, which orders Rescorla's groups as the paper did. Extinction stored with "
"its context returns elsewhere and with time. Mackintosh attends to the reliable cue, Pearce and Hall "
"to the uncertain one. Ratio schedules give the highest rates, and a meliorating chooser matches.")
fig, ax = labs.figure(2, size=(11, 4.2))
x = np.arange(Vb.shape[0])
ax[0].plot(x, Vb[:, 0], color=labs.PINK, lw=1.6, label="A (pretrained)")
ax[0].plot(x, Vb[:, 1], color=labs.BLUE, lw=1.6, label="X, blocked")
ax[0].plot(np.arange(30, 30 + Vc.shape[0]), Vc[:, 1], color=labs.GREEN, lw=1.6, label="X, control")
ax[0].set(title="Blocking under Rescorla-Wagner", xlabel="trial", ylabel="V")
ax[0].legend(fontsize=8)
Bs, Rs = np.array(Bs), np.array(Rs)
ax[1].scatter(Rs[:, 0] / Rs.sum(1), Bs[:, 0] / Bs.sum(1), color=labs.GREEN)
ax[1].plot([0, 1], [0, 1], color=labs.GREY, lw=0.8)
ax[1].set(title="Matching by melioration", xlabel="share of rewards on the left", ylabel="share of responses")
out.fig = fig
return out
Now change it
- Give the outcome a larger learning rate than its absence (beta = 1 and 0.5). Where does V_X settle when P(US | X) = P(US | no X) = 0.8, and when both are 0.2? Is the asymptote still the contingency?
- Change extinction_in_context so that a share of acquisition is bound to its context (problem 6 in the README) and find a share that makes ABA > ABC > AAB.
- Run concurrent with a changeover rule: after switching keys, no reward for the next 2 seconds. What does it do to the generalized matching sensitivity?
Problems, with solutions
Try each problem before opening its solution.
1. The rule by hand. Under Rescorla-Wagner with \(\alpha\beta = 0.2\) and \(\lambda = 1\), find \(V\) after \(n\) reinforced trials from \(V = 0\), and the number of trials to reach 0.9.
Solution
With one cue and λ = 1, V_{n+1} = V_n + 0.2(1 − V_n), so 1 − V_{n+1} = 0.8(1 − V_n) and V_n = 1 − 0.8ⁿ. V reaches 0.9 when 0.8ⁿ ≤ 0.1, n ≥ ln 0.1 / ln 0.8 = 10.3: on the eleventh trial.
2. Gradient descent. Show that the rule is gradient descent on \(\tfrac12(\lambda - \sum_i x_i V_i)^2\), and say what step size \(\alpha\beta\) plays.
Solution
E = ½(λ − Σᵢ xᵢVᵢ)², so ∂E/∂V_X = −(λ − Σᵢ xᵢVᵢ)x_X. A step of size η against the gradient is ΔV_X = η(λ − ΣV)x_X, the Rescorla–Wagner rule for every cue present (x_X = 1) and no change for absent ones, with η = α_Xβ. A larger αβ is a longer step: faster learning, and, above 1/(number of cues present), overshoot.
3. The asymptote is ΔP. Solve for the asymptotes of \(V_C\) and \(V_X\) when trials with the cue occur with probability \(q\), and show that \(V_X = \Delta P\) for every \(q\).
Solution
Trials with the cue (probability q) carry C and X, with the outcome at p₁; trials without it (1 − q) carry C alone, with the outcome at p₀. With equal β the expected changes are E[ΔV_X] ∝ q(p₁ − V_C − V_X) and E[ΔV_C] ∝ q(p₁ − V_C − V_X) + (1 − q)(p₀ − V_C). Setting both to zero gives V_C + V_X = p₁ and then V_C = p₀, so V_X = p₁ − p₀ = ΔP for every q in (0, 1). With β for outcomes larger than for their absence the asymptote is no longer ΔP, and before the asymptote a frequent outcome inflates V_X (the outcome-density effect).
4. Overexpectation. In an overexpectation design, A and B each reach \(V = 1\) alone. Find where they end after many AB\(+\) trials, and why.
Solution
On an AB trial the error is 1 − (V_A + V_B) = 1 − 2 = −1, so both lose strength although the food arrives. With equal α both fall by the same amount each trial (their difference never changes) until V_A + V_B = 1: each ends at 0.5. With unequal α the more salient cue loses more, and the difference between them is kept.
5. Matching from melioration. Show that melioration on two variable-interval keys stops where \(R_L/B_L = R_R/B_R\), and that this is the matching law.
Solution
The chooser shifts toward the key with the higher local rate, R/B, and stops only when R_L/B_L = R_R/B_R. Then B_L/B_R = R_L/R_R, and adding 1 to each side, B_L/(B_L + B_R) = R_L/(R_L + R_R). On variable-interval keys this equality is reachable, because spending less time on a key raises its local rate (its rewards wait to be collected); on ratio keys the local rates are fixed, so the chooser cannot equalize them and goes to the richer key.
6. Fixing renewal. With explainer.psychology.psyche.conditioning: run renewal in the AAA, ABA, ABC and AAB designs, and change the model so that AAB is weaker than ABC.
Solution
In extinction_in_context all excitation is context-free, so AAB = ABC. Split it: a share ω of
what acquisition writes is stored with the context of acquisition, expressed elsewhere with similarity s. With ω = 0.4,
s = 0.15 and acquisition complete, extinction in A must cancel 0.6 + 0.4 = 1, so I_A = 1, and a test in B gives
0.6 + 0.15 × 0.4 − 0.15 × 1 = 0.51. In ABC, extinction in B cancels 0.6 + 0.06 = 0.66, and a test in C gives
0.6 + 0.06 − 0.15 × 0.66 = 0.56; in ABA, 0.6 + 0.4 − 0.15 × 0.66 = 0.90. The order ABA > ABC > AAB is the one in the
data.
7. ★ Two theories of attention. Design an experiment that tells Mackintosh's attention from Pearce and Hall's, and say what each predicts.
Solution
Learned predictiveness (after Le Pelley and McLaren): in phase 1, cue A is always followed by outcome 1 and cue B is followed by it on a random half of trials; in phase 2, A and B are both paired with a new outcome, each in compound with a novel cue, and learning about each is measured at test (and attention by eye tracking). Mackintosh predicts faster new learning about A, the cue that predicted well; Pearce and Hall predict faster learning about B, the cue whose consequences were uncertain. Counterbalance which physical stimuli play A and B, and include a phase-2 condition where all cues are new, to measure learning with no history.
Notes and sources
Where it comes back
Prediction errors in dopamine neurons: Part 17. Attention: Part 18. Memory rewritten when it is used: Part 21. Choices
over time: Part 26. Fear, exposure and relapse: Part 40. Addiction: Part 41. Does therapy work?: Part 42. Products
designed around habits: Part 52. Psyche's conditioning module supplies the learning rules those parts extend.
Sources
Books. I. P. Pavlov, Conditioned Reflexes, trans. G. V. Anrep (Oxford University Press, 1927). D. P. Todes, Ivan Pavlov: A Russian Life in Science (Oxford University Press, 2014). B. F. Skinner, The Behavior of Organisms (Appleton-Century, 1938). C. B. Ferster and B. F. Skinner, Schedules of Reinforcement (Appleton-Century-Crofts, 1957). M. E. Bouton, Learning and Behavior: A Contemporary Synthesis, 2nd ed. (Sinauer, 2016).
Papers. E. L. Thorndike, Animal intelligence, Psychol. Rev. Monogr. Suppl. 2(4) (1898). J. B. Watson and R. Rayner, Conditioned emotional reactions, J. Exp. Psychol. 3 (1920) 1–14. B. Harris, Whatever happened to Little Albert?, Am. Psychol. 34 (1979) 151–160. R. A. Powell, N. Digdon, B. Harris and C. Smithson, Correcting the record on Watson, Rayner, and Little Albert, Am. Psychol. 69 (2014) 600–611. R. A. Rescorla, Probability of shock in the presence and absence of CS in fear conditioning, J. Comp. Physiol. Psychol. 66 (1968) 1–5. L. J. Kamin, Predictability, surprise, attention, and conditioning, in B. A. Campbell and R. M. Church (eds), Punishment and Aversive Behavior (1969) 279–296. R. A. Rescorla and A. R. Wagner, A theory of Pavlovian conditioning, in A. H. Black and W. F. Prokasy (eds), Classical Conditioning II (1972) 64–99. B. Widrow and M. E. Hoff, Adaptive switching circuits, IRE WESCON Convention Record (1960) 96–104. E. F. Kremer, The Rescorla–Wagner model: losses in associative strength in compound conditioned stimuli, J. Exp. Psychol. Anim. Behav. Process. 4 (1978) 22–36. G. B. Chapman and S. J. Robbins, Cue interaction in human contingency judgment, Mem. Cognit. 18 (1990) 537–545. E. A. Wasserman, S. M. Elek, D. L. Chatlosh and A. G. Baker, Rating causal relations, J. Exp. Psychol. Learn. Mem. Cogn. 19 (1993) 174–188. R. E. Lubow and A. U. Moore, Latent inhibition, J. Comp. Physiol. Psychol. 52 (1959) 415–419. M. E. Bouton and R. C. Bolles, Contextual control of the extinction of conditioned fear, Learn. Motiv. 10 (1979) 445–466. B. Vervliet, M. G. Craske and D. Hermans, Fear extinction and relapse, Annu. Rev. Clin. Psychol. 9 (2013) 215–248. N. J. Mackintosh, A theory of attention, Psychol. Rev. 82 (1975) 276–298. J. M. Pearce and G. Hall, A model for Pavlovian learning, Psychol. Rev. 87 (1980) 532–552. M. E. Le Pelley, The role of associative history in models of associative learning, Q. J. Exp. Psychol. 57B (2004) 193–243. C. R. Gallistel and J. Gibbon, Time, rate, and conditioning, Psychol. Rev. 107 (2000) 289–344. R. J. Herrnstein, Relative and absolute strength of response as a function of frequency of reinforcement, J. Exp. Anal. Behav. 4 (1961) 267–272. W. M. Baum, Matching, undermatching, and overmatching in studies of choice, J. Exp. Anal. Behav. 32 (1979) 269–281. R. J. Herrnstein and D. Prelec, Melioration: a theory of distributed choice, J. Econ. Perspect. 5 (1991) 137–156. J. Garcia and R. A. Koelling, Relation of cue to consequence in avoidance learning, Psychon. Sci. 4 (1966) 123–124. J. Garcia, F. R. Ervin and R. A. Koelling, Learning with prolonged delay of reinforcement, Psychon. Sci. 5 (1966) 121–122. M. Domjan and N. E. Wilson, Specificity of cue to consequence in aversion learning in the rat, Psychon. Sci. 26 (1972) 143–145. S. Siegel, R. E. Hinson, M. D. Krank and J. McCully, Heroin "overdose" death, Science 216 (1982) 436–437. S. Siegel and B. M. C. Ramos, Applying laboratory research: drug anticipation and the treatment of drug addiction, Exp. Clin. Psychopharmacol. 10 (2002) 162–183. K. Breland and M. Breland, The misbehavior of organisms, Am. Psychol. 16 (1961) 681–684. A. Bandura, Influence of models' reinforcement contingencies on the acquisition of imitative responses, J. Pers. Soc. Psychol. 1 (1965) 589–595; A. Bandura, Social Learning Theory (1977); C. A. Anderson et al., Violent video game effects on aggression, empathy, and prosocial behavior in Eastern and Western countries: a meta-analytic review, Psychol. Bull. 136 (2010) 151–173; C. J. Ferguson and J. Kilburn, Psychol. Bull. 136 (2010) 174–178; J. Hilgard, C. R. Engelhardt and J. N. Rouder, Overstated evidence for short-term effects of violent games on affect and behavior: a reanalysis of Anderson et al. (2010), Psychol. Bull. 143 (2017) 757–774. A. Bandura, D. Ross and S. A. Ross, Transmission of aggression through imitation of aggressive models, J. Abnorm. Soc. Psychol. 63 (1961) 575–582. M. Cook and S. Mineka, Observational conditioning of fear to fear-relevant versus fear-irrelevant stimuli in rhesus monkeys, J. Abnorm. Psychol. 98 (1989) 448–459. T. Maes et al., The elusive nature of the blocking effect: 15 failures to replicate, J. Exp. Psychol. Gen. 145 (2016) e49–e71. M. Prendergast et al., Contingency management for treatment of substance use disorders: a meta-analysis, Addiction 101 (2006) 1546–1560. L. A. Benishek et al., Prize-based contingency management for the treatment of substance abusers: a meta-analysis, Addiction 109 (2014) 1426–1436. D. Zendle and P. Cairns, Video game loot boxes are linked to problem gambling, PLoS ONE 13 (2018) e0206767. C. J. Mitchell, J. De Houwer and P. F. Lovibond, The propositional nature of human associative learning, Behav. Brain Sci. 32 (2009) 183–198. S. J. Gershman, D. M. Blei and Y. Niv, Context, learning, and extinction, Psychol. Rev. 117 (2010) 197–209. D. Schiller et al., Preventing the return of fear in humans using reconsolidation update mechanisms, Nature 463 (2010) 49–53.
About this partfrom its README
Pair a signal with food and a dog comes to salivate at the signal; present the signal alone and the response fades; wait a day and part of it is back. Something was learned in extinction, but it was not the erasure of the first lesson. And two dogs with the same forty pairings can learn entirely different things, if food also comes, for one of them, when there is no signal. This part follows those two puzzles to their answers: learning tracks contingency, it is driven by surprise, and extinction is new learning bound to its context.
It opens Act IV. Pavlov's method and vocabulary, generalization and discrimination, and why the conditioned response prepares rather than substitutes. Thorndike's cats and the law of effect; Watson's behaviourism and Little Albert, from the paper's own notes and as retold. Skinner's chamber, shaping, and the four schedules of reinforcement with their cumulative records. A contingency game for the viewer, ΔP, and Rescorla's 1968 random control. Kamin's blocking. The Rescorla–Wagner rule, derived as gradient descent on a squared prediction error (Widrow and Hoff's delta rule), drawn on its error surface, and run on overshadowing, conditioned inhibition and overexpectation; its asymptote proved to be ΔP, and Rescorla's ten groups reproduced. What it gets wrong: latent inhibition, spontaneous recovery and renewal, with a two-memory model of extinction; Mackintosh's and Pearce and Hall's learned attention; scalar timing and the I/T law of rate-estimation theory; Herrnstein's matching law derived from melioration, and melioration as a trap. Biology's limits: Garcia's taste aversions, the Brelands' misbehaving animals, preparedness, and Bandura's Bobo doll drawn as its design, then his 1965 experiment separating learning from performance, and social learning theory and self-efficacy with the contested step from imitation to media violence. The practice chapter is exposure therapy, animal training and token economies, contingency management for addiction, and loot boxes; the frontier is propositional learning, latent causes, and reconsolidation.
What is computed and built
explainer/psychology/psyche/conditioning.py: Rescorla–Wagner for any design written as phases of trial types, its gradient, and its exact asymptote (so ΔP falls out); a contingency learner with a context cue; Rescorla's 1968 schedule; a suppression read-out; Mackintosh's and Pearce and Hall's attention rules; a two-memory model of extinction bound to context, with renewal and spontaneous recovery; a generalization gradient; a law-of-effect learner in Thorndike's box; shaping by successive approximation; an operant chamber with the four schedules and cumulative records; concurrent schedules chosen by melioration, the generalized matching fit and a melioration trap; scalar timing, the I/T law, and Rescorla–Wagner's trials to criterion. Tested intests/psychology/test_conditioning.py.- The Ledger gains six rows, one of them (conditioned tolerance) deferred from Part 10; the Archive twenty-three datasets.
- The course's interactive is the contingency game: four blocks of plants, a rating after each, and the reader's ratings against ΔP and against the outcome's density.
Chapter notes
| # | Chapter | What it does |
|---|---|---|
| 0 | A response that comes back | Pavlov's laboratory; acquisition, extinction and recovery on Psyche; two dogs with the same pairings; objectives |
| 1 | Pavlov's method | US, UR, CS, CR; generalization and discrimination; substitution against preparation |
| 2 | The law of effect | Thorndike's cats; behaviourism; Little Albert as recorded, and as retold |
| 3 | Skinner's box | The chamber and the recorder; shaping; four schedules; partial reinforcement, drawn as two press records |
| 4 | Contingency, not pairing | The fertilizer game; ΔP and the outcome-density effect; Rescorla's ten groups |
| 5 | Blocking | Kamin's design; surprise and unblocking |
| 6 | The Rescorla-Wagner rule | The rule; its derivation as gradient descent; acquisition and extinction; blocking on the error surface |
| 7 | What the rule predicts | Overshadowing, inhibition, overexpectation; why the asymptote is ΔP; Rescorla's groups on Psyche |
| 8 | What the rule gets wrong | Latent inhibition; renewal and a two-memory model; spontaneous recovery |
| 9 | Attention to cues | Mackintosh against Pearce and Hall; one history, opposite attention; both, it seems |
| 10 | Time | Scalar timing; the I/T law and rate estimation |
| 11 | Choice | The matching law; melioration derives it; when melioration is a trap |
| 12 | Biology's limits | Garcia and Koelling; instinctive drift and preparedness; learning by watching; learning against performance; social learning theory |
| 13 | The Ledger | Blocking; taste aversion; conditioned tolerance; Little Albert; matching; renewal |
| 14 | In practice: therapy, training and games | Exposure; clickers and token economies; contingency management; loot boxes |
| 15 | Frontier: links, beliefs and hidden causes | What is solid and argued; propositions; latent causes; reconsolidation |
| Recap, problems, and the road ahead | Ten lines; the first and second objections; payoffs; problems; references; Part 17 |
NotesWhere the numbers come from
| What | Source |
|---|---|
| Pavlov's Nobel Prize (1904, digestion); signals were metronomes, buzzers, harmoniums, lights and touches, a bell only rarely | the Nobel record; Todes's biography (2014), as summarized by its publisher and reviewers |
| Acquisition, extinction and next-day recovery of a salivary response (drops) | Psyche (conditioning.extinction_in_context, α = 0.18, a 48-hour context drift; 12 drops at full strength), item pavlov |
| A generalization gradient over tone frequency | Psyche: a Gaussian in octaves, width 0.35; the shape, not a fit |
| Experimental neurosis (a circle and an ellipse made rounder) | Pavlov (1927), described without figures |
| Escape times in the puzzle box | Psyche (puzzle_box, 12 acts, Δw = 0.1): one cat (seed 12) and the median and quartiles of 200 |
| Watson and Rayner: no fear at about nine months; the bar at 8 months 26 days; two pairings at 11 months 3 days, five more at 11 months 10 days (seven in all); transfer at 11 months 15 days; last tests at 1 year 21 days; Albert taken from the hospital that day | the paper (Classics in the History of Psychology), read 2026-11-14 |
| Albert's identity disputed (Merritte, who died at six; Barger, who lived to 87) | Beck et al. (2009); Powell et al. (2014), from abstracts and summaries |
| Shaping: the criterion is the 60th percentile of the last 20 responses; 79% rewarded against 0.3% when waiting for the target | Psyche (shaping), item shaping |
| Cumulative records under FR 20, VR 20, FI 60 s and VI 60 s, with their rates | Psyche (schedule): the signatures as Ferster and Skinner (1957) describe them; the numbers are the model's |
| The fertilizer game: 24 plants, 12 fertilized, nine of each twelve bloom (ΔP = 0) | constructed (item contingency, a fixed seed for the order) |
| People's ratings follow ΔP; 150 people in three experiments | Wasserman, Elek, Chatlosh and Baker (1993), from the abstract |
| Rescorla (1968): 24 rats in Experiment 1; 80 rats in ten groups in Experiment 2; twelve 2-min tones a session for five sessions, an 8-min mean gap; 0.5 s, 0.9 mA shocks; the ten pairs of probabilities; the three statements of the discussion | the paper, read 2026-11-14 |
| Kamin's design and result (little fear of the light after noise training); unblocking with a stronger shock | Kamin (1969), from later accounts |
| The rule's curves, the error surface and the blocking path | Psyche (rescorla_wagner, αβ = 0.15), item rw |
| Overshadowing (α = 0.45 and 0.1), conditioned inhibition, overexpectation | Psyche, item rw; Kremer (1978) for overexpectation in rats |
| The asymptote V_X = ΔP with a context cue | derived here and in rw_asymptote; Chapman and Robbins (1990) |
| Rescorla's ten groups on Psyche: eight simulated rats a group, α = 0.12, β = 1 and 0.4, the median; suppression ratio e^(−8V)/(1 + e^(−8V)) | Psyche (rescorla_1968, suppression_ratio), item rescorla68 |
| Latent inhibition in sheep and goats | Lubow and Moore (1959), from a review's account |
| Renewal after extinction in another context | Bouton and Bolles (1979); Psyche's two-memory model (similarity 0.15), item extinction |
| Mackintosh's and Pearce and Hall's attention on one history (A always rewarded, B half the time) | Psyche (mackintosh, pearce_hall), item attention |
| Scalar timing: a peak at the trained interval with a coefficient of variation of 0.2 | Psyche (peak_curve); the property as reviewed by Gallistel and Gibbon (2000) |
| Reinforcements to acquisition ≈ 300 (I/T)⁻¹ | Gallistel and Gibbon (2000), as summarized by Kakade and Dayan and later papers |
| Rescorla–Wagner's trials to V = 0.5 against I/T | Psyche (rw_trials_to_criterion), item timing |
| The matching law on seven pairs of variable-interval schedules; the generalized fit | Psyche (concurrent, melioration), item choice |
| Baum (1979): 103 data sets from 23 studies; undermatching common | the abstract and later reanalyses |
| The melioration trap (A pays 1 + 3f, B pays 3f) | constructed after Herrnstein and Prelec (1991); Psyche, 50 runs |
| Bright-noisy-tasty water; illness by X-rays or lithium chloride; long delays | Garcia and Koelling (1966); Garcia, Ervin and Koelling (1966), from records and later accounts |
| The raccoon and the pigs | Breland and Breland (1961), from excerpts and later accounts |
| 72 children (36 boys, 36 girls), Stanford nursery school | Bandura, Ross and Ross (1961) |
| Monkeys learn fear of snakes, not flowers, by watching | Cook and Mineka (1989), from memory |
| Contingency management: 47 comparisons, d = 0.42, 0.66 for cocaine, 0.65 for opiates; prize-based 0.46 at the end of treatment, 0.33 at three months, none at six | Prendergast et al. (2006); Benishek et al. (2014), from the abstracts |
| 7,422 gamers; η² = 0.054 for loot-box spending and problem gambling, 0.004 for other spending | Zendle and Cairns (2018) |
| Instructed fear; blocking that depends on beliefs about additivity | as reviewed by Mitchell, De Houwer and Lovibond (2009) |
| Gradual extinction in rats | Gershman, Jones, Norman, Monfils and Niv (2013), from memory |
| Reconsolidation update, and a year's follow-up | Schiller et al. (2010); replications mixed |
Notes
| Finding | Original | Status |
|---|---|---|
| A cue paired with an already-predicted outcome acquires little association | Kamin 1969 | replicated, smaller |
| Rats avoid a taste after illness and a light or sound after shock, not the reverse | Garcia and Koelling 1966 | replicated |
| Tolerance is partly conditioned to drug cues; a dose kills more often in a new place | Siegel, Hinson, Krank and McCully 1982 | replicated |
| An infant conditioned to fear a white rat shows how phobias are learned | Watson and Rayner 1920 | story and record |
| Animals divide responses between two sources in proportion to their rewards | Herrnstein 1961 | replicated |
| An extinguished fear returns in the context where it was learned | Bouton and Bolles 1979 | replicated |
Shown without a row, with the reason recorded in explainer/psychology/ledger.py: Pavlov (the method, told as
history), Ferster and Skinner (schedules whose signatures are drawn on Psyche), Wasserman et al. (human contingency
judgment, entered with judgment in Part 26), Rescorla (1968; a design reproduced on Psyche, the paper's figures not
drawn), Rescorla and Wagner (a model), Lubow and Moore (latent inhibition, described and modelled; its row is in Part 18), Mackintosh and
Pearce and Hall (models), Gallistel and Gibbon (a theory and a summary of data, with its exceptions), the Brelands
(trainers' observations), Bandura, Ross and Ross (drawn as the design, with schematic bars), Bandura 1965 (the
pattern of its result, not its means), Bandura et al. 1963, Bandura 1977, Anderson et al. 2010, Ferguson and Kilburn
2010 and Hilgard et al. 2017 (a theory and its record), Prendergast et al. (treatment
evidence, entered in Part 42), Zendle and Cairns (a survey, with its limits), Mitchell et al. and Gershman et al.
(theory at the frontier), and Schiller et al. (reconsolidation, whose row is due in Part 21).
Notes
Before the narrated master:
- The rarity of the bell in Pavlov's laboratory is Todes's finding as summarized by others; his book was not read.
- Pavlov's experimental neurosis and the mistranslation of "conditional" are the usual history.
- Thorndike's puzzle-box details (the loop, the timing) are from historical accounts; his own curves are not drawn.
- Watson's 1913 manifesto and the forty years of influence are the usual history.
- Barger's age at death (87) and that he never knew are from accounts of Powell et al. (2014).
- Kamin's unblocking with a stronger shock is from later accounts.
- Chapman and Robbins (1990) are credited for the ΔP asymptote from later citations; the derivation here stands on its own.
- The 300 (I/T)⁻¹ summary is quoted from accounts of Gallistel and Gibbon (2000), not from the paper.
- The Brelands' raccoon and pigs are from excerpts; Cook and Mineka (1989) and the gradual-extinction study (Gershman et al. 2013) are from memory.
- Schiller et al.'s one-year follow-up is from memory; "replications mixed" summarizes later reviews.
- The token-economy history (wards in the 1960s; consent) is described without figures.
Companion material in this repository
The syllabus's plan for this partfrom SYLLABUS.md, the plan of record
- Hook: Pavlov's laboratory (Nobel 1904; metronomes and buzzers, the bell mostly legend, after Todes); acquisition, extinction and next-day recovery on Psyche; the two dogs; objectives.
- Pavlov's method: US, UR, CS, CR and "conditional"; a generalization gradient and discrimination; experimental neurosis; substitution against preparation (freezing, conditioned tolerance from Part 10; Rescorla 1988).
- The law of effect: Thorndike's puzzle box with Psyche's law-of-effect cat (one cat and the median of 200); Watson's behaviourism; Little Albert from the paper's own notes (seven pairings; Albert taken from the hospital with the fear in place), and as retold (Harris 1979; the disputed identity).
- Skinner's box: the chamber and the cumulative recorder; shaping (79% rewarded against 0.3% when waiting for the target); FR, VR, FI and VI records with their signatures; the partial reinforcement extinction effect.
- Contingency, not pairing: On you, the fertilizer game (24 plants, ΔP = 0 with blooms common); ΔP and the outcome-density effect; Wasserman et al. (1993); Rescorla (1968) Experiment 2, its ten groups and three statements.
- Blocking: Kamin's design (1969); surprise; unblocking.
- The Rescorla–Wagner rule: the terms; the derivation as gradient descent (Widrow and Hoff's delta rule; AI, Built Part 9); acquisition and extinction; blocking on the error surface over (V_noise, V_light).
- What the rule predicts: overshadowing, conditioned inhibition and overexpectation (Kremer 1978); with the context as a cue the asymptote is ΔP (Chapman and Robbins 1990); Rescorla's ten groups on Psyche.
- What the rule gets wrong: latent inhibition (Lubow and Moore 1959); renewal (Bouton and Bolles 1979) with a two-memory model, which wrongly makes AAB as strong as ABC; spontaneous recovery as a drifting context.
- Attention to cues: Mackintosh (1975) against Pearce and Hall (1980), run on one history with opposite results; evidence for both in people.
- Time: the peak procedure and the scalar property; the I/T law (Gallistel and Gibbon 2000) against Rescorla–Wagner.
- Choice: the matching law (Herrnstein 1961; Baum 1979) from melioration on Psyche; exclusive choice on two ratio keys; the melioration trap (Herrnstein and Prelec 1991).
- Biology's limits: Garcia and Koelling (1966); the Brelands' raccoon and pigs; preparedness; the Bobo doll (Bandura, Ross and Ross 1961) and monkeys' observational fear of snakes.
- The Ledger. 14. In practice: exposure therapy designed around renewal; clickers, shaping and token economies; contingency management (d = 0.42 over 47 comparisons; fading after the rewards stop); loot boxes as variable-ratio schedules (Zendle and Cairns 2018). 15. Frontier: what is solid and argued; propositional learning (Mitchell, De Houwer and Lovibond 2009); latent causes and gradual extinction (Gershman, Blei and Niv 2010); reconsolidation (Schiller et al. 2010).
Psyche: conditioning: Rescorla–Wagner for any design and its exact asymptote, Mackintosh, Pearce–Hall, a
two-memory model of extinction, Thorndike's box, shaping, the four schedules, concurrent schedules chosen by
melioration, a melioration trap, scalar timing and the I/T law; each run on the classic designs.
On you: the gardener's game: four batches of plants, predictions that reveal the contingency learned.
Ledger: blocking (replicated, smaller: Maes et al. 2016); taste aversion (replicated); conditioned tolerance
(replicated, deferred from Part 10); Little Albert (story and record); the matching law (replicated); renewal
(replicated). Shown without rows, with reasons: Pavlov, Ferster and Skinner, Wasserman et al., Rescorla (1968),
Rescorla and Wagner, Lubow and Moore (Part 18), Mackintosh and Pearce–Hall, Gallistel and Gibbon, the Brelands,
Bandura et al., Prendergast et al. (Part 42), Zendle and Cairns, Mitchell et al., Gershman et al., Schiller et al.
(Part 21).
In practice: exposure therapy, animal training, token economies, contingency management for addiction; loot boxes
and variable rewards (Part 52).
Frontier: is learning associative or propositional in humans? Latent-cause models of extinction; reconsolidation.
Reading: Pavlov 1927; Rescorla 1968, 1988 ("It's not what you think it is"); Kamin 1969; Rescorla & Wagner
1972; Bouton, Learning and Behavior; Herrnstein 1961; Garcia & Koelling 1966; Gallistel & Gibbon 2000.
Build the film
python -m videos.psychology.psych16.compute # the part's numbers, into .cache/psych16
python tools/build.py psych16 # render and assemble the film
EXPLAINER_TTS=silent python tools/qa_scene.py psych16 Hook # one chapter, silent, with a contact sheet
Scenes: videos/psychology/psych16. Setup: see the course page. Source of these notes: the README and the scenes' narration.
Build it
python -m videos.psychology.psych16.compute # every number (seconds), into .cache/psych16/
python tools/qa_scene.py psych16 RescorlaWagner # one chapter, silent, at 480p, with a contact sheet
EXPLAINER_TTS=silent python tools/build.py psych16 -q l # the whole part, silent preview
python tools/build.py psych16 # 1080p30 with narration
python tools/qa_scene.py psych16 Choice --lang zh # the Chinese edition of one chapter
python tools/make.py psych16 # both editions, with the checks a long build needs
python -m videos.psychology.labs 16 # the lab: the rule, its asymptote, renewal, matching
python tools/check_ledger.py psych16 # every study shown has its Ledger row, or a reason
python -m pytest tests/psychology # Psyche's conditioning module, the Ledger, the Archive
The Chinese edition is zh_lines.py (the narration, line by line) and the series table
videos/psychology/psychology_text_zh.json (the text on screen); the terms are in
PSYCHOLOGY_ZH_GUIDE.md.