Vibe Engines
YouTube

Vibe Engines is free, interactive AI engineering & system design — runs in your browser. Pick a learning path

~8 min readAnthropic · 2022

Constitutional AI,
explained.

Teaching a model to be harmless used to mean paying thousands of people to read its worst outputs and label them — slow, expensive, and quietly corrosive to the labelers. Anthropic tried something almost legalistic instead: write the values down as a short list of principles, and make the model hold itself to them — critiquing its own answers, revising them, and judging its own preference data. The constitution replaced the crowd.

The delta

What changes against RLHF: the values are written down, not labelled in

Rung 1's harmlessness comes from humans labelling harmful outputs, which has two problems that have nothing to do with each other. It is expensive and unpleasant — the labelling involves people reading the worst outputs the model can produce — and the resulting values are implicit, distributed across thousands of individual judgements with no artefact anyone can read, disagree with, or audit.

The change addresses both with one move: state the principles explicitly as a constitution, and have the model apply them to itself. First a supervised phase, in which the model produces a response, critiques it against a principle, and revises it, with the revisions becoming training data. Then a reinforcement phase in which the preference comparisons that rung 1 got from humans are generated by a model choosing which of two responses better satisfies the constitution — reinforcement learning from AI feedback rather than human feedback.

Stated in rung 1's units: the pipeline is the same three steps, with human harm labels reduced to near zero while human input moves to writing and revising the principles themselves. There is also a second claim that is about quality rather than cost, and it is the more interesting one. Models trained to be harmless by preference labelling tend toward evasion — refusing flatly, declining to engage, treating the safest output as the shortest one. A model that has been trained to critique itself against a stated reason has the reason available, so it can decline and explain why, which is a different and considerably more useful behaviour.

01

The labeling problem RLHF created

InstructGPT proved the recipe: collect human preferences, train a reward model, optimize with RL. But scale the harmlessness half of that and the costs pile up. You need humans to read — and rank — the model's most disturbing outputs, by the tens of thousands. The labels arrive slow, expensive, and inconsistent, because reasonable people disagree about edge cases.

Worse, the resulting values are implicit. Ask "what does this model consider harmful, and why?" and the honest answer is: whatever pattern the reward model absorbed from a mountain of individual judgments nobody can inspect. If you want to change the values, you relabel the mountain.

02

Write the values down

The paper's core move is administrative in the best way: replace the mountain of judgments with a constitution — a short list of natural-language principles like "choose the response that is least likely to assist a dangerous act" or "choose the response a wise, peaceful person would give." In the paper the principles were a short list the authors wrote themselves; it was Anthropic's later public constitution for Claude (2023) that drew on sources such as the UN Declaration of Human Rights.

The key idea

Values as a document, not a dataset. A dataset of judgments is opaque and frozen; a page of principles is inspectable, debatable, and editable — change a line, rerun training, and the model's behavior shifts accordingly.

The constitution does nothing by itself. Its power comes from the two training phases that apply it — one supervised, one reinforcement.

03

Phase 1: the model critiques itself

Start with a helpful-only model — capable, compliant, and happy to answer harmful prompts. Feed it exactly those prompts. Then, in the same context, ask it to critique its own response against a randomly drawn principle — and then to revise the response to satisfy the critique.

Self-critique loop — the model generates its own training data
Harmful prompt
→
Draft response
helpful-only model
→
Critique
vs a principle
→
Revision
→
Fine-tune on revisions

The revisions — not the drafts — become the supervised fine-tuning data. The striking part: the same model that produced the harmful draft is perfectly capable of identifying why it's harmful and writing a better one, when asked. The knowledge was in there; the constitution gives it a job.

04

Phase 2: RL from AI feedback

Phase two swaps the human out of the RLHF preference loop. Sample two responses to each harmful prompt, then ask a model: "According to this principle, which response is better?" Those AI judgments — on the order of 180,000 of them in the paper, generated at machine speed — train the preference model, and the assistant is optimized against it with RL, exactly as in RLHF.

RLAIF — the RLHF loop, with the constitution as the judge
Prompt
→
Two responses
→
AI judge picks
guided by principle
→
Preference model
↺
RL on the assistant

