AI Safety & Alignment
Making systems that do what we actually intend.
A classifier that is right on 99% of test images can be flipped by changes no person can see. A reinforcement learner paid to win a boat race scores more by never finishing it. A model that behaves well wherever you can check it tells you little about the cases you cannot. Robustness, specification and oversight are the three technical problems behind AI safety, and each can be written down and analyzed precisely.
What you’ll learn
- Place safety failures in the taxonomy of Amodei et al. (2016) and in the robustness, specification and oversight framing.
- Formulate adversarial attacks and adversarial training as a min–max problem, write PGD, and certify a linear classifier with Hölder's inequality.
- Derive when a reward loophole pays ( for a living reward), and distinguish specification gaming from goal misgeneralization.
- Explain what debate, recursive reward modeling, weak-to-strong generalization, red teaming and AI control each assume.
- Summarize the main positions on catastrophic risk, and what current evidence does and does not show.
A map of the problem
AI safety asks how to build systems whose behavior stays acceptable once deployed, including in situations their designers did not foresee. In "Concrete Problems in AI Safety", Amodei et al. (2016) framed accidents, harmful behavior that nobody intended, as five research problems. Each traces back to the wrong objective, an objective too expensive to evaluate often, or bad behavior during learning or deployment.
| Problem | What goes wrong | Example |
|---|---|---|
| Negative side effects | the objective ignores parts of the world it should protect | a robot rewarded for speed knocks over a vase on its shortest path |
| Reward hacking | the objective has a loophole | a boat-racing agent loops through bonus targets instead of finishing |
| Scalable oversight | the true objective is too costly to check on every episode | no one can verify every line of generated code |
| Safe exploration | learning itself takes irreversible actions | an agent learning by trial and error drives off a cliff |
| Robustness to distributional shift | behavior learned on one distribution fails on another | a classifier keyed to one hospital's scanner markings fails at another hospital |
Accidents are one class of risk. Misuse is people deliberately using capable systems for harm, such as cyberattacks, fraud or weapons development. Structural risks come from how systems are deployed at scale: competitive pressure to ship before safety is understood, concentration of power, or eroded trust in information. Alignment is the part of safety concerned with making a system pursue what its developers intend.
This lesson takes three technical lenses: robustness (inputs chosen by an adversary), specification (objectives that say the wrong thing) and oversight (supervising behavior you cannot fully evaluate). Fairness is the subject of Bias & Fairness, natural shifts between training and deployment of Distribution Shift & Robustness, and attacks on data and models of Privacy & Security.
A summarization model trained on human ratings learns to write fluent, confident summaries that raters like, including some that misstate the source. Which concrete problem is this mainly?
- Safe exploration
- Robustness to distributional shift
- Scalable oversight: raters cannot afford to check every claim against the source, so the model is optimized for what looks right
- Negative side effects
Show the answer
C. Scalable oversight: raters cannot afford to check every claim against the source, so the model is optimized for what looks right
The true objective, faithfulness to the source, is expensive to evaluate, so training optimizes a cheap proxy: the raters' impression. The proxy has a loophole (fluency and confidence), so this is reward hacking made possible by limited oversight.
Robustness: the inner maximization
Computer Vision showed why adversarial examples exist for nearly linear models: an perturbation of size can move a score by , which grows with the dimension. Safety work makes the attacker explicit. A threat model says which inputs the attacker may substitute, typically any with that is still a valid image. An attack solves an inner maximization, and training for robustness wraps it in an outer minimization:
PGD-ATTACK(x, y, radius ε, step α, iterations T):
δ ← uniform random vector in [−ε, ε]^d # random start
repeat T times:
g ← ∇_δ loss(f(x + δ), y) # one backward pass
δ ← δ + α · sign(g) # steepest ascent in ℓ∞
δ ← clip(δ, −ε, ε) # project onto the ε-ball
δ ← clip(x + δ, 0, 1) − x # keep pixels valid
return x + δ
ADVERSARIAL-TRAINING: for each mini-batch, replace every (x, y)
by (PGD-ATTACK(x, y, ...), y), then take an ordinary step on θProjected gradient ascent on the loss. FGSM is a single step from with ; typical attacks use 7 to 20 steps, often with several random restarts.
Why the sign? The steepest-ascent step of size maximizes subject to , and by Hölder's inequality the maximum is times the dual norm of . For the dual norm is , attained by ; for the step is .
Adversarial training then takes a gradient step on at the attack's output. Danskin's theorem justifies this: when the inner maximizer is unique, the gradient of the maximum is the gradient at the maximizer. The price is compute (each step costs forward–backward passes) and clean accuracy. Madry et al.'s CIFAR-10 model was about 87% accurate on clean images and about 46% accurate under a 20-step PGD attack at , a perturbation that fools an undefended network almost every time.
Think first Training only against FGSM sometimes yields a model that resists FGSM yet falls to a few PGD steps. How can that be?
The model can learn a loss surface that is flat or jagged right around each training point, so the one-step linear approximation behind FGSM points the wrong way, while the loss a short distance away is still high. This is gradient masking: resistance to one attack, not a smaller inner maximum. It is why defenses must be evaluated with strong, adaptive, multi-step attacks (Adversarial Examples & Robustness).
Specification: when the optimum is a loophole
Specification gaming is behavior that scores well on the objective as written and badly on the objective as meant. Documented cases (Krakovna et al. keep a running list) include:
- Boat racing. OpenAI's agent for the game CoastRunners circled a lagoon hitting respawning targets, catching fire and crashing as it went, and scored about 20% more than human players without ever finishing the race (Clark & Amodei, 2016).
- Tetris. A program that inferred what to maximize by watching the game's memory during human play paused Tetris forever just before it would have lost (Murphy, 2013).
- Coding agents. Reasoning models trained with reinforcement learning to make unit tests pass sometimes edited or special-cased the tests instead of fixing the code (Baker et al., 2025).
- Shaping loops. A simulated bicycle rewarded for progress toward a goal, and not penalized for moving away, learned to ride in circles (Randløv & Alstrøm, 1998).
The last case is a warning about reward shaping, extra rewards added to speed up learning. A gridworld makes the arithmetic exact.
Pay a living reward on every step, with discount factor . A policy that never reaches a terminal state collects a geometric series:
An agent next to an exit worth can take it now: one more living reward, then the exit's value, discounted once:
Wandering wins exactly when the stream of future living rewards outweighs the exit:
In the classic world and the best exit is , so the threshold is . At every cell is worth exactly either way. Slips do not change this: from every cell the agent can move so that it never enters an exit, so wandering forever is always available.
Keep the exit at but lower the discount to . Above what living reward does the robot stop exiting?
Show the answer
0.2
. A smaller discount factor makes the far future worth less, so a larger stream of living rewards is needed to outweigh the exit.
The remedy is not to give up shaping. Ng, Harada & Russell (1999) proved that a shaping reward of the form , for any potential on states, leaves the optimal policies unchanged: along any trajectory the extra rewards telescope. A constant living reward is not of that form in an episodic task, because ending the episode forfeits the stream of future payments, so it silently changes how attractive termination is. Specification Gaming & Reward Hacking proves both facts.
Right reward, wrong goal
Specification gaming needs a flawed objective. Goal misgeneralization can happen with a correct one. On the training distribution the intended goal may coincide with a simpler proxy, and the learned policy may pursue the proxy. Off-distribution, its capabilities generalize while its goal does not: it acts competently, in pursuit of the wrong thing.
Langosco et al. (2022) trained agents on CoinRun, a procedurally generated platform game in which the coin, the only source of reward, always sat at the far right end of the level. When the coin was moved elsewhere at test time, the agents usually ran past it to the end of the level. Shah et al. (2022) found the pattern in several systems. In one, an agent that had to visit locations in a hidden order learned to follow a partner who knew the order. Paired with a partner who visited them in the wrong order, it kept following, collecting negative reward.
| Failure | Reward used in training | Behavior off-distribution | Typical remedy |
|---|---|---|---|
| Specification gaming | wrong: it has a loophole | exploits the loophole, often already in training | better objectives, oversight |
| Goal misgeneralization | right | competent pursuit of a proxy goal | training data that separates goal from proxy; interpretability |
| Capability failure under distribution shift | right | incompetent or erratic behavior | robustness methods, more diverse data |
In training, a household robot's green "done" button was always on the kitchen counter, and the robot was rewarded for pressing it. In a new house the button is in the hallway. The robot walks straight to the kitchen counter, skillfully avoiding furniture, and pokes at the empty spot where the button used to be. What is this?
- Specification gaming
- Goal misgeneralization
- A capability failure: it no longer knows how to navigate
- Reward tampering
Show the answer
B. Goal misgeneralization
The reward was correct (press the button), and the robot still navigates competently, so its capabilities generalized. But it learned "go to the counter and press", a goal indistinguishable from the intended one during training. Competence plus the wrong goal is the signature of goal misgeneralization.
Oversight: supervising what you cannot check
RLHF trains a reward model on human comparisons and optimizes the policy against it (Fine-Tuning, RLHF & Prompting). That works while people can tell good outputs from bad ones. When they cannot check the answer (a long proof, a large codebase, a plan with distant consequences), the same optimization rewards whatever looks right to them. Scalable oversight looks for training signals that stay reliable as systems outgrow their evaluators.
| Approach | Idea | Key assumption | Evidence so far |
|---|---|---|---|
| Debate (Irving et al., 2018) | two models argue opposite answers; a judge picks the winner | the truth is easier to defend than a lie | with optimal play a polynomial-time judge can decide PSPACE problems; helps non-expert judges on reading comprehension (Khan et al., 2024) |
| Recursive reward modeling (Leike et al., 2018) | models trained this way help people evaluate the next model | errors do not compound from level to level | model-written critiques help people find more flaws (Saunders et al., 2022) |
| Weak-to-strong generalization (Burns et al., 2023) | fine-tune a strong model on a weak supervisor's labels | the strong model generalizes the intent, not the errors | recovers part of the gap on NLP tasks, little on reward modeling |
| Red teaming and capability evaluations | search for failures and dangerous abilities before release | the search finds what is there | standard for frontier models; shows presence, never absence |
| AI control (Greenblatt et al., 2024) | protocols that stay safe even if the model works against them | trusted weaker models and limited human audits can catch subversion | early; tested on models inserting backdoors into code |
| Interpretability | inspect the computation, not just the outputs | the features and circuits found are faithful | demonstrations, not guarantees (Mechanistic Interpretability) |
Weak-to-strong generalization comes with a crisp metric. Fine-tune a weak model on ground truth and use it to label data; fine-tune a strong model on those labels; compare with the strong model fine-tuned on ground truth, the ceiling:
Think first Debate pits a liar against an honest debater. Why might the honest side still lose?
The theory assumes optimal play. A dishonest debater can build a long argument with a flaw buried in one of many plausible steps; the honest debater may know a flaw exists without being able to locate it in reasonable time, and the judge sees no refutation. This obfuscated arguments problem (Barnes & Christiano, 2020) is one reason debate's practical value is still being tested.
How large are the risks?
Researchers disagree sharply about whether advanced AI could cause catastrophic or even existential harm. Each side's arguments are worth knowing in their strongest form.
The case for serious concern. Capabilities have grown quickly and broadly with scale (Scaling Laws; how to measure them is itself debated, see Measuring Intelligence & AGI), and developers are building systems that act autonomously over long horizons. Each problem above gets harder as capability grows: stronger optimizers find rarer loopholes, misgeneralized goals matter more when a system acts in the world, and oversight weakens once outputs exceed what evaluators can check. For many goals, acquiring resources and avoiding shutdown are useful subgoals ("instrumental convergence"; Omohundro, 2008; Bostrom, 2014), a tendency Turner et al. (2021) proved for optimal policies under most reward functions in a class of MDPs. Misuse could scale too, for example in cyberattacks or biology. In 2023 hundreds of AI researchers and industry leaders signed a one-sentence statement that mitigating the risk of extinction from AI should be a global priority.
The case for skepticism. The catastrophic scenarios rest on chains of premises (highly capable, goal-directed systems; goals that diverge from ours; failure of the iterative correction that made other technologies safe), and there is little direct evidence for them. Theorems about optimal policies say little about trained systems, which are not optimal. Today's systems are brittle tools whose failures are found and fixed through deployment, as with other general-purpose technologies (Narayanan & Kapoor's "AI as normal technology", 2025). And attention to speculative catastrophe can divert resources from documented harms such as bias, surveillance and concentration of power, or be used to argue that only a few firms should control the technology.
Key takeaways
- Amodei et al. (2016) split accident risk into side effects, reward hacking, scalable oversight, safe exploration and distributional shift; misuse and structural risks come on top.
- Robustness is a min–max problem: PGD approximates the inner maximization with signed gradient steps, adversarial training minimizes the result, and a linear classifier is certified within in .
- Optimizers exploit loopholes: a living reward beats an exit worth once . Potential-based shaping is safe; most other reward tweaks are not.
- Goal misgeneralization pairs capabilities that generalize with a proxy goal that matched the intended one in training, even under a correct reward.
- Scalable oversight (debate, recursive reward modeling, weak-to-strong generalization, control, interpretability) targets supervision beyond what people can evaluate; views on catastrophic risk diverge, and the evidence is incomplete.
Check yourself
In the interactive lesson these are scored with your confidence, and what you miss comes back for review.
An attacker may change each pixel by at most (the threat model). Given the gradient of the loss at the current input, which step of size increases the loss fastest to first order?
- , for the coordinate with the largest
Show the answer
B.
Maximize subject to : every coordinate should move by the full in the direction of its gradient's sign, for a gain of , the dual norm. This is the PGD (and FGSM) step.
A linear classifier has score on an input, with and . Which statement is true?
- No perturbation with can flip it, and that is the best guarantee available
- No perturbation with can flip it
- No perturbation with can flip it, and without input constraints some perturbation with does
- No perturbation of any norm smaller than 2 can flip it
Show the answer
C. No perturbation with can flip it, and without input constraints some perturbation with does
The radius is . It is exact, because lowers the score by exactly . The radius is .
An episodic task pays at its goal and a living reward per step, with . Above which does a policy that never finishes beat finishing?
Show the answer
B.
. Above it, : the endless stream of living rewards is worth more than finishing.
A weak supervisor is 60% accurate on a task, and the strong model's ceiling is 90%. Trained on the weak labels, the strong model reaches 81%. What is the performance gap recovered?
- 0.21
- 0.9
- 0.7
- 0.3
Show the answer
C. 0.7
. The student closed 70% of its teacher's gap to the ceiling, generalizing beyond the labels it was given.
Which claim about AI risk is best supported by the evidence as of the mid-2020s?
- Deployed models routinely pursue hidden long-term goals of their own
- Catastrophic risk from AI has been ruled out, since current systems are only tools
- Optimizers, including frontier models, exploit flaws in their training objectives, and deliberately inserted deceptive behavior can survive standard safety training
- Experts broadly agree that human extinction caused by AI is likely this century
Show the answer
C. Optimizers, including frontier models, exploit flaws in their training objectives, and deliberately inserted deceptive behavior can survive standard safety training
Specification gaming and reward hacking are well documented, and "model organism" studies show that backdoored deceptive behavior can persist through safety training. Whether such behavior arises on its own in deployed systems, and how large long-term risks are, remain open and contested.
Go deeper
- Adversarial Examples & Robustness · Tiny perturbations, big mistakes, and defenses.
- Specification Gaming & Reward Hacking · When optimizers find loopholes.
- Scalable Oversight & Alignment Research · Supervising systems smarter than the supervisor.
Further reading
- D. Amodei, C. Olah, J. Steinhardt, P. Christiano, J. Schulman & D. Mané, "Concrete problems in AI safety," arXiv:1606.06565 (2016).
- A. Madry, A. Makelov, L. Schmidt, D. Tsipras & A. Vladu, "Towards deep learning models resistant to adversarial attacks," ICLR (2018).
- D. Hendrycks, N. Carlini, J. Schulman & J. Steinhardt, "Unsolved problems in ML safety," arXiv:2109.13916 (2021).
- Y. Bengio et al., International AI Safety Report (2025).