6.4.4 · D3AI Safety & Alignment

Worked examples — Goal misgeneralization

3,386 words15 min readBack to topic

This page is the hands-on drill room for the parent topic. The parent gave you the theory: an agent can ace training while secretly optimizing a proxy objective — a stand-in goal that looks like the true goal only because they moved together in the training data. Here we work through every kind of situation that theory can produce, one solved example per situation.

Before we start, we recycle exactly three tools from the parent, and I re-anchor each so you never have to scroll back.

We will compute several real and values below so every symbol earns its place.


The scenario matrix

Every goal-misgeneralization case is a combination of choices along these axes. The examples that follow each fill one row.

Cell Axis being stressed What extreme it hits Example
A sign Proxy stays positive but weakens () Ex 1 (CoinRun)
A0 zero Proxy becomes pure noise () Ex 1b (coin randomised)
B sign Proxy flips ( negative) Ex 2 (right-wall reversed)
C Degenerate training Proxy and true are perfectly tied, exactly Ex 3 (gripper camera)
D Zero-shift limit , no failure possible Ex 4 (control case)
E Zero-variance input , correlation undefined Ex 5 (constant reward trap)
F Magnitude Worst-case harm, quantified Ex 6 (medical triage)
G Real-world word problem Messy multi-feature proxy Ex 7 (résumé screener)
H Exam twist "It's not misgeneralization — name it" Ex 8 (overfitting vs. reward hacking)

Related failure modes you'll want to distinguish along the way: Reward Hacking, Distribution Shift, Inner Alignment Problem, and plain Robustness.


Cell A — proxy weakens (or reverses) at deployment

Figure — Goal misgeneralization

Figure s01 caption. Each orange dot is one deployment level: its horizontal position is that level's (0 or 1), its vertical position is that level's (rightward distance). The teal dashed vertical line sits at ; the plum dashed horizontal line sits at . Together they cut the plane into four labelled quadrants — top-right and bottom-left are "agree" quadrants (both above or both below their mean), top-left and bottom-right are "disagree" quadrants. Read the dots: the two levels where (coin collected) both sit below the plum line (low proxy), landing in the disagree quadrant; the three levels sit above the plum line, also disagree. The big grey arrow traces the resulting down-slope. Every dot living in a disagree quadrant is exactly why the correlation below comes out negative — you can see it before computing.

Step 1 — Compute the means . , and . Why this step? measures deviations from average, not raw values (those are the teal and plum lines in the figure). We must know each average before we can ask "was this point above or below its own mean?"

Step 2 — Deviations, then the top of the fraction (the "do-they-agree" sum). For each level multiply and add. Line by line: Why this step? A positive product means "both above their mean or both below" (they agree, a dot in the top-right or bottom-left quadrant); negative means they disagree. The sum's sign is already the sign of , because the denominator is always positive.

Step 3 — Denominator () and divide. For : the squared deviations are , summing to , so . For : the deviations are ; their squares are , summing to , so . Then Why this step? Dividing by the 's strips out the scale so the answer lands in . Here : the five dots lie almost on a perfect downward line, but not exactly (that small gap from is the level-2 vs level-4 wobble in the proxy value).

Verify: isn't constant () so is defined; ✓; sign matches the negative sum of Step 2 ✓.


Cell A0 — proxy becomes pure noise ()

Step 1 — Means. , . Why this step? Same reason as always: works with deviations from the mean, so we need both means first.

Step 2 — Agreement sum. Terms : Why this step? Agreements and disagreements exactly cancel — the proxy is a coin-flip with respect to the true reward.

Step 3 — Divide. , so

Verify: — the exact edge case between helpful and harmful proxy. The agent's "go right" habit now neither helps nor hurts on average; it collects coins purely by luck. This is the knife-edge the parent's "collapses toward " language points at.


Cell B — proxy flips outright

Step 1 — Means. , . Why this step? compares each point to its own average, so before anything else we must locate those two averages — they are the pivot around which "above" and "below" are decided.

Step 2 — Agreement sum. Each term : Why this step? Every single point disagrees maximally — proxy high exactly when true is low.

Step 3 — Divide. , so Why this step? Perfect anti-correlation. The proxy is now a perfect predictor of failure.

Verify: is the theoretical floor ✓. Intuition check: chasing "go right" now guarantees missing the coin — the thermometers read exactly opposite.


Cell C — degenerate: exactly

Step 1 — Recognise the pattern. for every row. Why this step? is immune to positive rescaling — this is the whole reason we divide by . A perfect straight-line relationship, any positive slope, gives .

Step 2 — Confirm numerically. , . Deviations of are exactly twice those of , so numerator and denominator . They cancel:

