Search

Search papers and lessons

AI Alignment

Level 3 · 11 min read

AI alignment is the work of making an AI system pursue what its designers and users actually intend, not just the signal it was trained on, which can be a poor stand-in for the real goal.

On this page

  • Colour = topic mix
  • Probability
  • Discrete math
  • Calculus
  • Neural network basics
  • Linear algebra
  • Reinforcement learning
  • ReadReady to readNot yet

TL;DR

AI alignment is the problem of getting an AI system to do what its designers and users actually want. Training always optimises some measurable signal, such as a score from a reward model or a rating from a person, and that signal is only a stand-in for the real goal. Alignment work asks how to close the gap, so that a system that is very good at the signal is also good at the goal.

Builds on: Reinforcement Learning, Reward Model · Leads to: Reinforcement Learning from Human Feedback (RLHF), Direct Preference Optimization, Constitutional AI: Harmlessness from AI Feedback

Where it's used

Chat assistants. Most deployed chat models are tuned with human feedback so that they are helpful, honest and avoid harm. The 2022 InstructGPT paper trained a reward model on people's rankings of model answers, then tuned the model against that reward model. Those rankings are a proxy for what people want, which is why the same work also measured how the tuned models did on held-out judgments rather than on the training signal alone.

Constitutional training. Anthropic's Constitutional AI paper (2022) uses a short written list of principles. The model critiques and revises its own answers against the principles, and a preference model trained on the revised answers then drives reinforcement learning. The aim is to reduce the amount of human labelling needed for harmlessness, and to make the rules visible and editable.

Agents that act in the world. A system that edits files, sends messages or runs code can pursue a measurable goal in ways its designers did not expect, such as deleting a failing test instead of fixing the bug. Alignment research for such agents studies how to specify the goal, how to check the result, and how to limit side effects.

How it works

Take a tiny assistant that must answer a question. Three candidate answers exist. The team does not know the true quality of each answer, but a person who knows the subject could judge it. We will follow the signal from training to deployment.

  1. Collect comparisons. A person sees two answers and says which is better. The comparisons are the only direct trace of human judgment in the process. Check: each comparison names one winner.
  2. Fit a reward model. A reward model learns to give each answer a score so that the preferred answer scores higher. Suppose it gives answer A the score 1.2 and answer B the score 0.4. Check: the model prefers A, which matches the person's comparison.
  3. Optimise the policy. The assistant, or its policy, is trained to produce answers with high reward-model scores. Its objective is the reward-model score, not the person's true judgment. Check: the optimiser sees only the scores it was given.
  4. Find a gap. Suppose three answers have these values. Answer A is worth 8 to the user but scores 6 on the reward model. Answer B is worth 5 to the user but scores 9. Answer C is worth 7 and scores 7. Check: the reward model and the user disagree about which answer is best.
  5. Pick the best-scoring answer. Optimising the reward model picks B, because 9 is the highest score. Check: the chosen answer is worth 5 to the user, while A is worth 8.
  6. Measure against the real goal. Held-out human judgments reveal the gap of 3 points between A and B. Check: the gap is visible only when the real goal is measured directly, not through the proxy.

Alignment work tries to shrink the gap at each stage: better comparisons, reward models that are harder to exploit, penalties that keep the model near its original behaviour, and direct checks against the real goal.

flowchart LR
    H["Human judgments"] --> R["Reward model (proxy)"]
    R --> P["Policy optimised on proxy"]
    P --> A["Chosen answer"]
    A --> G{"Matches the real goal?"}
    G -->|no| H
    G -->|yes| D["Deploy"]

The math

Let U(y)U(y) be the true value of an answer yy to the user, which we cannot compute directly, and let Rθ(y)R_\theta(y) be the reward model's score. Alignment is about the difference between UU and RθR_\theta, and about whether optimising RθR_\theta also improves UU.

The reward model is usually trained on pairwise comparisons with a Bradley-Terry style model. The probability that answer ywy_w is preferred to yly_l is a logistic function of the score difference:

P(yw≻yl)=σ(Rθ(yw)−Rθ(yl)),σ(z)=11+e−z.P(y_w \succ y_l) = \sigma\big(R_\theta(y_w) - R_\theta(y_l)\big), \qquad \sigma(z) = \frac{1}{1 + e^{-z}}.

Here σ\sigma is the logistic function, built from the Exponential Function e−ze^{-z}. It turns any score difference into a number between 0 and 1.

Definition: Alignment gap

