Sub topic 13
Operant Conditioning
This chapter assumes you know what classical conditioning is (a neutral stimulus acquires the power to trigger a reflex through pairing) and what independent and dependent variables are. It covers how consequences shape voluntary behaviour, which is the second major mechanism in the behavioural perspective.
From associations to consequences
Classical conditioning explains how stimuli come to trigger involuntary responses such as salivation or fear. It does not explain why a rat presses a lever, why a child tidies a room, or why someone keeps checking a phone. These are voluntary behaviours, which the organism emits and which operate on the environment. Operant conditioning is learning in which the probability of a behaviour changes because of the consequences that follow it.
The idea has two historical roots. Edward Thorndike studied cats escaping puzzle boxes in the 1890s and proposed the law of effect: responses followed by satisfying outcomes become more likely, and responses followed by unpleasant outcomes become less likely. B. F. Skinner formalised this in the 1930s. He built the operant chamber (often called a Skinner box), in which an animal presses a lever or pecks a key and the apparatus records each response automatically. Skinner's method was strictly behavioural. He avoided appealing to inner states and explained behaviour through the environment's reinforcement history.
The standard unit of analysis is the three-term contingency: an antecedent (the setting or cue), a behaviour, and a consequence.
The antecedent matters because behaviour is controlled by context. A pigeon taught to peck only when a green light is on shows stimulus discrimination: it responds to the signal that predicts reinforcement. Responding in similar settings is generalisation.
The four consequences
Two questions classify every consequence. Is a stimulus added or removed? Does the behaviour become more or less likely? The word reinforcement always means the behaviour increases. Punishment always means it decreases. Positive means a stimulus is added, and negative means one is removed. Here "positive" and "negative" carry no judgement of good or bad.
| Consequence | Stimulus | Effect on behaviour | Example |
|---|---|---|---|
| Positive reinforcement | Added | Increases | A student gets praise after asking a question and asks more often |
| Negative reinforcement | Removed | Increases | Taking a painkiller removes a headache, so taking it becomes more likely |
| Positive punishment | Added | Decreases | A driver receives a fine and speeds less |
| Negative punishment | Removed | Decreases | A teenager loses phone access after breaking curfew |
Common errors
Several mistakes recur in student work and in everyday talk.
- Treating negative reinforcement as punishment. Negative reinforcement strengthens behaviour by ending something aversive. A seat belt alarm that stops when you buckle up reinforces buckling.
- Defining reinforcers by what they seem like. A reinforcer is defined only by its effect. If attention from a teacher increases a pupil's disruption, the attention is functioning as a reinforcer, even though the teacher intended a reprimand.
- Assuming punishment teaches the right behaviour. Punishment signals what to stop, not what to do instead. It can also produce fear of the punisher, avoidance, and aggression. It works best when it is immediate, consistent, and paired with reinforcement of an alternative behaviour.
Shaping and schedules
Complex behaviours rarely occur spontaneously, so a trainer cannot wait to reinforce them. Shaping solves this by reinforcing successive approximations: first any movement toward the target, then only closer movements, until the full behaviour appears. Chaining extends this to sequences of behaviours.
Once a behaviour exists, the schedule of reinforcement determines its pattern. Schedules differ on two dimensions: whether reinforcement depends on the number of responses (ratio) or elapsed time (interval), and whether that requirement is constant (fixed) or varies (variable).
| Schedule | Rule | Typical response pattern |
|---|---|---|
| Fixed ratio | Reward every n-th response | High rate, brief pause after each reward |
| Variable ratio | Reward after an unpredictable number of responses | High, steady rate; most resistant to extinction |
| Fixed interval | Reward the first response after a set time | Rate rises as the time approaches (a scalloped curve) |
| Variable interval | Reward the first response after an unpredictable time | Slow, steady rate |
Variable ratio schedules explain why slot machines and some app notifications hold attention so persistently. Because rewards are unpredictable, a long run of non-reward gives no clear sign that reinforcement has ended.
This links to extinction. When reinforcement stops entirely, the behaviour declines, often after a temporary burst of increased responding (an extinction burst). Behaviour learned on a partial schedule extinguishes more slowly than behaviour learned with continuous reinforcement. This is the partial reinforcement extinction effect. Extinguished behaviour can also return after a rest period, called spontaneous recovery.
A simulation of reinforcement
The model below makes the law of effect concrete. An agent chooses between two actions. Each choice is reinforced with a set probability, and the agent raises the estimated value of an action in proportion to the reward it gets. The update has the same shape as the Rescorla-Wagner rule from the classical conditioning chapter: the estimate moves toward the outcome by a fraction of the error.
import random
def run(trials=500, alpha=0.1, epsilon=0.1, seed=1):
"""Two-action learner. Action 'press' is reinforced 80% of the time, 'idle' 10%."""
rng = random.Random(seed)
reward_prob = {"press": 0.8, "idle": 0.1}
value = {"press": 0.0, "idle": 0.0}
presses = 0
for _ in range(trials):
if rng.random() < epsilon:
action = rng.choice(list(value))
else:
action = max(value, key=value.get)
reward = 1.0 if rng.random() < reward_prob[action] else 0.0
value[action] += alpha * (reward - value[action])
presses += action == "press"
return presses / trials, value
share, value = run()
print(f"Share of presses: {share:.2f}")
print({k: round(v, 2) for k, v in value.items()})Because the learner mostly picks the action with the higher estimate, rewarded behaviour comes to dominate, which is the law of effect in numbers. The small epsilon allows occasional exploration, which loosely mirrors how real organisms keep testing alternatives. Changing reward_prob["press"] to 0 lets you watch extinction as the value estimate decays.
Evaluation
Strengths. Operant principles are testable under tight experimental control, and they have practical reach. Applied behaviour analysis uses reinforcement to teach skills to children with autism. Token economies in institutions reward target behaviours with tokens exchangeable for privileges. Classroom management, habit change, and animal training all use the same principles.
Limitations. The criticisms differ in kind.
- Environmental determinism. Strict accounts leave little room for choice or reflection, which the cognitive perspective challenges.
- Neglect of cognition. Edward Tolman showed latent learning: rats that explored a maze without reward navigated it efficiently once reward appeared. Learning had occurred without reinforcement, which suggests internal "cognitive maps".
- Biological constraints. Animals learn some associations more easily than others. The Brelands found that animals trained with food reinforcement drifted toward instinctive behaviours that interfered with the trained response.
- Generalising from animals. Findings from pigeons and rats may not transfer fully to humans, who also respond to instructions, rules, and social meaning.
- Ethics. Using aversive consequences, especially punishment, raises welfare concerns, and the behavioural framing of control can be misused.
These gaps motivate the next chapter. Social learning theory keeps reinforcement but adds observation and mental processes.
Exercise
A child cries in a supermarket. The parent gives in and buys sweets, and the crying stops. (a) Identify the consequence for the child and for the parent, naming the type of conditioning in each case. (b) Predict what happens to the child's crying in shops over time and why a parent who sometimes gives in makes it harder to eliminate.
Show answer
(a) For the child, receiving sweets is positive reinforcement (a stimulus is added and crying becomes more likely). For the parent, the crying stopping is negative reinforcement (an aversive stimulus is removed and giving in becomes more likely). (b) Crying in shops is likely to increase. If the parent gives in only sometimes, the child is on a variable ratio schedule. Reward then follows an unpredictable number of cries, so a run of failures does not signal that reinforcement has ended. This produces strong resistance to extinction through the partial reinforcement extinction effect, plus a likely extinction burst when the parent first stops giving in.
Exercise
In the Python simulation, what would you expect to happen to the share of presses if you set the press reward probability to 0.1 (equal to idle) and why? Which operant concept does setting it to 0 after training illustrate?
Show answer
With equal reward probabilities, neither action has a lasting advantage, so the share of presses should drift toward about 50 percent, with the exact value depending on the random seed and early luck. The learner prefers whichever estimate happens to be higher at the time. Setting the press probability to 0 after training illustrates extinction: the value estimate for pressing decays toward zero, and the agent shifts to the other action.