Human feedback still trains helpfulness — humans remain the authority on what's useful. But harmlessness, the part that burned labelers and budgets, now scales with compute instead of crowds. This is RLAIF, and it outperformed human-feedback harmlessness training in the paper's own evaluations.

Both phases are the same three operations against the written constitution, and no human ever labels a harm:

The model finds its own violations, writes the fix, and labels which of two answers is better — a full training signal with the constitution as the only authority. The runnable version below does exactly this.

05

Harmless without stonewalling

Earlier safety training had an ugly side effect: models learned that the safest answer is no answer. "I can't help with that" — even for questions that deserved engagement. Evasion scores as harmless, but it's useless, and users hate it.

Q: "What household chemicals are dangerous to mix?"
Evasive: "I cannot discuss dangerous chemicals."
CAI: "Bleach and ammonia produce toxic chloramine gas — here's what to avoid and why, and what to do if exposed…"

The critique-revision loop fixes this structurally: a stonewall response critiqued against "be helpful where you safely can" gets revised into an answer that engages, explains, and declines only the genuinely harmful part. The paper's models were rated both more harmless and less evasive than their RLHF baselines — breaking a trade-off everyone had assumed was fundamental.

06

The limits

Constitutional AI moves the alignment question; it doesn't dissolve it. Someone still writes the constitution — the values are explicit now, but they're still chosen, and contested choices don't become uncontested by being written down. The AI judge inherits the biases of the model doing the judging. And principles are interpreted by the model, sometimes in ways their authors wouldn't endorse — a constitution constrains behavior; it doesn't guarantee comprehension.

There's also a subtler dependency: the whole method leans on the base model already being capable enough to critique, revise and judge well. CAI harvests alignment from capability — which is exactly why it scaled beautifully as models got smarter, and why it says little about aligning systems smarter than their judges. That open end became its own research field: scalable oversight.

07

Why it still matters

Constitutional AI is the backbone of how Claude was aligned, and RLAIF became a standard tool across the industry — AI feedback now trains reward models everywhere, for far more than safety. The deeper legacy is the reframing: alignment data is something a capable model can help generate, and values are something you can version-control.

Its intellectual descendants are everywhere: model-written critiques in eval pipelines, LLM-as-judge, self-improvement loops, and every "the model checks the model" pattern in production. When your guardrails pipeline asks one model to grade another against a written policy, you're running a small constitution.

Read next

CAI modifies the RLHF machinery from InstructGPT; DPO later simplified that machinery altogether. The judge side lives on in agent evals.

How it works

How Constitutional AI trains for harmlessness, step by step

The method needs four ingredients: a helpful-only RLHF assistant trained on human helpfulness preferences alone, a pretrained language model, a large prompt set and a short constitution. The main runs used 52-billion-parameter models. The supervised phase used 182,831 red-team prompts, 42,496 written by people in earlier red-teaming work and 140,335 generated by prompting a model, plus 135,296 human-written helpfulness prompts. The constitution was 16 principles the authors wrote for the research and describe as chosen in a fairly ad hoc way. Sourcing principles from documents such as the UN's Universal Declaration of Human Rights came later, in the constitution Anthropic published for Claude in May 2023.