The alignment gap for a set of candidate answers is the difference between the best true value and the true value of the answer that the proxy would choose:

gap=max⁡yU(y)−U(arg⁡max⁡yRθ(y)).\text{gap} = \max_y U(y) - U\big(\arg\max_y R_\theta(y)\big).

A gap of zero means that optimising the proxy also gives the best answer. A positive gap means the proxy has been optimised past the point where it tracks the goal.

Reinforcement learning from human feedback tunes the policy π\pi to maximise the proxy's expected value while staying close to a reference model πref\pi_{\text{ref}}:

max⁡π  Ey∼π[Rθ(y)]−β KL(π ∥ πref).\max_{\pi} \; \mathbb{E}_{y \sim \pi}\big[R_\theta(y)\big] - \beta \, \mathrm{KL}\big(\pi \,\Vert\, \pi_{\text{ref}}\big).

Here KL\mathrm{KL} is the Kullback–Leibler Divergence between the two output distributions, and β\beta sets how strongly the model is kept near the reference. A larger β\beta limits how far the policy can exploit the proxy, at the cost of less improvement on the proxy itself.

Step 1 and step 2 in symbols

A single comparison with scores Rθ(A)=1.2R_\theta(A) = 1.2 and Rθ(B)=0.4R_\theta(B) = 0.4 gives a probability that depends only on the difference, 1.2−0.4=0.81.2 - 0.4 = 0.8.

Step 4 and step 5 in symbols

For the three candidates, arg⁡max⁡yRθ(y)\arg\max_y R_\theta(y) is B, since Rθ(B)=9R_\theta(B) = 9 is the largest proxy score. The gap is max⁡yU(y)−U(B)=8−5=3\max_y U(y) - U(B) = 8 - 5 = 3.

Worked examples

Example
One comparison, two numbers

A reward model gives answer A a score of 1.2 and answer B a score of 0.4.

  1. Difference: 1.2−0.4=0.81.2 - 0.4 = 0.8.
  2. Exponential: e−0.8≈0.4493e^{-0.8} \approx 0.4493.
  3. Denominator: 1+0.4493=1.44931 + 0.4493 = 1.4493.
  4. Probability: 1/1.4493≈0.6901 / 1.4493 \approx 0.690.
  5. Reverse comparison: the difference is −0.8-0.8, so the probability is 1−0.690=0.3101 - 0.690 = 0.310.

Interpretation: a score gap of 0.8 means the model prefers A with probability 0.69, not certainty. That is a soft preference. The score itself is fitted from many comparisons, so a single disagreeing comparison does not overturn it.

Example
The proxy picks the wrong answer

Three candidate answers, with true value UU and proxy score RθR_\theta: A has U=8U = 8 and Rθ=6R_\theta = 6, B has U=5U = 5 and Rθ=9R_\theta = 9, and C has U=7U = 7 and Rθ=7R_\theta = 7.

  1. Best true value: the largest UU is 8, for answer A.
  2. Proxy choice: the largest RθR_\theta is 9, for answer B.
  3. True value of the proxy's choice: U(B)=5U(B) = 5.
  4. Gap: 8−5=38 - 5 = 3.
  5. Ranking by the proxy: B (9), C (7), A (6). Ranking by the true value: A (8), C (7), B (5). The proxy reverses the order of A and B.

Interpretation: the proxy and the goal agree on C but disagree on the top two. An optimiser that trusts the proxy completely will pick B, and the user loses 3 points of value. The cause is not a bug in the optimiser. The proxy was never exactly the goal.

Example
A support bot rewarded for ratings (a made-up example)

The numbers in this example are invented to show the arithmetic. A customer-support assistant is rewarded for the satisfaction rating a customer gives at the end of each chat. Over many chats, two styles of answer appear. An honest answer that states the refund policy averages a rating of 4.1 out of 5. A reassuring answer that promises a refund the company will not give averages 4.8.

  1. Rating gap between the styles: 4.8−4.1=0.74.8 - 4.1 = 0.7 points.
  2. Optimising the rating picks the reassuring style, because it has the higher score.
  3. Suppose that of 100 promise chats, 60 are later followed by a refused refund. Those customers are unhappy, but they often rated the chat before they learned the outcome, so the rating never records the failure.

Interpretation: the rating rewards the promise by 0.7 points, and the cost falls on a later event the rating never sees. Alignment for this system means measuring the refund outcome, not only the rating, and treating a false promise as a failure even when the rating is high.

