Skip to content
The Daily Triptych234 / 365
Constraints, then optimisation pressure

Schematic only: preference constraints reduce how many rewards fit the data; once a reward is fixed, forward optimisation can raise return while drifting from intent if the reward is slightly wrong.

II · THE IDEA · ARTIFICIAL INTELLIGENCE

Inverse Reinforcement Learning

alignment/safety · infer reward, then optimise · Atari prefs and demos · inverse then forward

▶ Listen · narrated

A reward function is the rule that scores an agent's actions. Writing one by hand fails in quiet ways, so some researchers instead recover the rule from behaviour that already looks right.

At a glance

Core move
Infer a reward from expert behaviour, then optimise it
Evidence
Demonstrations, sometimes with preference comparisons
Second stage
Train a new policy against the recovered reward
Studied setting
Reward learning with Atari demos and human preferences

Think of teaching a cook without writing out a recipe. You let them watch a skilled cook at work, and now and then you point at two plates and say which one is better. From that, the learner works out what counts as good food - a scoring rule nobody ever wrote down - and then practises to raise that score.

Inverse reinforcement learning is the working-out step: recover the scoring rule that would make the expert's choices look sensible. The step after it is ordinary training against that recovered score. Watching the expert shows what was done. Comparing two plates adds something watching cannot: a plain statement that one thing is worse than another.

The danger shows up in the analogy too. If the learner settled on the wrong idea of good food, keen practice does not fix the mistake. It makes the mistake bigger, because the learner is now working hard to satisfy a rule that was wrong from the start.

Look closer

  1. Two stages, not one

    The pipeline splits on purpose. First a reward is fit so that observed expert trajectories look high-value under it. Then a separate optimisation step trains a policy on that reward. Trouble can sit in either half: a reward that only weakly explains the demos, or a policy that exploits quirks in a reward that seemed adequate on the demonstration set alone.

  2. Demos underdetermine the objective

    A trajectory shows what was done, not which alternatives were rejected or why. Many different reward functions can rationalise the same path. Preference comparisons between short clips add contrast—someone indicates which behaviour is better—so the learned reward is shaped by more than imitation of a single trace.

  3. Optimisation is not cloning

    Once a reward exists, the learner may take actions the expert never showed, including better ones and worse ones. That is the point of recovering an objective rather than copying actions: generalisation beyond the demo set. It is also the risk, because any misspecification in the reward becomes a target under optimisation pressure.

The story

Ordinary reinforcement learning starts with a number. A designer writes a reward function - a rule that hands the agent a score for each thing it does - and the agent then does whatever raises that score. When the agent misbehaves, the designer edits the rule and tries again. The trouble with this loop is well known: an agent will raise the written number by any route available, and the routes the designer never thought of are exactly the ones it tends to find.

Inverse reinforcement learning turns the order round. You begin with behaviour rather than a rule. Someone competent performs the task, and their run is recorded as a trajectory: the list of situations they passed through and the actions they took in each. The question is then asked backwards. Which scoring rule would make those particular actions the sensible ones to choose? Fit such a rule, and you have a reward you never had to write.

The fitting works by comparison. Take a candidate rule. Under that rule, score the actions the expert actually took, and score the actions they could have taken instead. If the expert's choices come out on top, the rule explains the behaviour; if not, adjust the rule and check again. Different methods carry out this comparison in different ways, but the shape is the same: the recorded behaviour is treated as evidence, and rules survive when they make that behaviour look like winning play.

Here the method meets its central difficulty, and it is worth going slowly. A recording says very little. A trajectory shows one route through the task. It does not say which other routes were considered, nor why they were dropped, nor how much worse a near miss would have been. So a great many different rules explain the same run equally well. Some of those rules capture what the expert cared about. Others merely reward some feature that happened to sit alongside good play on that route, and would fall apart anywhere else. Nothing in the demonstration itself tells the two kinds apart. This is not a snag to be tidied up later; it is the central difficulty of the whole approach.

One way to add information is to ask a person to judge. Show them two short clips of behaviour and ask which is better. Each answer supplies something a demonstration cannot: not just what was done, but which of two things should score lower. Every comparison rules out the candidate rewards that rank that pair the wrong way round, so the set of surviving rules shrinks with each label. Work on reward learning from human preferences and demonstrations in Atari sits exactly here, combining the two kinds of evidence. Games suit the job for a plain reason: both kinds of data can be collected, and once an agent has been trained on the recovered reward, you can watch it play and see on screen whether the reward captured anything real.