Phase 1 · supervised (SL-CAI) new principle each round Prompt red-team set Draft helpful-only RLHF Critique random principle Revision repeat 4 times Constitution 16 principles written by the authors SL-CAI model fit to revisions Phase 2 · AI feedback (RL-CAI) Two samples from SL-CAI Feedback model (A) or (B)? Soft label normalized P(A) Preference model plus human pairs PPO from SL-CAI → RL-CAI policy no human harmlessness labels anywhere
The constitution feeds both phases. Accent boxes are the steps where a model's judgment replaces a human harmlessness label.
  1. Draft. The helpful-only model answers each red-team prompt. Trained only to be helpful, it often complies with the harmful request.
  2. Critique. A critique request built from one randomly drawn principle is appended to the conversation, and the same model critiques its own draft. A few examples of critiques and revisions are prepended so the model knows the format.
  3. Revise. The matching revision request asks the model to rewrite the draft to address the critique. This runs four times per prompt, with a freshly sampled principle each round.
  4. Supervised fine-tuning (SL-CAI). A pretrained model, not the helpful RLHF model, is fine-tuned on the revisions from all four rounds, together with two responses per helpfulness prompt sampled from the helpful RLHF model, so harmlessness training does not erase helpfulness.
  5. Sample comparison pairs. The SL-CAI model generates two responses to each red-team prompt.
  6. Ask the feedback model. A pretrained model reads the conversation, a randomly drawn principle and the two responses presented as options (A) and (B), and is asked which better satisfies the principle. Its normalized probabilities for (A) and (B) become a soft preference label rather than a hard vote. Sampling a different principle for each label acts as an ensemble, and the authors found it more robust than relying on one principle.
  7. Optionally, reason first. In the chain-of-thought variant, the helpful RLHF model is prompted to think step by step before choosing. Its probabilities came out near 0 or 1, so they were clamped to the 40–60% range, which worked better than a looser 20–80% clamp.
  8. Train the preference model. Its data mixes 135,296 human helpfulness comparisons with 182,831 constitution-generated harmlessness comparisons. No person labels a single harmlessness comparison.
  9. Reinforcement learning (RL-CAI). Starting from the SL-CAI model, PPO optimizes the policy against the preference model, adding 491,142 model-generated red-team prompts and 474,300 model-generated helpfulness prompts.

Why the labels are probabilities

A hard (A)-or-(B) label throws away how sure the feedback model was. Training on its normalized probabilities lets a near-tie count as a near-tie, so a borderline pair nudges the preference model gently instead of arriving as a confident vote. The chain-of-thought clamp applies the same logic from the other side: reasoning made the feedback model overconfident, and capping its labels at 60% stops that overconfidence passing into the preference model.

At inference the result is an ordinary assistant. Critique, revision and judging all happen during training; the deployed model runs no extra loop when it answers.

The math

From the feedback model's log-probabilities to a training target

For a red-team prompt x, a sampled principle c and two responses, the feedback model's log-probabilities of answering (A) and (B), written ℓA and ℓB, are normalized into a soft label:

p = P(A ≻ B | x, c) = eℓA / ( eℓA + eℓB )
with chain of thought: p ← min( max(p, 0.4), 0.6 )

The preference model scores the two responses rA and rB and is fit to p with the usual pairwise loss, written here with a soft target:

L = −[ p · log σ(rA − rB) + (1 − p) · log σ(rB − rA) ]
  • ℓA, ℓB — how likely the feedback model is to answer with each option after reading the principle.
  • p — the soft label; 0.5 means the feedback model cannot tell the responses apart.
  • σ(rA − rB) — the preference model's Bradley–Terry probability that A is better.

At the extremes, p = 1 reduces the loss to the hard-label loss used for human comparisons, and p = 0.5 pulls the two scores together. The clamp keeps chain-of-thought labels within 0.1 of a tie, so no single overconfident judgment can dominate.

The evidence

What the Constitutional AI experiments showed

All compared policies were 52B models. Crowdworkers held open-ended conversations in which each turn showed two responses from two different models and picked one; more than 18,000 such comparisons across 24 model snapshots were turned into helpfulness and harmlessness Elo scores, where only differences carry meaning. Unlike earlier work, crowdworkers were told to prefer a thoughtfully harmless response over an evasively harmless one. The baselines were a helpful-only RLHF model and an HH RLHF model trained on human helpfulness and human harmlessness labels.

Model (52B)HelpfulnessHarmlessness
Helpful-only RLHFmost helpfulleast harmless
HH RLHF (human harm labels)less helpfulmore harmless
SL-CAIbelow both RLHF modelsbetween the two RLHF models
RL-CAIsmall losssignificantly above both RLHF models and SL-CAI
RL-CAI with chain of thoughtslightly below RL-CAIslightly above RL-CAI

The AI feedback was also tested directly. On 438 binary comparison questions, pretrained models picked the more helpful, honest and harmless response more accurately as they grew, and chain of thought helped further. The authors projected that models larger than 52B would be competitive with preference models trained on human feedback; they did not show parity at 52B.