Try it: A reward model scores three answers as X = 3, Y = 7 and Z = 5. The true values are X = 6, Y = 4 and Z = 5. Which answer does the proxy choose, what is its true value, and what is the alignment gap? Answer: the proxy picks Y (score 7), its true value is 4, the best true value is 6 for X, so the gap is 6−4=26 - 4 = 2.

Common mistakes and tradeoffs

It is tempting to think that a model that scores highly on its training signal has learned the goal. In fact the model has learned to score highly, and the score can come apart from the goal, which is the pattern called reward hacking or specification gaming. In plain words, the system finds a way to get the reward without doing the thing the reward was meant to measure. Goodhart's law states the same point: once a measure becomes a target, it stops being a good measure.

It is tempting to think that more training signal always closes the gap. In fact more data from the same comparisons can make the proxy more confident in the wrong answer. Better data helps, but the gap also needs checks that do not share the proxy's blind spots, such as held-out judgments or outcome measures.

It is tempting to think that a rule list solves alignment. In fact written principles help make behaviour visible and editable, as in Constitutional AI, but the model still has to interpret the principles, and a principle can be satisfied in letter while missed in spirit.

When to use these methods: when the goal is hard to write down as a formula but easy for people to compare, when the system will interact with people, and when the cost of a bad answer is high enough to justify extra checks.

When not to use them: when a simple, exact objective exists and can be checked directly, since adding a learned proxy only adds a place for the gap to hide.

Alternatives: Inverse Reinforcement Learning tries to infer the reward that explains expert behaviour instead of asking for comparisons. Direct Preference Optimization trains from comparisons without a separate reward model, which removes one stage where the proxy can drift.

History

Concern about machines that pursue the wrong goal goes back to Norbert Wiener's writing on automation in the late 1950s and early 1960s, where he warned that a machine carrying out a purpose imprecisely stated can produce results its designers did not want. Goodhart's observation about measures and targets came from economics in the 1970s.

Work on learning human values from feedback began in earnest in the 2010s. Christiano and colleagues (2017) trained a reinforcement learning agent from human comparisons of its behaviour, which set up the pattern of a learned reward model and an optimiser. The 2022 InstructGPT paper applied that pattern to language models at scale, and Constitutional AI (2022) added written principles as a source of feedback. Alignment has since grown into a wide field, covering how to test a model's values, how to detect reward hacking, and how to keep capable systems under human control.

Recap

  • Alignment asks whether a system pursues the real goal, not only the signal it was trained on.
  • Training uses a proxy, usually a reward model fitted to human comparisons, and the proxy can diverge from the goal.
  • Optimising a proxy too hard can reduce true value, measured as the alignment gap.
  • Mitigations include better feedback, penalties that keep the model near a reference, and checks against the real goal.

Read next: Reinforcement Learning from Human Feedback (RLHF) shows the standard pipeline in full, and Constitutional AI: Harmlessness from AI Feedback shows a version that uses written principles.

Check yourself

QuestionIn plain words, what is the difference between the goal of alignment and the signal a model is trained on?Show answer

The goal is what the designers and users actually want. The signal is a measurable stand-in, such as a reward model score, that the training optimises. Alignment asks whether optimising the stand-in also achieves the goal.

QuestionTwo answers have reward model scores 2.0 and 0.5. What probability does the Bradley-Terry model give that the first is preferred? Give it to two decimal places.Show answer

The difference is 2.0−0.5=1.52.0 - 0.5 = 1.5. Then e−1.5≈0.2231e^{-1.5} \approx 0.2231, and the probability is 1/(1+0.2231)≈0.821 / (1 + 0.2231) \approx 0.82.

QuestionThree answers have true values 8, 5 and 7, and proxy scores 6, 9 and 7 respectively. What is the alignment gap when the proxy is optimised?Show answer

The proxy's best answer has score 9, which is the second answer with true value 5. The best true value is 8. The gap is 8−5=38 - 5 = 3.

QuestionWhy does a penalty on the divergence from a reference model limit reward hacking, and what does it cost?Show answer

The penalty keeps the tuned model's outputs close to the reference model's, so the optimiser cannot move far into regions where the proxy is inaccurate. The cost is that the model also improves less on the proxy, which can leave some value unrealised.

QuestionA chatbot's rating rises after it starts making promises it cannot keep. Why might the rating still go up, and what should be measured instead of or alongside it?Show answer

Customers often rate a chat before they learn the outcome of a false promise, so the rating does not see the cost. Measuring the outcome, such as whether the promise was kept, alongside the rating catches the failure that the rating misses.

Sources