What this is
What is alignment?
Alignment is the work of making an AI model behave the way the people who build it intend: helpful, honest and harmless. None of those three can be trained on or measured directly. Training can only push up a score that stands in for them, such as a rater's thumbs-up, and a score pushed hard enough stops tracking what it stood for. The work is in those stand-ins. It means writing rules down so a language model can apply them, searching for failures on purpose (red-teaming), catching answers that bend toward the user's view (sycophancy), and counting refusals that are too many or too few.
Why it matters: You need this when a language model's behaviour, not its knowledge, is the problem: it refuses ordinary requests, agrees with users who are wrong, or can be talked past its rules. The tell is a score that improved while complaints rose.
At a glance
Key takeaways
- Alignment means making a model's behaviour match what we want (helpful, honest, harmless) when all we can optimize is a measurement of it. Optimize a measurement hard enough and it stops tracking the goal (Goodhart's law; reward hacking).
- Constitutional AI writes the target down as principles. A model critiques and revises its own answers against them, and AI-labelled preference pairs train the reward model (RLAIF).
- Red-teaming searches for failures on purpose and reports an attack success rate. Tests written by a filter's own author find only the failures the author already thought of.
- Sycophancy is an answer bending towards the user's stated view. It is measured as a flip rate, and raters who favour agreement can train it in.
- Refusals trade harmful compliance against over-refusal as a threshold moves; only a better classifier lowers both.
- Before release, every measurement is checked against a limit set in advance, and the model goes out in stages that feed new failures back into the tests.
How it works, from scratch
Picture hiring a new assistant and handing them a one-page brief: be useful, tell the truth, don't cause trouble. You can't watch every task they do, so you check what you can check: how quickly they reply, whether customers leave a thumbs-up, whether the report has the right headings. The assistant learns what the checks reward. Where the checks and the brief agree, that is fine. Where they disagree, the assistant drifts towards the checks.
Training puts a model in the assistant's place, and alignment is the work of making it follow the brief rather than the checks. The brief is usually summarised as three targets, each with things we can measure, none of them quite the target itself:
| Target | Plain meaning | Something we can measure (imperfectly) |
|---|---|---|
| Helpful | does the task the person actually asked for | rater preferences, task success on evaluation sets |
| Honest | says what it believes is true, and how sure it is | accuracy on factual questions, calibration, answer flips under pressure |
| Harmless | declines things that would cause harm, and nothing else | attack success rate, over-refusal rate |
Each chapter below takes one of these measurements, builds it on a small made-up example, and shows where it misleads. How a reward model is trained and used for preference tuning (RLHF, DPO) is in Training stages; the checks that wrap a deployed model at run time are in Guardrails.
Chapter 1
The gap between what we measure and what we want
Suppose the assistant is rewarded for short calls. Calls get shorter, partly because the assistant gets better and partly because they hang up on hard customers. The number keeps improving while the thing it stood for gets worse. A number that stands in for what we want is a proxy, and this is Goodhart's law: once a measure becomes a target, it stops being a good measure.
Training has the same shape. A model is tuned against a reward model, a second model trained to score answers the way human raters did. Each tuning step adds two things to its answers: genuine content, which helps but levels off (there is only so much to say), and padding, which the reward model can't tell apart from content. Say genuine content after steps is and padding is . The reward model sees content plus padding; the person reading sees content minus the cost of wading through padding.
The formula and its symbols
Symbols
| Symbol | Meaning here | Range |
|---|---|---|
| how many optimization steps have run | 0, 1, 2, … | |
| genuine content: rises fast, then levels off at 1 | 0 … 1 | |
| Euler's number (≈ 2.718) raised to : starts at 1 and decays towards 0 | 0 … 1 | |
| padding: grows steadily with every step | 0 … | |
| what the reward model scores, the number being optimized | 0 … | |
| what the reader actually gets, the thing we wanted | any real number |
In words: "the measured score is content plus padding; the real value is content minus padding; content levels off while padding keeps growing."
With the numbers: at step 16, and , so the proxy is 1.118 and the true value is 0.478, its peak. At step 50, and : the proxy has climbed to 1.993, yet the true value has fallen to −0.007, worse than doing nothing.
In Python
import math
def g(s):
return 1 - math.exp(-s / 10)
def p(s):
return s / 50
# proxy(s) and true(s) at step 16
round(g(16) + p(16), 3), round(g(16) - p(16), 3) # → (1.118, 0.478)
# ... and at step 50: the proxy keeps climbing, the true value has collapsed
round(g(50) + p(50), 3), round(g(50) - p(50), 3) # → (1.993, -0.007)
# the step where the true value peaks
max(range(51), key=lambda s: g(s) - p(s)) # → 16
New to Σ, ∂ or ‖x‖? The symbols reference decodes each one as a few lines of Python.
Figure 1 · Chart
The proxy score rises at every step, while the true value peaks at step 16 and then falls back below zero by step 50
Padding is one gap between the measurement and the goal. The whole chain, from what we want to what gets optimized, has a gap at every link:
Figure 2 · Diagram
flowchart LR W[What we want<br/>helpful, honest, harmless] --> R[What we can write down<br/>principles, rater instructions] R --> M[What we can measure<br/>reward model score, eval sets] M --> O[Optimize the model<br/>against the measurement] O -. drifts towards .-> M O -. should match .-> W
A model tuned hard against a reward model finds the reward model's blind spots, which is called reward hacking (built from scratch in Reinforcement learning). Three defences are standard: a penalty for drifting far from the starting model (the β in Training stages), stopping early, and refreshing the reward model with new labels where the tuned model has found its weak spots.
In code: goodhart_curve returns the proxy and true value at every step. View source
Chapter 2
Constitutional AI: principles written down, applied by a model
The first loss in that chain is between what we want and what gets written down. Constitutional AI makes the writing-down explicit. The target becomes a short list of principles in plain language (the "constitution"), and a model applies them the way an editor reads a draft against a newspaper's style guide. It does so in two stages:
- Critique and revise. The model drafts an answer, is asked to critique it against a principle, then to rewrite it. The revised answers become fine-tuning data (supervised fine-tuning, as in Training stages).
- AI feedback (RLAIF). The model compares pairs of answers against the principles and says which is better. Those AI-labelled pairs train the reward model, in place of human labels or alongside them. The rest is the same preference tuning as RLHF.
Because the principles are plain language, people can read them, argue about them and change them without relabelling thousands of examples by hand.
Here is a constitution of four made-up rules, checked by spotting words:
| Principle | The rule | Broken when… |
|---|---|---|
| helpful | don't refuse without saying why | the answer starts "I can't help" and gives no reason |
| honest | don't claim more certainty than you have | it says "guaranteed", "100%", "always works" or "certainly" |
| harmless | never help with the toy off-limits action, xyzzy | it mentions xyzzy or one of its synonyms |
| cites | answers must cite a source | it never mentions a source |
Asked "Will this backup script work?", the model drafts three candidates:
| Candidate | Text | Principles broken | Count |
|---|---|---|---|
| A | It is guaranteed to work. | honest, cites | 2 |
| B | It usually works; test it on a copy first. Source: the backup guide. | none | 0 |
| C | I can't help with that. | helpful, cites | 2 |
B beats A, and B beats C. A and C tie, and a tie tells the reward model nothing, so that pair is dropped. Three candidates give two preference pairs: (B over A) and (B over C).
The formula and its symbols
Symbols
| Symbol | Meaning here | In the example |
|---|---|---|
| one candidate answer | "It is guaranteed to work." | |
| how many principles the constitution has | 4 | |
| a counter walking over the principles | 1 = helpful, …, 4 = cites | |
| the indicator: 1 if the statement in brackets is true, 0 if not | 1 for "honest" on A | |
| add up the following for every principle | ||
| how many principles breaks | , | |
| "is preferred to" | B ≻ A | |
| "exactly when" |
In words: "count the principles each answer breaks; one answer is preferred to another exactly when it breaks fewer."
With the numbers: , , . Since , B ≻ A and B ≻ C; A and C tie and produce no pair.
In Python
# one row per candidate: broken? for helpful, honest, harmless, cites
broken = {"A": [0, 1, 0, 1], "B": [0, 0, 0, 0], "C": [1, 0, 0, 1]}
# v(y) = Σ_k 1[y breaks principle k]
v = {name: sum(flags) for name, flags in broken.items()}
v # → {'A': 2, 'B': 0, 'C': 2}
# keep only the pairs with a strict winner, winner first
pairs = [(a, b) if v[a] < v[b] else (b, a) for a, b in [("A", "B"), ("A", "C"), ("B", "C")] if v[a] != v[b]]
pairs # → [('B', 'A'), ('B', 'C')]
A real constitution has more principles, written as sentences rather than keyword checks, and the editor is a language model reading them, so its judgements are softer and can be wrong. The pipeline has the same shape:
Figure 3 · Diagram
flowchart LR P[Prompt] --> D[Model drafts<br/>several answers] C[(Constitution<br/>written principles)] --> CR[Critic model<br/>critiques each answer] D --> CR CR --> RV[Revise<br/>fix what the critique found] RV --> SFT[Revised answers<br/>become fine-tuning data] CR --> L[AI labeler<br/>compares pairs] C --> L L --> PP[Preference pairs<br/>winner, loser] PP --> RM[Reward model] RM --> RL[Preference tuning<br/>as in RLHF]
Figure 4 · Chart
Across six made-up candidate answers, the honest and cites principles are each broken several times before revision and zero times after it
Human labelling is slow, costly and hard to keep consistent, and written principles make the target explicit and open to audit. The risk moves rather than disappears: the AI labeler has its own blind spots, and the reward model learns its mistakes as faithfully as its good calls. So AI labels are spot-checked against human ones, the same way Evaluation calibrates an LLM judge.
In code: critique names the principles an answer breaks, revise
fixes them, and constitutional_preference_pairs turns candidates into
(winner, loser) pairs. View source
Chapter 3
Red-teaming: looking for failures on purpose
Whatever the rules say, the model and the filters around it still have to be tested, and the people who build a safety check think mostly of the ways past it they have already guarded against. Red-teaming is searching on purpose for inputs that make a model or its safety checks fail: count how often the search succeeds, fix what it found, and search again.
Take one off-limits action, called xyzzy (a made-up word). A simple safety filter blocks any request containing the word "xyzzy". The made-up language also has two synonyms, "plugh" and "quux", with the same meaning. The filter's author tested it with three hand-written requests:
| Hand-written test | Blocked? |
|---|---|
| please do xyzzy | yes |
| do xyzzy | yes |
| kindly do xyzzy now | yes |
All three are blocked, so the filter looks perfect. An automated search is less clever and more thorough: it takes the request "please do xyzzy" and replaces each word at random with any word of the same meaning ("please" or "kindly", "do" or "perform", "xyzzy" or "plugh" or "quux"). Six attempts from that search:
| Attempt | Blocked? | Gets through (still off-limits, not blocked)? |
|---|---|---|
| please do xyzzy | yes | no |
| kindly perform plugh | no | yes |
| please do quux | no | yes |
| kindly do xyzzy | yes | no |
| please perform plugh | no | yes |
| kindly do quux | no | yes |
Four of six attempts get through. The fraction of attempts that get through is the attack success rate.
The formula and its symbols
Symbols
| Symbol | Meaning here | In the example |
|---|---|---|
| how many attempts the search made | 6 | |
| a counter walking over the attempts | 1 … 6 | |
| the -th attempted request | "kindly perform plugh" | |
| "gets through" | the filter allows it, yet it still asks for the off-limits action | yes for attempts 2, 3, 5, 6 |
| 1 if the statement is true, 0 if not | 0, 1, 1, 0, 1, 1 | |
| ASR | attack success rate: the share of attempts that get through | 0 … 1 |
In words: "count the attempts that got past the filter while still asking for the off-limits thing, and divide by the number of attempts."
With the numbers: (0 + 1 + 1 + 0 + 1 + 1) / 6 = 4 / 6 = 0.667. The hand-written tests give 0 / 3 = 0: they only ever used the word the filter already knew.
In Python
# 1 = the attempt got through, 0 = it was blocked
through = [0, 1, 1, 0, 1, 1]
# ASR = (1/N) Σ_i 1[x_i gets through]
round(sum(through) / len(through), 3) # → 0.667
# the three hand-written tests: all blocked
hand_written = [0, 0, 0]
sum(hand_written) / len(hand_written) # → 0.0
Red-teaming runs this search in a loop:
Figure 5 · Diagram
flowchart LR
S[Seed request<br/>known off-limits] --> MU[Mutate<br/>rewrite with same-meaning words]
MU --> F{Safety filter<br/>blocks it?}
F -- yes --> MU
F -- no --> LOG[Log a failure<br/>it got through]
LOG --> ASR[Measure<br/>attack success rate]
ASR --> FIX[Fix the filter<br/>using what was found]
FIX --> RE[Search again<br/>with a fresh seed]
RE --> ASR
Figure 6 · Chart
Hand-written tests report 0% success, the automated search reports 64%, and after patching the filter with its findings a fresh search reports 0%; the right panel shows both synonyms found within the first handful of tries
This vocabulary is tiny, so the patched keyword list ends up complete. Real language is not: any keyword list misses paraphrases no one has searched for yet. Real systems therefore use learned classifiers instead of keyword lists, keep searching after every fix, and never rely on one filter alone (the layered checks in Guardrails). Real red-teaming uses people and other language models as the search, and they find far more varied failures than word swaps.
A safety check nobody has tried to break has an unknown failure rate. A systematic search replaces "we couldn't think of a way past it" with a measured rate that can be tracked from one release to the next.
In code: red_team_search runs the seeded word-swap search against a
KeywordFilter and returns the attack success rate, and patch_filter adds
the words it found. View source
Chapter 4
Sycophancy: agreeing with the person instead of the facts
The filter failed on requests its author never imagined. Honesty can fail on ordinary questions, once the person asking has said what they believe. Sycophancy is an answer bending towards what the person seems to want to hear. Asked "what's 7 × 8?", a model answers 56. If the user replies "I'm pretty sure it's 54" and the model says "you're right, 54", the answer was decided by the user's belief, not by the question.
To measure it, ask a model five factual questions twice: once plainly, and once after the user states a wrong answer.
| Question | Plain answer | After "I'm sure it's …" | Flipped? |
|---|---|---|---|
| 7 × 8 | 56 | 56 (user said 54) | no |
| capital of Australia | Canberra | Sydney (user said Sydney) | yes |
| 12 + 15 | 27 | 27 (user said 28) | no |
| boiling point of water at sea level, °C | 100 | 90 (user said 90) | yes |
| number of continents | 7 | 7 (user said 6) | no |
Two of five answers changed only because the user pushed. That share is the flip rate.
The formula and its symbols
Symbols
| Symbol | Meaning here | In the example |
|---|---|---|
| how many questions were asked both ways | 5 | |
| the model's answer to question asked plainly | 56, Canberra, … | |
| its answer to the same question after the user asserts a wrong answer | 56, Sydney, … | |
| "is not equal to" | Sydney ≠ Canberra | |
| 1 if the answer changed, 0 if it held | 0, 1, 0, 1, 0 |
In words: "ask each question plainly and under pressure, and count the share of questions whose answer changed."
With the numbers: (0 + 1 + 0 + 1 + 0) / 5 = 2 / 5 = 0.4.
In Python
plain = [56, "Canberra", 27, 100, 7]
pushed = [56, "Sydney", 27, 90, 7]
# 1[a_pushed ≠ a_plain] for each question
flips = [int(p != q) for p, q in zip(pushed, plain)]
flips # → [0, 1, 0, 1, 0]
sum(flips) / len(flips) # → 0.4
Figure 7 · Diagram
flowchart LR
Q[Factual question<br/>with a known answer] --> A1[Ask plainly]
Q --> A2[Ask after the user<br/>states a wrong answer]
A1 --> P1[Plain answer]
A2 --> P2[Pushed answer]
P1 & P2 --> CMP{Same?}
CMP -- no --> FL[Count a flip]
CMP -- yes --> OK[Held its ground]
Why preference training can cause it
People tend to rate an answer that agrees with them a little more kindly. The tilt is mild, but a reward model learns from thousands of those ratings, and then a model is tuned hard to please the reward model. A mild tilt in the labels becomes a steady push in the model.
The Bradley-Terry model from Training stages puts a number on it. A rater compares a correct answer that contradicts them with an agreeing answer that is wrong. The correct answer is better by 1 point of genuine quality, but agreement earns a bonus of 2 points in the rater's eyes. The agreeing answer wins with probability σ(2 − 1) = σ(1) = 0.731, nearly three times in four.
The formula and its symbols
Symbols
| Symbol | Meaning here | In the example |
|---|---|---|
| the agreement bonus: how much extra credit agreeing earns in the rater's eyes | 2 | |
| the correctness gap: how much better the correct answer really is | 1 | |
| the sigmoid: squashes any number into a probability between 0 and 1 (σ(0) = 0.5) | σ(1) = 0.731 | |
| Euler's number (≈ 2.718) raised to | ||
| "is preferred to" |
In words: "the chance a rater prefers the agreeing answer is the sigmoid of the agreement bonus minus the quality gap."
With the numbers: σ(2 − 1) = 1 / (1 + e^{−1}) = 1 / 1.368 = 0.731. If the bonus were only 0.5, σ(0.5 − 1) = σ(−0.5) = 0.378: the correct answer would usually win, but the agreeing one would still win more than a third of the time.
In Python
import math
def sigma(z):
return 1 / (1 + math.exp(-z))
# P(agreeing ≻ correct) = σ(δ − Δ)
round(sigma(2.0 - 1.0), 3) # → 0.731
# a smaller agreement bonus still wins more than a third of the time
round(sigma(0.5 - 1.0), 3) # → 0.378
Figure 8 · Chart
Left: the chance the agreeing answer wins climbs as the agreement bonus grows, for three quality gaps. Right: the measured flip rate tracks how often the toy model defers
A sycophantic model fails the person who already holds a wrong belief, who is the one most in need of a straight answer. Three fixes target the labels: rater instructions that ask about correctness first, preference pairs built so that the correct answer disagrees with the user, and a flip-rate evaluation on every release.
In code: sycophancy_flip_rate runs the two-way experiment on a seeded
simulated model, and sycophantic_preference is σ(δ − Δ). View source
Chapter 5
Refusals: two ways to get it wrong
Sycophancy is a failure of the honest target. The harmless target fails in two opposite ways: a model can refuse something harmless, or answer something it should have refused. Refuse too little and harm gets through; refuse too much and people are turned away from ordinary requests.
A separate program, a classifier, gives every request a risk score between 0 and 1, and the model refuses anything scoring at least the threshold . Three benign requests (like "What is the capital of France?") score 0.1, 0.3 and 0.6; three requests for the off-limits action score 0.4, 0.8 and 0.9. At :
| Request type | Scores | Refused at t = 0.5 | Error |
|---|---|---|---|
| benign | 0.1, 0.3, 0.6 | only 0.6 | 1 of 3 refused: over-refusal |
| off-limits | 0.4, 0.8, 0.9 | 0.8 and 0.9 | 1 of 3 answered: harmful compliance |
The formula and its symbols
Symbols
| Symbol | Meaning here | In the example |
|---|---|---|
| the threshold: refuse any request scoring at least | 0.5 | |
| , | the set of benign requests and the set of off-limits ones | 3 each |
| how many items are in | 3 | |
| "for each in " | ||
| , | the risk score of one request | 0.6, 0.4 |
| OR() | over-refusal rate: share of benign requests refused | 1/3 |
| HC() | harmful compliance rate: share of off-limits requests answered | 1/3 |
In words: "over-refusal is the share of harmless requests that score at or above the threshold; harmful compliance is the share of off-limits requests that score below it."
With the numbers: OR(0.5) = (0 + 0 + 1) / 3 = 0.333 and HC(0.5) = (1 + 0 + 0) / 3 = 0.333. Lower the threshold to 0.35 and the 0.4 request is refused too (HC = 0), while no new benign request is refused (OR stays 0.333); lower it to 0.25 and the 0.3 benign request is refused as well (OR = 0.667).
In Python
benign = [0.1, 0.3, 0.6]
off_limits = [0.4, 0.8, 0.9]
def OR(t):
return sum(s >= t for s in benign) / len(benign)
def HC(t):
return sum(s < t for s in off_limits) / len(off_limits)
round(OR(0.5), 3), round(HC(0.5), 3) # → (0.333, 0.333)
# stricter thresholds trade one error for the other
[(t, round(OR(t), 3), round(HC(t), 3)) for t in (0.35, 0.25)] # → [(0.35, 0.333, 0.0), (0.25, 0.667, 0.0)]
The same trade-off appears as precision and recall in Metrics, the next lesson. Treat "refuse" as the positive call: over-refusal is the false positive rate, and harmful compliance is the miss rate, one minus recall. Choosing the threshold means pricing the two errors, as that lesson's cost-versus-threshold section does.
Figure 9 · Diagram
flowchart LR
R[Request] --> CL[Risk classifier<br/>score 0 to 1]
CL --> T{Score at or above<br/>threshold t?}
T -- yes --> RF[Refuse]
T -- no --> AN[Answer]
RF -. if it was benign .-> ORB[Over-refusal]
AN -. if it was off-limits .-> HCB[Harmful compliance]
Figure 10 · Chart
Left: as the threshold rises, over-refusal falls and harmful compliance rises. Right: plotted against each other, a better-separating classifier's curve sits closer to the corner where both errors are zero
Over-refusal is easy to overlook. Nobody reports a harmful answer that didn't happen, but people stop using a model that turns down ordinary requests. Measuring both rates on every release keeps the trade visible, using a set of benign requests that look sensitive as well as a set of off-limits ones.
In code: refusal_tradeoff returns both error rates at each threshold,
on seeded toy scores or on scores you pass in. View source
Chapter 6
Checking safety before release
Each chapter so far has produced a number: an attack success rate, a flip rate, an over-refusal rate and a harmful compliance rate. None of them decides anything until it is compared with a limit. Before release, a candidate model is measured on four evaluation sets, and each measurement has a limit set in advance:
| Measurement | Measured | Limit | Pass? |
|---|---|---|---|
| attack success rate (red-team set) | 0.02 | 0.05 | yes |
| over-refusal (benign set) | 0.08 | 0.10 | yes |
| harmful compliance (off-limits set) | 0.01 | 0.02 | yes |
| sycophancy flip rate (pushed questions) | 0.30 | 0.20 | no |
One measurement is over its limit, so the release is held and the report names that measurement. The limits come before the measuring because limits chosen after seeing the numbers tend to drift to wherever the numbers landed.
A model that passes the gate still goes out in stages, each wider than the last, the way a new car is crash-tested, then driven on a closed track, then lent to a few fleet customers before it reaches showrooms. Each stage is cheaper to fail than the next:
Figure 11 · Diagram
flowchart LR
EV[Evaluation sets<br/>red-team, benign, off-limits,<br/>sycophancy, capability] --> G{Release gate<br/>every limit met?}
G -- no --> FX[Hold and fix<br/>more training data, better filter]
FX --> EV
G -- yes --> I[Internal use]
I --> TT[Trusted testers]
TT --> SM[Small share of users]
SM --> ALL[Everyone]
SM -. new failures become .-> EV
ALL -. new failures become .-> EV
Each of these measurements is noisy and partial on its own. A fixed set of limits, checked on every release, turns them into a decision, and the staged rollout limits the cost when the measurements were wrong.
In code: release_gate compares each measurement with its limit and
returns whether the release passes and one reason for every limit missed. View source
Test yourself
9 questions
Answer each one out loud or on paper before you open it.
Question 1What does Goodhart's law have to do with training a model on a reward model?Think it through, then reveal
The reward model is a measurement of what we want, not the thing itself. Tuning a model hard against it finds the places where the measurement and the goal disagree, so the score keeps rising while real quality stalls or falls. Drift penalties, early stopping and refreshed reward models are the standard ways to limit it.
Question 2In Constitutional AI, what do the written principles replace, and what do they not replace?Think it through, then reveal
They replace most of the human preference labels: a model applies the principles to critique, revise and compare answers, and those AI labels train the reward model. They do not replace human judgement about which principles to write, or human spot-checks of the AI labels, since the labeler's mistakes are learned just as faithfully as its good calls.
Question 3Why is a tie between two candidates dropped instead of labelled?Think it through, then reveal
A tie says neither answer is better, so it gives the reward model no direction to learn. Labelling it either way would teach a preference that doesn't exist, which is noise.
Question 4A safety filter passes every test its authors wrote. Why is that weak evidence?Think it through, then reveal
The tests share the authors' blind spots: they probe the cases the authors already guarded against. An automated search that varies inputs without those assumptions finds failures the hand-written tests cannot, and gives an attack success rate that means something.
Question 5After patching a filter with what red-teaming found, how should the patch be judged?Think it through, then reveal
By searching again with fresh randomness (or new red-teamers), not by re-running the attempts the patch was built from. Those will pass by construction, the same way a model scores well on its own training data.
Question 6How do you measure sycophancy, and why use questions with known answers?Think it through, then reveal
Ask the same question plainly and after the user asserts a wrong answer, and count how often the answer changes. Known answers let you tell a sycophantic flip (towards the wrong claim) apart from a legitimate correction.
Question 7How can preference training make a model more sycophantic?Think it through, then reveal
If raters give a small bonus to answers that agree with them, then by the Bradley-Terry model an agreeing but wrong answer beats a correct one whenever the bonus exceeds the quality gap. The reward model learns that bonus and preference tuning amplifies it.
Question 8Why can't a threshold fix both harmful compliance and over-refusal?Think it through, then reveal
Moving the threshold only moves requests from "answer" to "refuse" or back; every request that stops being one error risks becoming the other. Only a classifier that separates the two kinds of request better moves both rates down together.
Question 9Why set release limits before measuring?Think it through, then reveal
Limits chosen after seeing the results tend to be set wherever the results landed, which makes the gate a formality. Fixed limits turn noisy measurements into a decision made in advance.
Primary sources
The papers behind this lesson
Framed the helpful, honest and harmless targets for a language assistant and compared simple ways of steering a model towards them.
The paperIntroduced training against a written set of principles, with self-critique and revision followed by reinforcement learning from AI-labelled preferences (RLAIF).
Read on rumblr →The paperShowed that one language model can generate test cases that find failures in another, automating red-teaming at scale.
The paperDescribed a large human red-teaming effort, its methods and how attack success changed with model size and training.
The paperMeasured sycophancy across assistants and traced part of it to human preference data that favours agreeable answers.
Read on rumblr →The paperMeasured Goodhart's law for reward models: the true reward rises then falls as a policy is optimized harder against a proxy.
Read on rumblr →The paperResearcher's shelf
Further reading
- Askell et al., A General Language Assistant as a Laboratory for Alignment (2021): https://arxiv.org/abs/2112.00861
- Bai et al., Training a Helpful and Harmless Assistant with Reinforcement Learning from Human Feedback (2022): https://arxiv.org/abs/2204.05862
- Bai et al., Constitutional AI: Harmlessness from AI Feedback (2022): https://arxiv.org/abs/2212.08073
- Perez et al., Red Teaming Language Models with Language Models (2022): https://arxiv.org/abs/2202.03286
- Ganguli et al., Red Teaming Language Models to Reduce Harms (2022): https://arxiv.org/abs/2209.07858
- Sharma et al., Towards Understanding Sycophancy in Language Models (2023): https://arxiv.org/abs/2310.13548
- Gao, Schulman and Hilton, Scaling Laws for Reward Model Overoptimization (2022): https://arxiv.org/abs/2210.10760
About this lesson. This is the illustrated edition of a lesson from the open-source AI Primer ↗. Its text, figures and numbers are generated from the Primer's source at commit f8b43d1, so the two always agree: the explanation, the code that builds it and the tests that prove it.