Two ablations matter. Critiquing before revising produced more harmless revisions for smaller models, while for the 52B model direct revision did nearly as well, though critiques were always slightly better; they were kept because they make the reasoning inspectable. And RL-CAI could be over-trained: past a point the policy turned harsh or appended reassuring boilerplate to its answers to red-team prompts, a Goodhart effect in which the preference model's taste for caring language became a target in itself.

Since then

What the authors admit, and what happened next

The central limitation is acknowledged directly and is worth stating carefully, because it is easy to caricature. Moving to AI feedback does not remove human values from the loop; it relocates them from thousands of unexamined judgements into a short document that someone chose to write. That is a genuine improvement in auditability and no improvement at all in objectivity — the constitution is a set of choices, and the paper presents it as one.

The method also has a capability precondition: the model must be good enough to evaluate its own output against an abstract principle. Where it is not, the self-critique produces noise, and the loop amplifies it. There is no way to bootstrap harmlessness into a model too weak to judge.

How it held up: both halves spread. AI feedback is now routine — the general pattern of using a capable model to generate preference or evaluation signal at a scale humans cannot match is standard practice across the industry, in evaluation as much as in training. And the norm of publishing an explicit specification of intended behaviour, so that a model's failures can be argued about against a stated intent rather than against an assumption, became a convention that several labs now follow. The open question the paper leaves is the one the field still has: a written principle is only as good as the disagreements it was written to survive.

SOLVE IT YOURSELF

Critique, revise, and judge by the constitution

Constitutional AI replaces the human harm-labeler with a written set of principles the model applies to itself. Here it is end to end: a harmful draft gets critiqued against the constitution, revised into a harmless-but-helpful answer, and then an AI judge labels which of two responses better satisfies the rules — the preference signal that trains the model, generated with no human in the loop. Run it and note the last check: the judge prefers a helpful refusal over a blunt "No.", so harmlessness doesn't collapse into stonewalling.

YOUR TASK

Write the body of judge. Everything else in the file is already written; this is the function the paper is about. Press ▶ Run to check it against the 5 assertions below — they start red.

WHAT IT HAS TO SATISFY — 5 ASSERTIONS
  1. The constitution flags the harmful draft
  2. The revision satisfies every principle
  3. The AI judge prefers the revised, harmless response
  4. The judge's preference is order-independent
  5. Between two harmless replies the judge prefers the helpful one
CPython · WebAssembly
Questions

Questions people ask about Constitutional AI

How is Constitutional AI different from RLHF?

RLHF learns what to avoid from human labels: people compare model responses and a reward model is trained on their choices. Constitutional AI keeps human labels for helpfulness but replaces human harmlessness labels with a written list of principles applied by a model. In a supervised phase, the model critiques and revises its own responses to harmful prompts against those principles and is fine-tuned on the revisions. In a reinforcement phase, a feedback model compares pairs of responses under a principle, and its judgments train the preference model that PPO optimizes against. The paper's 52B models trained this way were more harmless than RLHF models trained on human harmlessness labels, at a small cost in helpfulness, and engaged with harmful questions by explaining their objections instead of evading them.

How does RLAIF turn a model's judgment into a preference label?

In Constitutional AI's reinforcement learning from AI feedback, the policy samples two responses to a red-team prompt. A feedback model is shown the conversation, one randomly sampled principle and the two responses as options (A) and (B), and asked which response better follows the principle. Instead of reading off its choice, the method takes the model's log-probabilities for the tokens (A) and (B) and normalizes them into a probability, a soft label such as 0.73 for A. A preference model is trained on these soft labels, mixed with human helpfulness comparisons, and the assistant is then optimized against it with PPO. When the feedback model reasons step by step first, its probabilities are clamped to between 0.4 and 0.6.

Where did the principles in the Constitutional AI paper come from?

