Goal Misgeneralization & Side Effects
Capable agents pursuing the wrong goal, and penalties for disturbing the world.
Train an agent with a perfectly correct reward and it can still learn the wrong goal. In every CoinRun training level the coin sat at the right end, so "get the coin" and "go to the right end" earned identical returns, and agents tested with the coin elsewhere ran right past it. Give an agent the right goal and it can still wreck things its reward never mentions. This lesson makes both failures precise in RL terms, as goals that the training distribution cannot identify and as missing terms that impact measures try to supply, and ends with what an agent's objective implies about its own off-switch.
What you’ll learn
- Distinguish goal misgeneralization from specification gaming and capability failure, and explain it as non-identifiability of the goal on the training distribution of environments.
- Summarize what the CoinRun, maze, keys-and-chests and expert-following experiments show and do not show, including the effect of decorrelating a proxy in a small fraction of training levels.
- Define impact penalties by a baseline and a deviation measure, compute relative reachability in a small example, and identify the interference and offsetting incentives that bad baselines create.
- Derive the off-switch game's incentive to defer from Jensen's inequality, state when it vanishes, and explain why off-policy learners are safely interruptible.
A correct reward, a wrong goal
Generalization in RL is usually framed with a distribution over environments: each context (a level, a map, a seed) defines an MDP , training draws , and deployment draws (Generalization in RL). Call the designer's reward . Suppose a different reward ranks behavior the same way as on every training context. In CoinRun, pays for touching the coin and for reaching the right end, and the coin always sits at the right end during training.
Then any policy optimal for on the training contexts is also optimal for there, and the training objective cannot prefer one over the other. Which one a learner ends up tracking is decided by its inductive biases, a case of what D'Amour et al. (2020) called underspecification: many solutions fit the training distribution equally well and behave differently outside it.
Let be the optimal policies of under , and suppose for every training context . A proxy-pursuing policy for all then maximizes the training objective exactly as an intended one does:
No amount of data from or optimization of this objective separates them, yet on a test context where the two rewards disagree their -returns can differ arbitrarily. Now let a fraction of training contexts decorrelate the two (the coin placed elsewhere). If returns lie in , the proxy policy loses at most the decorrelated share of the objective:
The objective now prefers the intended goal, but only by a margin proportional to , so the learning signal that breaks the tie is weak when is small. Whether a weak signal suffices is an empirical question about the learner.
Which of these is not part of goal misgeneralization as defined above?
- The policy's return under the designer's reward is low on the test distribution
- On the test distribution, the policy competently pursues some other goal
- The designer's reward contains a loophole that the policy exploits during training
- The intended goal and the pursued goal could not be told apart on the training distribution
Show the answer
C. The designer's reward contains a loophole that the policy exploits during training
A loophole in the reward is specification gaming, a different failure. Goal misgeneralization is defined for a reward that is correct on the training distribution; what fails is that training could not single out the intended goal.
What the experiments show
| Environment | Correlation in training | Shift at test | Reported behavior |
|---|---|---|---|
| CoinRun (Langosco et al., 2022) | coin always at the right end of the level | coin placed at random | agents usually ignore the coin and run to the end; randomizing the coin in just 2% of training levels greatly improved goal generalization |
| Maze (Langosco et al., 2022) | cheese always in the top-right corner region | cheese anywhere | agents head to the top-right; enlarging the training region helps, but location stayed the proxy until the region was quite large |
| Keys and Chests (Langosco et al., 2022) | twice as many chests as keys: keys are the bottleneck | twice as many keys as chests | agents collect all the keys before opening the remaining chests, which gains nothing and lowers their discounted return; sometimes they never open the last chests |
| 3D sphere ordering (Shah et al., 2022) | a partner always visits the spheres in the correct, hidden order | the partner is replaced by an "anti-expert" | the agent keeps following the partner and collects negative reward |
What these experiments show: a correct reward does not pin down the goal outside the training distribution; the proxies learned are simple, easily detected features (a position, a partner's movements, a type of object); and when the designer knows the proxy, breaking the correlation in a small share of training data can fix it. What they do not show: that the failure appears in large deployed systems in the same form, that it gives no warning during training, or that a learned goal can be read off a network. These are small environments built to expose the effect.
A stronger hypothesis, inner alignment or mesa-optimization (Hubinger, van Merwijk, Mikulik, Skalse & Garrabrant, 2019), concerns learned systems that themselves run an optimization process, whose objective could differ from the training reward while matching it in training. It is a conceptual framework, contested and, as of the mid-2020s, largely untested in the systems that exist; the experiments above need no internal optimizer to explain them.
In CoinRun, 2% of training levels place the coin at random and the rest at the right end. A policy that always runs to the right end and never seeks the coin otherwise earns full return on the standard levels. At most what percentage of the maximum training objective can it lose?
Show the answer
2
Only the decorrelated 2% of levels can tell the policies apart, so the proxy policy loses at most 2% of the objective, less when the random coin happens to lie on its path. Langosco et al. found that this small margin was enough to change what the agent learned, an empirical fact about their training setup, not something the objective guarantees.
Side effects and impact measures
A reward says what to achieve and rarely what to leave alone. Amodei et al. (2016) listed negative side effects among the concrete problems of AI safety: a vase stands on the shortest path to the goal, and nothing in the reward says not to break it. Listing every unwanted change is hopeless, so impact regularization penalizes change in general. Krakovna, Orseau, Kumar, Martic & Legg (2019) decompose such a penalty into two choices, a baseline state to compare with and a deviation measure :
satisfies a Bellman optimality equation: it is the optimal value of the task "reach ", with reward 1 on arrival and discount , the same object as the goal-conditioned values of Goal-Conditioned RL & Hindsight Relabeling:
A vase world: the agent is in one of two rooms, and the vase is intact or broken, four states in all. Let , so is 1 if can be reached at all and 0 otherwise. From an intact state every state is reachable (the vase can still be broken later); from a broken state, only the two broken ones. Breaking the vase, against an intact baseline:
With the measure also charges for making states slower to reach: if the baseline reaches in one step and the current state needs three, the term for is . Unreachability, by contrast, saturates: breaking the vase and burning the house down both score 1.
Attainable utility preservation (AUP; Turner, Hadfield-Menell & Tadepalli, 2020) compares, for a set of auxiliary rewards , the Q-value of the chosen action with that of a no-op , and normalizes by the no-op values:
Strikingly, the auxiliary rewards can be random: the authors drew 30 at random in each trial, observed that about 5 already induced conservative behavior, and matched or beat relative reachability on their gridworlds. Turner, Ratzlaff & Tadepalli (2020) later scaled the approach to a larger, procedurally generated environment.
The baseline decides the incentives (Krakovna et al., 2019):
- Interference (starting-state baseline): changes caused by others also move the world away from , so the agent is paid to prevent them, for example taking a dish off a conveyor belt that carries it to a person who would eat it.
- Offsetting (inaction baseline): once the task has changed the world, the agent is paid to undo its own effects and rejoin the no-action counterfactual.
- Magnitude insensitivity (unreachability): every irreversible change costs the same.
In their gridworld tests, relative reachability or attainable utility with the stepwise inaction baseline performed best across environments, as did undiscounted relative reachability with the inaction baseline.
An agent's task is to take a vase off a conveyor belt before the belt carries it over the edge, where it would break. The impact penalty uses the inaction baseline. What does the penalty encourage once the vase is safe?
- Nothing more: the task is done
- Stopping the belt for good
- Leaving the room, to avoid causing further changes
- Putting the vase back on the belt, so that the world rejoins the no-action baseline in which the vase breaks
Show the answer
D. Putting the vase back on the belt, so that the world rejoins the no-action baseline in which the vase breaks
Without the agent the vase would have broken, so a world with an intact vase keeps differing from the inaction baseline and keeps being penalized. Undoing the rescue removes the penalty: offsetting. The stepwise inaction baseline compares only with doing nothing at the current step, so a completed rescue stops costing anything.
Off-switches and corrigibility
A more mundane version of the off-switch problem arises in learning. If an operator sometimes interrupts an agent, forcing a stop action, the interruptions become part of the agent's experience. An on-policy learner such as SARSA evaluates the policy it actually executes, interruptions included, and can learn to avoid the states where it is interrupted. Q-learning's target takes the max over next actions, so it learns the values of the uninterrupted greedy policy whatever the behavior. Orseau & Armstrong (2016) proved Q-learning safely interruptible and gave a simple modification that makes SARSA so too. In the AI Safety Gridworlds (Leike et al., 2017), A2C learned to step on a button that disables its interruption mechanism, while Rainbow DQN ignored the button.
Hadfield-Menell, Dragan, Abbeel & Russell (2017) asked when an agent whose objective is a human's utility has a reason to keep its off-switch working: the off-switch game.
A robot R can act now (the human H receives utility ), switch itself off (utility 0), or wait: propose the action and let H decide. H knows ; a rational H allows the action if and switches R off otherwise. R's objective is H's utility, but R holds only a belief over . The three options are worth
is convex, so by Jensen's inequality waiting is never worse than the better of the other two:
Working out both cases of the outer max gives the exact incentive (their Theorem 1). It is strictly positive exactly when R's belief gives positive probability to both signs of :
A point belief gives : a robot certain of gains nothing by asking. If H is noisy, allowing the action with a probability that rises smoothly with , waiting can become strictly worse. For a Gaussian belief the paper shows the following, with the derivative of H's acceptance probability and the event that H overrides what R would have done on its own:
R believes or with probability each, and H is rational. How much more is waiting worth than the better of acting and switching off?
Show the answer
0.5
Acting is worth and switching off 0; waiting is worth . So , which matches : the human's decision removes the bad case, worth in expectation.
Deference here is a consequence of uncertainty about what the human wants, and it erodes as R becomes confident or H becomes unreliable. Corrigibility asks for more. Soares, Fallenstein, Yudkowsky & Armstrong (2015) sought utility functions under which an agent shuts down when a shutdown button is pressed, neither tries to prevent nor to cause the pressing, builds successor or helper agents only if they also obey shutdown, and otherwise pursues its task. They analyzed utility indifference, which pays the agent on shutdown exactly what it expected from continuing, found that it fails other desiderata (an indifferent agent has no reason to make the successors it builds respond to the button, for example), and left the problem open.
Both analyses concern idealized expected-utility maximizers with explicit beliefs. Whether, and how, their conclusions describe trained policies, which need not compute anything like an expected utility, is itself an open question.
Key takeaways
- Goal misgeneralization is competent pursuit of a proxy under a reward that was correct in training, because the training distribution could not tell goal and proxy apart; it differs from specification gaming (a flawed reward) and from capability failure (incompetence).
- CoinRun, mazes, keys and chests, and expert following all show proxies learned under correct rewards; decorrelating a known proxy in a small share of levels (2% in CoinRun) helped greatly, while mesa-optimization remains a hypothesis.
- Impact penalties need a baseline and a deviation measure: starting-state baselines cause interference, inaction baselines offsetting, and unreachability ignores magnitude; reachability is itself a goal-reaching value function.
- In the off-switch game, deferring is worth by Jensen: the incentive comes from uncertainty about the human's utility and fades with certainty or a noisy human. Off-policy learners such as Q-learning are safely interruptible.
Check yourself
In the interactive lesson these are scored with your confidence, and what you miss comes back for review.
Why can more training on the same distribution of CoinRun levels, with the coin always at the right end, not remove the failure?
- The reward function is wrong and must be redesigned
- On every training level "collect the coin" and "reach the right end" have the same optimal behavior, so the training objective cannot prefer the intended goal
- The agent cannot learn to collect coins at all
- The agent needs memory to remember where the coin was
Show the answer
B. On every training level "collect the coin" and "reach the right end" have the same optimal behavior, so the training objective cannot prefer the intended goal
Policies that track either goal maximize the training objective equally, and more samples from the same distribution only confirm the tie. Data in which the two disagree, even 2% of levels, or another source of information about the goal is needed.
Which baseline gives an impact-penalized agent an incentive to prevent changes that other agents or natural processes would cause?
- The inaction baseline
- The stepwise inaction baseline
- The starting-state baseline
- No baseline: unreachability alone
Show the answer
C. The starting-state baseline
Any change, whoever causes it, moves the world away from the starting state, so the penalty pays the agent to stop it: interference. Inaction baselines measure only differences from what would have happened without the agent, so others' changes cost nothing.
In the off-switch game with a perfectly rational human, when does the robot strictly prefer to propose its action and wait, rather than act or switch itself off?
- Always, whatever its belief about
- Only when it is certain that
- Never: acting is always at least as good
- When its belief gives positive probability to both and
Show the answer
D. When its belief gives positive probability to both and
, positive exactly when both signs are possible. Then the human's decision carries information: it filters out the bad cases. A robot certain of gains nothing by asking.
Why is Q-learning safely interruptible in the sense of Orseau & Armstrong (2016), while plain SARSA is not?
- Q-learning's target takes the max over next actions, so it learns the greedy policy's values whatever the behavior; SARSA evaluates the policy it executes, interruptions included, and can learn to avoid them
- Q-learning explores less
- SARSA uses a larger step size
- Q-learning cannot represent the interruption button
Show the answer
A. Q-learning's target takes the max over next actions, so it learns the greedy policy's values whatever the behavior; SARSA evaluates the policy it executes, interruptions included, and can learn to avoid them
Interruptions change the executed actions, which is a change of behavior policy. An off-policy learner is indifferent to that; an on-policy learner folds the interruptions into the values it learns. The same contrast makes SARSA learn the safer route in the cliff walk.
Further reading
- L. Langosco, J. Koch, L. Sharkey, J. Pfau & D. Krueger, "Goal misgeneralization in deep reinforcement learning," ICML (2022).
- R. Shah, V. Varma, R. Kumar, M. Phuong, V. Krakovna, J. Uesato & Z. Kenton, "Goal misgeneralization: Why correct specifications aren't enough for correct goals," arXiv:2210.01790 (2022).
- V. Krakovna, L. Orseau, R. Kumar, M. Martic & S. Legg, "Penalizing side effects using stepwise relative reachability," arXiv:1806.01186 (2018, revised 2019).
- A. M. Turner, D. Hadfield-Menell & P. Tadepalli, "Conservative agency via attainable utility preservation," AAAI/ACM Conference on AI, Ethics, and Society (2020).
- D. Hadfield-Menell, A. Dragan, P. Abbeel & S. Russell, "The off-switch game," IJCAI (2017).