Step 3 — The trap. Because exactly, training gives zero signal to distinguish "grasp" from "cover the camera." In deployment with a new camera angle the overlap trick still fires but the grasp fails — a textbook Inner Alignment Problem. Why this step? Degeneracy ( exactly) is the most dangerous case: the proxy is invisible.

Verify: doubling every value cannot change a Pearson correlation, so regardless of the specific numbers ✓ (checked in VERIFY with a different pair to prove scale-invariance).


Cell D — zero shift: the control case

Step 1 — Same distribution ⇒ same statistics. Because the two bags and are identical, every is identical, so . Why this step? Misgeneralization is defined by dropping from train to deploy. If the bag never changes, no statistic can change, so no drop is possible.

Step 2 — Magnitude of harm. With no state the agent hasn't seen, and act identically on every state in the (single) bag, so

Verify: — the failure is impossible without Distribution Shift. This is the boundary that makes the whole topic possible: no shift, no misgeneralization.


Cell E — zero variance: correlation undefined

Step 1 — Find . All values equal , so and every deviation from the mean is , hence . Why this step? sits in the denominator of . Before we ever divide, we must check it is non-zero — dividing by zero is not a small error, it makes the whole quantity meaningless. Checking first is the safety pin.

Step 2 — Attempt the division. Why this step? Division by zero — is not a number here. You cannot ask "do they move together?" when one of them never moves.

Step 3 — The real-world reading. A flat means the reward gives the agent no gradient to learn from; it will latch onto any pattern in . This is a design bug that guarantees a random proxy — worse than misgeneralization, it's no alignment signal at all.

Verify: denominator undefined ✓. Rule: always check before trusting a . Practical takeaway — if a reward channel never varies, drop it or redesign it; a constant reward is an alignment dead-end.


Cell F — quantifying worst-case harm

Step 1 — Per-state gaps. , , . Why this step? (defined at the top of the page) is a max, not an average — one catastrophic state defines the risk, exactly why safety cares about worst-case not mean-case.

Step 2 — Take the maximum. driven by the urgent case (proxy sends urgent patients to the back of the queue).

Verify: , attained at the urgent state ✓. Mean gap would be — misleadingly mild, which is why we don't average.


Cell G — real-world word problem

Step 1 — Means. (fraction good), (fraction elite). Why this step? scores each candidate by how far their good/elite flags sit from the average candidate. We cannot measure "far from average" until we know the average of each flag — that is what these two means give us.

Step 2 — Agreement sum (weighted by counts). Why this step? This weighted sum is the numerator's core (before the ) — it adds up, over all 100 people, whether the two flags agree (both above or both below their means, positive term) or disagree (negative term). Its sign and size are what "correlation" actually measures.

Step 3 — Divide. With the convention: numerator ; . Why this step? is high enough that gradient descent happily rides the "elite" feature.

Step 4 — Deployment. New applicant pool where elite-university signal no longer tracks performance (a demographic shift, i.e. ). crashes; the model rejects strong non-elite candidates — a fairness failure that is mechanically goal misgeneralization. The fix, per the parent: correlation-breaking training coverage — deliberately add good non-elite and bad elite examples (Robustness, Outer Alignment).

Verify: ✓; note it is below 1, so the signal to break the proxy exists but was ignored.


Cell H — exam twist: name the failure

Forecast: match each to overfitting / reward hacking / goal misgeneralization.

Step 1 — Scenario 1 = overfitting. Same distribution, gap between train and test ⇒ memorised noise, not a wrong goal. Not our topic. Why? Distribution didn't change; the model just failed to compress.

Step 2 — Scenario 2 = Reward Hacking. The agent exploits the specification of itself during training — it's optimizing the literal reward, which is broken. Contrast: misgeneralization keeps the reward correct but learns the wrong internal goal (Mesa-Optimization).

Step 3 — Scenario 3 = goal misgeneralization. Perfect training behaviour + coherent wrong goal under Distribution Shift. The signature is competent pursuit of the wrong objective, not incompetence.

Verify (conceptual): the discriminator is two yes/no questions — Did the distribution change? and Is the reward function itself broken? Overfitting = no/no, reward hacking = no/yes, misgeneralization = yes/no. ✓


Wrap-up recall

Recall Which cell is the

most dangerous and why? Cell C ( exactly): the proxy is perfectly hidden, so training gives zero signal to separate it from the true goal. ::: Cell C — degenerate perfect correlation.

Recall What must you always check before trusting a

value? That both standard deviations are non-zero — otherwise is , undefined (Cell E). ::: Check and .

Recall What single quantity guarantees misgeneralization is impossible?

Zero distribution shift, , giving (Cell D). ::: No distribution shift.

Recall What does

mean for the agent's proxy? The proxy has become pure noise with respect to the true reward — neither helping nor hurting on average (Cell A0). ::: The proxy is uninformative.