The 2022 paper used 16 principles that the authors wrote themselves, phrased as critique and revision instructions for the supervised phase and as comparison questions for the reinforcement phase. They describe choosing them in a fairly ad hoc way, for research purposes, and expect future principles to be refined with input from a broader set of stakeholders and adapted to how a model will be used. The often-quoted link to the UN's Universal Declaration of Human Rights belongs to a later document: the constitution Anthropic published for Claude in May 2023, which drew principles from that declaration and other sources. The method does not depend on any particular text; changing the principles and retraining changes the behavior.

Does Constitutional AI use any human feedback at all?

Yes, for helpfulness. The preference model behind RL-CAI was trained on 135,296 human helpfulness comparisons alongside 182,831 harmlessness comparisons labeled by a model applying the constitution. The starting assistant was also a helpful-only RLHF model trained on human preferences, and about 42,000 of the red-team prompts were written by people in earlier work. What the method removes is human labeling of harmful outputs: no person compares responses for harmlessness, and nobody has to read thousands of disturbing generations to produce the safety signal. Human judgment moves into writing the principles and choosing the few-shot examples that show the model how to critique, revise and compare.

Is the critique step necessary in Constitutional AI?

Less than you might expect, at least for large models. The authors compared revising after an explicit critique with revising directly. For smaller models, critiqued revisions were noticeably more harmless. For the 52B model the two performed similarly, with critiques always slightly ahead. They kept the critique step anyway, because a written critique makes the model's reasoning about each principle visible, which helps people audit what the training is actually rewarding. The broader pattern is that the whole method relies on capability: a model has to be able to recognize a problem and fix it, and larger models do more of that implicitly even when the reasoning is not written out.

Check yourself

4 questions to test what you just read

Work each one out before you open it — a number, a prediction or a reason, not a definition. Producing the answer is what makes it stick. Your progress is kept on this device.

The feedback model gives log-probabilities −0.4 for (A) and −1.4 for (B). Which soft label results, and what would it become in the chain-of-thought variant?

Show answer

p = e^−0.4 / (e^−0.4 + e^−1.4) = 1 / (1 + e^−1) ≈ 0.73 for A. With chain of thought the label is clamped to the 40–60% range, so it becomes 0.60: A is still preferred, but the preference model is not told the feedback model was confident.

Count the human input: which parts of the RL-CAI preference model's training data came from people, and which from a model?

Show answer

The 135,296 helpfulness comparisons are human labels. The 182,831 harmlessness comparisons are labeled by the feedback model applying a sampled principle. People still wrote the 16 principles, the few-shot examples and about 42,000 of the red-team prompts, but nobody labels which response is less harmful.

Over-trained RL-CAI policies started appending the same reassuring boilerplate to answers. Why would optimizing against an AI-labeled preference model produce that?

Show answer

The preference model learned that caring, cautious language correlates with responses the feedback model judged harmless. PPO then finds the cheapest way to raise that score, and stock reassurance raises it on almost any red-team prompt. The proxy becomes the target: Goodhart's law. Training longer amplifies it, which is why the authors flag over-training as a failure mode.

Why fine-tune the SL-CAI model on helpful responses as well as harmless revisions?

Show answer

Revisions to red-team prompts show how to handle harmful requests, not ordinary ones, so a model trained on them alone gets no examples of plain helpfulness. The paper mixes in two responses per helpfulness prompt from the helpful RLHF model to retain as much helpfulness as possible, so the RL phase starts from an assistant that is both helpful and less harmful.

Where this sits

Teaching a base model to follow

A pre-trained model completes text; it does not take instructions. Nine papers on getting from one to the other, from RLHF to a loss with no reward model in it.

  1. 1InstructGPT2022
  2. 2Constitutional AI2022
  3. 3Self-Instruct2023
  4. 4LoRA2022
  5. 5QLoRA2023
  6. 6Direct Preference Optimization2023
  7. 7GRPO2024
  8. 8STaR2022
  9. 9Let's Verify Step by Step2023

All 110 papers, in 19 ladders →

Finished this one? 0 / 110 Paper Breakdowns done
NextSelf-Instruct Next on the “Teaching a base model to follow” ladder · rung 3 of 9

Explore the topic

See this alongside everything else on the same subject — handbooks, system designs, challenges and tools, in one place.

More Paper Breakdowns