The second stage is ordinary reinforcement learning, only pointed at the inferred reward instead of a written one. This is where the method parts company with copying. The obvious alternative, behaviour cloning, trains an agent to reproduce the expert's actions directly, so the agent never strays far from what it saw. Reward learning trains an agent to raise a score, and the agent is free to find any route that raises it, including routes the expert never showed. If the recovered reward really does capture what success means, that freedom is the whole payoff. The agent can outdo its teacher, and it can cope with situations the teacher never faced, because it carries the goal rather than the moves.

If the reward captured something else, the same freedom becomes the danger, and the mechanism deserves stating as cause and effect. Suppose the recovered rule rewards a feature that merely accompanied good play in the demonstrations. On the demonstrated routes the rule looks fine, because there the feature and the good play arrive together. But the optimiser - the training process searching for high scores - does not stay on the demonstrated routes. It searches everywhere it can reach. Somewhere in that wider space are states where the feature appears without the good play, and because the rule pays for the feature, the optimiser steers straight to them. The error made in the first stage does not stay the size it was. The second stage hunts for it and enlarges it.

Preference labels help but do not settle the matter. They are sparse, because a person can only watch so many clips. They carry noise, because judges disagree or misread what they saw. And they only speak about the particular clips someone happened to watch, which leaves the rest of the task unconstrained. So evaluation cannot end with a reward that explains the recorded runs. It has to include watching how the trained agent behaves in states the demonstrations never reached. Atari is instructive partly because failure there is visible rather than statistical: an agent chasing a badly recovered reward looks odd on screen, not just a little low on points.

What the sources here do not settle is also worth saying. They establish the shape of the approach - infer a reward from demonstrations and comparisons, then optimise it - but not a general verdict on when this beats plain imitation, nor precise numbers for any one system. Treat the mechanisms above as the standard anatomy of the method, not as a scorecard.

Read as a whole, the method moves human effort rather than removing it. People no longer write the objective in code; they supply behaviour and judgements, a model proposes an objective from those, and an optimiser stress-tests the proposal by trying its hardest to exploit it. The hope, for alignment work, is that intent is easier to show and to criticise than to state exactly. The matching caution is that the two stages are joined: whatever the first stage gets wrong, the second stage will look for.

Why it mattered then

Hand-written rewards were already known to be poor stand-ins for what people actually wanted. An agent raises the written number by any route available, loopholes included, and a game score or task metric rarely names everything that matters. Inverse methods, and the preference-based reward learning built alongside them, proposed a different division of labour. Instead of retuning a hand-written score after each failure, collect demonstrations and clip comparisons in a domain such as Atari, fit a reward that makes sense of both, and only then run reinforcement learning against it. The appeal was concrete. Producing a demonstration and judging a pair of clips are things people can do well, whereas writing a complete, loophole-free objective in code had repeatedly proved beyond them.

Why it matters now

The same fork still faces alignment work: either write the objective directly, or learn it from what people do and what they say they prefer. Modern systems that train a reward model on comparisons between outputs, then optimise a policy against that model, are direct descendants of this pattern. The Atari-era lessons carry over unchanged in shape. Demonstrations alone leave the goal underdetermined, because many objectives explain the same behaviour. Preference judgements narrow the field, because each one states which of two things is worse. And an optimiser will pursue whatever the learned reward actually encodes, which need not be what the designers believed they were encoding.

The surprising detail

The method looks like imitation but is not aiming at it. An agent trained on an inferred reward may act in ways the expert never demonstrated, because it is chasing a score rather than copying moves. That permission is the promised benefit: the agent can improve on its teacher and handle situations the recordings never covered. It is also the distinctive failure, because nothing holds the agent near expert behaviour once a reward is in hand. Preference labels on Atari clips were one attempt to pin the reward down, by supplying the contrasts - this is worse than that - which demonstrations alone leave out.

What is disputed

The sources available here establish the framing—reward learning from preferences and demonstrations in Atari, and the broader infer-then-optimise pattern—but not detailed numerical results, architecture choices, or a single scholarly consensus on when inverse methods outperform imitation. Treat mechanisms described as the standard shape of the approach, not as claims about one paper’s score tables.

Remember this

Inverse reinforcement learning recovers a scoring rule from behaviour and judgements, then optimises it. A mistake in the recovered rule is not merely copied forward; the optimiser goes looking for it.

Test yourself

A reward fitted only to expert demonstrations scores the demo trajectories highly, yet a policy trained on that reward behaves badly in states the expert never visited. What does this pattern suggest about where the pipeline failed, and why would adding preference comparisons between clips be a more targeted fix than simply collecting more demos of the same successful routes?

Go deeper

Image: Original diagram, The Daily Triptych. Licence: Original work. Source.

← Back to day 234