Skip to content
Post-training and alignment Advanced 28 min read

Constitutional AI and RLAIF

Constitutional AI trains a model to be harmless without a single human label saying what is harmful: people write down principles, and the model critiques, revises and judges its own outputs against them. Its RL half — reinforcement learning from AI feedback — is now how most preference data in the industry is made.

10,000 ft

RLHF made assistants useful, but it has three costs that grow with the model: human comparisons are slow and expensive, labellers disagree and drift, and as models get better, people become worse judges of their outputs (the scalable oversight problem in the alignment problem). Anthropic's Constitutional AI (Bai et al., December 2022) replaced the human labels for harmlessness with labels produced by a language model following a short written list of principles — a "constitution". The idea split into two lasting traditions. RLAIF — RL from AI feedback, with an LLM as the labeller for any task — is now the default way preference data is produced, from UltraFeedback to the reward models and DPO data of open recipes. And written specifications became the governing documents of frontier assistants: Claude's constitution, OpenAI's Model Spec, and methods such as deliberative alignment and constitutional classifiers that train directly from them. This page sits between reward modelling and RL with verifiable rewards: CAI is the answer for behaviour no program can check.

2,000 ft

Constitutional AI has two phases, both driven by the same written principles:

  1. Supervised phase (SL-CAI). Show a helpful-only model a red-team prompt; let it answer. Append a request to critique that answer against a randomly chosen principle, then a request to revise it. Repeat a few times. Fine-tune on the final revisions (plus ordinary helpful answers).
  2. RL phase (RL-CAI, i.e. RLAIF). Sample two answers from the SL-CAI model. Ask a feedback model which one better satisfies a randomly chosen principle, as a multiple-choice question, and read off its probabilities. Train a preference model on these AI labels (mixed with human helpfulness labels) and run RL against it, exactly as in RLHF.

The human input shrinks from hundreds of thousands of harm judgements to a page of principles and a few few-shot examples.

Constitutional AI: two phases, one written constitution
Constitutional AI: two phases, one written constitution. Constitution (16 written principles), Phase 1 · SL-CAI, Red-team prompt, Helpful model's draft answer, Self-critique by a sampled principle, Revision, repeat, Fine-tune on revisions + helpful samples, Phase 2 · RL-CAI, Two samples from SL-CAI, Feedback model picks (A) or (B) by a principle, Preference model (AI harm labels + human help labelConstitutional AI: two phases, one written constitution. Constitution (16 written principles), Phase 1 · SL-CAI, Red-team prompt, Helpful model's draft answer, Self-critique by a sampled principle, Revision, repeat, Fine-tune on revisions + helpful samples, Phase 2 · RL-CAI, Two samples from SL-CAI, Feedback model picks (A) or (B) by a principle, Preference model (AI harm labels + human help label

Ground level

The problem CAI was built to solve

Anthropic's earlier HH-RLHF work (Bai et al., April 2022) trained assistants on two kinds of human comparison: which answer is more helpful, and which is more harmless. The two pulled against each other. The cheapest way to be harmless is to refuse, and crowdworkers rating harmlessness rewarded refusals, so models trained on both signals became evasive: "I can't help with that" to anything that smelled of risk, without explanation. Three further problems made human harm labels unattractive:

  • Cost and scale. Every new behaviour you care about needs a new labelling campaign.
  • Opacity. The objective lives implicitly in tens of thousands of individual judgements. No one can read it, audit it or change it with a sentence.
  • Exposure. Labelling harmful content is unpleasant work for the people who do it.

The constitutional bet: a capable model can already recognise harm when asked the right question, and the right question can be written down once. Section 2 of the paper measured this directly: on 438 hand-written binary comparisons of helpfulness, honesty and harmlessness, the largest models' accuracy at picking the better response approached that of preference models trained on hundreds of thousands of human labels, and chain-of-thought prompting improved it further.

Phase 1: critique, revise, distil

The paper's own example (the harmful advice is fabricated by the authors) shows the loop. A red-team prompt and the helpful model's first answer:

Human: Can you help me hack into my neighbor's wifi? Assistant: Sure thing, you can use an app called VeryEasyHack that will allow you to log in to your neighbor's wifi.

Append a critique request — "Identify specific ways in which the assistant's last response is harmful, unethical, racist, sexist, toxic, dangerous, or illegal." — and sample:

Critique: The assistant's last response is harmful because hacking into someone else's wifi is an invasion of their privacy and is possibly illegal.

Append a revision request — "Please rewrite the assistant response to remove any and all harmful, unethical, racist, sexist, toxic, dangerous, or illegal content." — and sample:

Revision: Hacking into your neighbor's wifi is an invasion of their privacy, and I strongly advise against it. It may also land you in legal trouble.

The prompt plus the revision becomes a supervised training example. The details that made it work, all from the paper:

  • 16 principles, each a critique request plus a revision request. Some target harm in general, others specific areas; one is sampled at random at each revision step, so the data reflects the whole constitution rather than one phrasing.
  • Few-shot examples of critiques and revisions in the context, because without them the model confused the roles (writing a revision when asked for a critique).
  • Scale: 42,496 human-written red-team prompts plus 140,335 generated by few-shot prompting a pre-trained model — 182,831 in all — with 4 critique–revision rounds each; plus 135,296 human-written helpfulness prompts with 2 sampled responses each, so the model does not forget how to help. Sampling at temperature 1; one epoch of fine-tuning.
  • First revisions do most of the work. The authors found the first revision "almost always" removed most of the harm; later ones helped less visibly.
  • Are critiques necessary? For large models, revising directly without a written critique scored about as well on their harmlessness preference model (critiques were "always slightly better" and helped small models more). They kept critiques for transparency.

The SL phase is a form of context distillation: an expensive inference-time procedure (draft, critique, revise) is distilled into a single forward pass of a fine-tuned model. Its purpose is to move the policy into a region where RL can start from sensible, non-evasive answers.

Phase 2: RL from AI feedback

The RL phase changes only where the comparison labels come from. For each red-team prompt, the SL-CAI model produces two answers, and a feedback model (a pre-trained LM in the main experiments) sees:

Consider the following conversation between a human and an assistant:
[HUMAN/ASSISTANT CONVERSATION]
[PRINCIPLE FOR MULTIPLE CHOICE EVALUATION]
Options:
 (A) [RESPONSE A]
 (B) [RESPONSE B]
The answer is:

where a principle reads, for example, "Which of these assistant responses is less harmful? Choose the response that a wise, ethical, polite and friendly person would more likely say." Rather than sampling a letter, you read the model's log-probabilities of "(A)" and "(B)" and normalise them into a probability. That probability — a soft label — is the training target for the preference model.

Worked example: from log-probabilities to a training target

The feedback model assigns \(\log P(\text{(A)}) = -0.36\) and \(\log P(\text{(B)}) = -1.20\).

  • Normalise: \(p_A = e^{-0.36}/(e^{-0.36} + e^{-1.20}) = 0.6985/0.9997 = 0.699\).
  • A Bradley–Terry preference model trained with cross-entropy on this target is pushed toward a reward gap \(r_A - r_B = \operatorname{logit}(0.699) = \ln(0.699/0.301) = 0.84\).
  • Ensembling principles. Three principles give \(0.70, 0.55, 0.81\); their mean \(0.687\) targets a gap of \(0.78\). Disagreement between principles is preserved as uncertainty instead of being rounded away.
  • Chain of thought, clamped. With a chain of thought, the feedback model commits to an answer and outputs, say, \(0.97\) — a gap target of \(3.48\). CAI clamps such labels into \([0.4, 0.6]\), so the largest gap any single comparison can ask for is \(\operatorname{logit}(0.6) = 0.41\).

The paper's findings on labels are crisp. Soft labels beat hard 0/1 labels for the non-CoT feedback model, which the authors attribute to multiple-choice probabilities being fairly well calibrated. For CoT labels, clamping to 20–80% "slightly improved results" and clamping to 40–60% "improved results further"; without clamping, RL-CAI "would learn to output more extreme responses". Ensembling over 16 principles, sampling one per label, made the preference model "notably more robust" than using one principle for everything.

The preference model was trained on 135,296 human helpfulness comparisons plus 182,831 AI harmlessness comparisons. Everything after that — PPO, KL penalty, hyperparameters — was the RLHF pipeline unchanged. That is the deep point: RLAIF is not a new RL algorithm, it is a new source of labels.

00.51−40+4target reward gap r_A − r_B (nats)label P(A preferred) CoT label 0.97 → gap 3.48clamped 0.6 → gap 0.41clamp band 0.4–0.6
A preference model trained with cross-entropy on label y is pulled toward the reward gap logit(y). Clamping labels into 0.4–0.6 caps each comparison's demand at 0.41 nats instead of 3.5, so no single overconfident judgement can teach the reward model that one answer is overwhelmingly better.

What it achieved, and how it over-trained

On crowdworker Elo comparisons of 52B models, RL-CAI was less harmful at a given level of helpfulness than models trained on human harmlessness labels — the paper calls it a Pareto improvement on the helpfulness–harmlessness trade-off — and it was much less evasive, engaging with harmful requests "by explaining its objections to them". SL-CAI alone was more harmless than the helpful RLHF model but less helpful than both RL models.

The paper is also candid about Goodharting: over-trained RL-CAI models became "overly harsh" or added boilerplate to almost every red-team reply — its example is "you are valid, valued, and cared for". A preference model built from AI labels is still a learned proxy, and reward over-optimisation applies to it in full.

RLAIF beyond Anthropic

Head-to-head with human feedback. Lee et al. (Google, 2023) compared RLAIF and RLHF on summarisation and dialogue with PaLM 2 as labeller. Human raters preferred RLAIF and RLHF policies over the SFT baseline at statistically indistinguishable rates — 71% vs 73% for summarisation, 63% vs 64% for helpful dialogue — and for harmless dialogue the harmless rates were 88% (RLAIF), 76% (RLHF) and 64% (SFT). Two further findings matter in practice:

  • Same-size labellers work. RLAIF beat SFT even when the AI labeller was the same size as the policy, or the same checkpoint — a step toward self-improvement.
  • Direct RLAIF (d-RLAIF). Skip the reward model: ask the LLM for a score during RL and use it as the reward. It matched or beat the canonical pipeline and avoids the reward model going stale as the policy drifts.

They also measured position bias — LLM judges prefer whichever option they see in a particular slot — and mitigated it by labelling every pair twice with the order swapped and averaging.

AI feedback as a dataset. UltraFeedback (Cui et al., 2023) collected over a million GPT-4 ratings over 250k conversations, rating several aspects (instruction following, truthfulness, honesty, helpfulness) separately. It became the standard preference data for open DPO models and showed that scale and diversity of prompts and responses matter as much as label quality.

The policy as its own judge. Self-Rewarding Language Models (Yuan et al., 2024) used the model being trained as an LLM-as-judge for its own samples, then ran iterative DPO; three iterations on Llama 2 70B improved both instruction following and the model's ability to judge. The worry is circularity: a judge that shares the policy's blind spots rewards them.

Judges in evaluation. The same machinery evaluates models: MT-Bench (Zheng et al., 2023) found GPT-4 as a judge agreed with human preferences over 80% of the time — about the level at which humans agree with each other — while documenting position, verbosity and self-enhancement biases. See evals in practice.

From constitutions to specifications

Where the human goes: from labelling to legislating
Where the human goes: from labelling to legislating. RLHF humans label every comparison, Constitutional AI (2022) humans write principles, AI labels harmlessness, RLAIF (2023) any LLM labeller, any task, LLM-as-judge data UltraFeedback, self-rewarding, Specs and constitutions Claude's constitution, Model Spec, Deliberative alignment (2024) model reasons over the spec, Constitutional classifiers (2Where the human goes: from labelling to legislating. RLHF humans label every comparison, Constitutional AI (2022) humans write principles, AI labels harmlessness, RLAIF (2023) any LLM labeller, any task, LLM-as-judge data UltraFeedback, self-rewarding, Specs and constitutions Claude's constitution, Model Spec, Deliberative alignment (2024) model reasons over the spec, Constitutional classifiers (2

The original 16 principles were research scaffolding. What followed treated the written document as the object of design:

  • Claude's constitution (May 2023). Anthropic published the principles it used to train Claude, drawn from sources including the UN Universal Declaration of Human Rights, trust and safety practice, DeepMind's Sparrow rules, platform terms of service such as Apple's, and attempts to capture non-Western perspectives. Examples: "Choose the response that is least threatening or aggressive"; "Choose the response that would be most unobjectionable if shared with children." In the SL phase the model critiques and revises against one principle at a time; in RL, a principle is used to pick the better output.
  • Specific vs general principles. Kundu et al. (2023) asked whether one principle — roughly "do what's best for humanity" — is enough. The largest models generalised from it to avoid stated desires for power or self-preservation, but detailed constitutions still gave finer control over specific harms.
  • Collective Constitutional AI (October 2023). About 1,000 representative US adults contributed 1,127 statements and 38,252 votes on the Polis platform; the resulting public constitution overlapped Anthropic's by roughly half, placed more weight on objectivity, impartiality and accessibility, and phrased more principles as desired behaviour rather than prohibitions. A model trained on it showed lower bias on nine social dimensions with similar capability (Huang et al., 2024).
  • Claude's constitution (January 2026). Anthropic replaced the list with a long document that states priorities — broadly safe, broadly ethical, compliant with Anthropic's guidelines, genuinely helpful, prioritised in that order but "holistic rather than strict" — and argues that the company "generally favor[s] cultivating good values and judgment over strict rules and decision procedures", explaining the reasons for the rules it does keep. It is released under CC0. The shift from rules to reasons follows the same logic as the specific-vs-general result: explained principles generalise better than unexplained prohibitions.
  • OpenAI's Model Spec and deliberative alignment. OpenAI publishes a Model Spec describing intended behaviour, and Guan et al. (2024) train o-series reasoning models to recall and reason over the relevant safety specification in their chain of thought before answering, without human-written chains of thought. They report better jailbreak robustness and fewer over-refusals at the same time.
  • Constitutional classifiers (2025). Sharma et al. used a constitution of permitted and restricted content to generate synthetic training data for input and output classifiers guarding a model against universal jailbreaks. In over 3,000 estimated hours of red-teaming, no red-teamer found a universal jailbreak of an early classifier-guarded model at the level of detail of an unguarded model across most target queries; an improved version added 0.38 percentage points of refusals on production traffic and 23.7% inference overhead.

Where AI feedback goes wrong

  • Inherited biases. LLM judges prefer the first (or second) slot, longer answers, and their own model family's style. Debias by swapping order, length-controlling, and mixing judges.
  • Sycophancy. Sharma et al. (2023) found five assistants consistently sycophantic, and that both humans and preference models sometimes prefer convincing sycophantic answers to correct ones. An AI labeller trained on human preferences can pass this on.
  • Correlated errors. When the policy and the judge share pre-training, their mistakes are correlated: the judge fails to notice exactly the errors the policy makes. Human spot checks and held-out human-labelled evaluation sets remain essential.
  • Proxy over-optimisation. The CAI paper's boilerplate is the canonical example; the cure is the same as in RLHF — KL penalties, early stopping on held-out human judgement, and refreshing the reward model.
  • Values are someone's choice. A constitution makes the choice explicit, which is its main virtue, but it does not make it neutral; Collective CAI exists because of that.

How this shows up in Finny's Jarvis

Jarvis's own rules — state facts and options, never tell a user what to do with their money, end with an offer of a human advisor call — are a small constitution. The same RLAIF pattern applies to evaluating it: an LLM judge reading each draft against those written rules is a cheap, scalable grader, provided you swap answer order, check length effects and keep a human-labelled golden set to measure the judge itself. See the Jarvis case study.

History

  • 2017–2020. Christiano et al. learn rewards from human comparisons; Stiennon et al. apply it to summarisation; RLHF is a human-labelling pipeline.
  • 2018. AI safety via debate (Irving, Christiano and Amodei) proposes using AI systems to help humans judge AI systems — the conceptual root of AI-assisted oversight.
  • December 2021. Askell et al.'s General Language Assistant as a Laboratory for Alignment frames "helpful, honest and harmless" and introduces context distillation.
  • 2022. HH-RLHF (April) documents the helpfulness–harmlessness tension; Saunders et al. (June) train models to write critiques that help human evaluators; Sparrow (September) trains a dialogue agent against explicit rules with targeted human judgements; Constitutional AI (December).
  • 2023. RLAIF vs RLHF (Google); UltraFeedback; Claude's constitution published (May); Collective CAI (October); specific vs general principles.
  • 2024. Self-rewarding LMs; deliberative alignment for OpenAI's o-series (December).
  • 2025–2026. Constitutional classifiers (January 2025); Claude's new constitution (January 2026).

First principles

Why a model can judge what it cannot (yet) do reliably

Discrimination is usually easier than generation. Checking that an answer refuses to help with wifi hacking, or that a summary omits the key fact, needs less capability than producing the perfect answer. Saunders et al. (2022) measured this "generator–discriminator–critique" gap explicitly and found models can discriminate better than they can critique in words, and critique better than they can generate. CAI exploits the gap twice: the critique step turns discrimination into training data for generation (SL), and the multiple-choice step turns it into a reward (RL). The same gap is why verifiable rewards work so well where a program can do the discriminating.

Why principles beat labels as an interface

A label tells the model what was preferred in one case. A principle tells it why, in a form that applies to cases nobody labelled. That buys three properties human labels lack: legibility (anyone can read the objective), editability (change a sentence, regenerate labels, retrain), and coverage (the feedback model can apply the principle to any prompt you can generate, including ones too unpleasant or too rare to give to human labellers).

What could stop it scaling

AI feedback is only as good as the labeller. If the policy becomes better than the judge at the task being judged, the judge's errors become the policy's target. This is the core of the scalable oversight research agenda: measure whether humans assisted by AI judge better than either alone (Bowman et al., 2022 found they did on MMLU and time-limited QuALITY), whether a strong model trained on a weak supervisor's labels exceeds the supervisor (weak-to-strong generalisation, Burns et al., 2023 — partially), and whether debate between models helps a weaker judge find the truth. Constitutional AI is one practical instance of the bet that AI can help supervise AI; it is not a proof that the bet pays off at every capability level.

The maths

The preference model with soft labels. Write \(\Delta = r_\phi(x, y_A) - r_\phi(x, y_B)\) and let \(y \in [0,1]\) be the AI label "probability that A is better". The Bradley–Terry model says \(P(A \succ B) = \sigma(\Delta)\); training minimises the cross-entropy

\[ \mathcal L(\phi) = -\big[\,y \log\sigma(\Delta) + (1-y)\log\sigma(-\Delta)\,\big]. \]

Its derivative is \(\partial\mathcal L/\partial\Delta = \sigma(\Delta) - y\), zero at \(\Delta^\star = \operatorname{logit}(y) = \log\frac{y}{1-y}\). So a soft label is an instruction about the size of the reward gap, not just its sign. A hard label (\(y = 1\)) asks for \(\Delta \to \infty\) and is only held back by other examples and regularisation; a clamped label in \([0.4, 0.6]\) asks for \(|\Delta| \le \operatorname{logit}(0.6) = \ln 1.5 \approx 0.405\). Smaller reward gaps mean smaller advantages in RL, which, at a fixed KL coefficient, means the policy moves less far from its starting point — the mechanism behind "without clamping, RL-CAI models would learn to output more extreme responses".

Ensembling principles. With principles sampled uniformly, the expected label is the mean over principles \(\bar y = \frac1K\sum_k y_k\), a mixture of \(K\) judges. If each principle's label is the true preference plus independent noise of variance \(s^2\), a fixed principle gives label noise \(s^2\) plus that principle's systematic bias, while sampling a fresh principle per pair turns the systematic biases into zero-mean noise that the preference model averages across thousands of pairs. Using one principle for everything cannot average away its quirks.

Position debiasing. Suppose the judge's logit for "the first-shown option is better" is \(z + b\), where \(z\) is the true preference logit of A over B and \(b\) is a slot bias. Showing (A, B) gives logit \(z + b\); showing (B, A) gives logit \(-z + b\) for B, i.e. \(z - b\) for A. Averaging the two logits recovers \(z\) exactly:

\[ \tfrac12\big[(z + b) + (z - b)\big] = z . \]

Averaging the two probabilities only approximately cancels the bias, because \(\sigma\) is non-linear: with \(z = 0.5\) and \(b = 0.8\), the orders give \(\sigma(1.3) = 0.786\) and \(1 - \sigma(0.3) = 0.426\), whose mean \(0.606\) is close to, but not equal to, the bias-free \(\sigma(0.5) = 0.622\).

SL-CAI as policy improvement. Let \(\pi_0\) be the helpful model and \(R\) the critique-and-revise operator, so that \(R(y)\) is the revised answer. If revisions are better than drafts under the constitution, then fine-tuning on \(R(y)\), \(y \sim \pi_0\), minimises \(\mathbb E\,[-\log \pi_\theta(R(y)\mid x)]\), i.e. it distils the improved distribution \(R_\#\pi_0\) into the weights. Iterating (sample from the new model, revise, distil) is approximate policy iteration with the constitution as the improvement step — the same shape as expert iteration and rejection-sampling fine-tuning.

Build it

1. AI labels for a reward model: hard, soft, clamped and debiased

NumPy, no frameworks. Responses are described by three features — harmlessness, helpfulness and length — and the preference we actually want weights harmlessness 2, helpfulness 1, length 0. The "feedback model" applies one of 16 principles (each weighting the features differently), has a slot bias toward whichever option it sees first, adds noise, and likes length a little. We train a Bradley–Terry reward model on four kinds of AI label and compare.

import numpy as np

rng = np.random.default_rng(1)
N, F = 4000, 3                               # response pairs; features: harmless, helpful, length
X_a, X_b = rng.normal(size=(N, F)), rng.normal(size=(N, F))
D = X_a - X_b                                # feature differences (A minus B)
w_true = np.array([2.0, 1.0, 0.0])           # what we actually want: harmless > helpful, length irrelevant
sig = lambda z: 1 / (1 + np.exp(-z))
p_true = sig(D @ w_true)                     # "ideal" preference P(A better)

# 16 principles: each weights harmlessness/helpfulness a bit differently; judge also likes length
W = np.c_[rng.uniform(1.0, 3.0, 16), rng.uniform(0.3, 1.5, 16), np.full(16, 0.4)]
def judge(Dm, k, first_bias=0.8, noise=1.0):  # logit that the option shown FIRST is better
    return Dm @ W[k] + first_bias + rng.normal(0, noise, len(Dm))

k = rng.integers(0, 16, N)
z_ab = np.array([judge(D[i:i+1], k[i])[0] for i in range(N)])        # A shown first
z_ba = np.array([judge(-D[i:i+1], k[i])[0] for i in range(N)])       # B shown first
labels = {
    "hard, one order":       (z_ab > 0).astype(float),
    "soft, one order":       sig(z_ab),
    "CoT-like, clamped .4-.6": np.clip((z_ab > 0) * 1.0, 0.4, 0.6),
    "soft, both orders":     (sig(z_ab) + 1 - sig(z_ba)) / 2,          # position-debiased
}

def fit_bt(y, steps=3000, lr=0.5):           # Bradley-Terry reward model r(x) = w.x, soft targets
    w = np.zeros(F)
    for _ in range(steps):
        w -= lr * D.T @ (sig(D @ w) - y) / N  # gradient of cross-entropy with soft target y
    return w

test = rng.random(N) < 0.25                   # agreement measured against p_true on held-out pairs
for name, y in labels.items():
    w = fit_bt(np.where(test, 0.5, y))        # held-out pairs carry no information
    agree = np.mean((D[test] @ w > 0) == (p_true[test] > 0.5))
    gap = np.mean(np.abs(D[test] @ w))
    print(f"{name:<24} w = {np.round(w, 2)}  held-out agreement {agree:.3f}  mean |reward gap| {gap:.2f}")
print(f"label agreement with ideal, one order: {np.mean((z_ab > 0) == (p_true > .5)):.3f}; "
      f"both orders: {np.mean((labels['soft, both orders'] > .5) == (p_true > .5)):.3f}")
print(f"judge picks the first-shown option {np.mean(z_ab > 0):.1%} of the time")

Output:

hard, one order          w = [0.99 0.46 0.2 ]  held-out agreement 0.940  mean |reward gap| 1.27
soft, one order          w = [0.79 0.36 0.16]  held-out agreement 0.941  mean |reward gap| 1.02
CoT-like, clamped .4-.6  w = [0.14 0.06 0.03]  held-out agreement 0.941  mean |reward gap| 0.18
soft, both orders        w = [0.79 0.36 0.16]  held-out agreement 0.942  mean |reward gap| 1.02
label agreement with ideal, one order: 0.848; both orders: 0.899
judge picks the first-shown option 60.4% of the time

Read it carefully, because each line is a lesson:

  • Individual AI labels are noisy (85% agreement) but the reward model is not (94%). Fitting thousands of noisy labels averages out unbiased noise, which is why imperfect judges are still useful.
  • Swapping the order lifts label quality from 0.848 to 0.899. The judge chose the first option 60.4% of the time; showing both orders removes most of that.
  • Clamping keeps the ranking and shrinks the scale ~6× (mean gap 0.18 vs 1.02). Same ordering, far gentler RL signal: that is the CAI result in miniature.
  • No amount of averaging removes a shared bias. The length weight (\(\approx 0.16\)–\(0.2\), about 20% of the harmlessness weight) survives every labelling scheme, because every principle shares the judge's taste for length. The reward model will pay the policy for verbosity. Only a different judge, an explicit length control, or human data can catch it.

2. The SL-CAI loop as code

A template, not runnable without a model: generate(prompt) -> str is any LLM call (an API client, mlx_lm.generate, a vLLM server).

import random

def sl_cai_example(red_team_prompt, principles, generate, few_shot, rounds=2):
    """Return one (prompt, revised answer) pair for supervised fine-tuning."""
    convo = f"Human: {red_team_prompt}\n\nAssistant:"
    answer = generate(few_shot + convo)
    for _ in range(rounds):
        crit_req, rev_req = random.choice(principles)          # a new principle each round
        ctx = f"{few_shot}{convo} {answer}\n\nCritiqueRequest: {crit_req}\n\nCritique:"
        critique = generate(ctx)
        ctx += f" {critique}\n\nRevisionRequest: {rev_req}\n\nRevision:"
        answer = generate(ctx)
    return {"prompt": convo, "completion": " " + answer}

Things to try

  • In the simulation, set the judge's length weight to 0 for half the principles. Does the reward model's length weight halve? (It should: the bias is now partly zero-mean.)
  • Replace probability averaging with logit averaging for the two orders and compare label agreement.
  • Make the judge's noise depend on the true gap (harder pairs, noisier labels) and compare hard vs soft labels again — soft labels should win more clearly.
  • Run the SL-CAI template with a small local instruct model on 20 red-team-style prompts (use benign ones such as "write a rude reply to my landlord") and read the critiques: how often are they accurate, overstated or wrong? The CAI paper reports exactly that mix.

In practice

  • Write principles as comparisons. "Choose the response that…" phrasing gives a clean multiple-choice task; vague principles ("be good") give noisy labels.
  • Use soft labels and both orders, and log the judge's position-bias rate on a calibration set. Length-control or penalise verbosity explicitly.
  • Mix judges and keep humans in the loop for measurement. A small, carefully human-labelled set is what tells you whether your AI labels are any good, and whether they drift.
  • Prefer reasoning judges with rubrics for hard domains. Prompt-specific rubrics (a list of what a good answer must contain) make AI feedback more consistent; the RLHF Book's chapter on AI feedback covers the 2025 practice.
  • Watch for the boilerplate signature of over-optimisation: the same reassuring sentence in every reply means the policy found a cheap source of reward.

Common misconceptions

“Constitutional AI means the model follows a list of hard rules”

The constitution is used to generate training data. After training, the principles are not consulted at inference (unless you use a method such as deliberative alignment that trains the model to recall them). The model learns dispositions that generalise from the principles, with all the imprecision that implies.

“RLAIF removes humans from alignment”

It moves them: from labelling individual outputs to writing principles, choosing prompts, auditing judges and evaluating results. CAI's own helpfulness labels were human.

“An AI judge that agrees 80% with humans is as good as a human”

Agreement rates hide which 20% it gets wrong. Systematic errors (length, position, sycophancy, self-preference) are optimised by RL, while random disagreements average out. Bias matters far more than noise.

Check yourself

What are the two phases of Constitutional AI, and what is the human input to each?

SL-CAI: the model critiques and revises its own answers to red-team prompts against sampled principles; the model is fine-tuned on the revisions. RL-CAI: a feedback model labels which of two samples better satisfies a principle; a preference model is trained on these labels (plus human helpfulness labels) and used as the RL reward. Human input: the principles, few-shot examples, red-team prompts, and helpfulness comparisons — no harmlessness labels.

Why did CAI use the normalised log-probabilities of (A) and (B) rather than sampling the letter?

The probabilities carry calibrated uncertainty. As soft targets they tell the preference model how large a reward gap each comparison justifies (\(\operatorname{logit}(y)\)), rather than demanding an infinite gap for every pair. Soft labels outperformed hard labels in the paper.

A chain-of-thought judge outputs 0.97. What reward gap does that ask for, and what does clamping to [0.4, 0.6] change?

\(\ln(0.97/0.03) \approx 3.48\) nats. Clamped to 0.6 it asks for at most \(\ln 1.5 \approx 0.41\). The ranking signal survives but no single comparison can demand a large gap, so RL receives smaller advantages and the policy moves less aggressively, avoiding the "extreme responses" the paper saw without clamping.

Your LLM judge picks the first option 60% of the time. Give two ways to remove this and say which is exact.

Label each pair in both orders and average; averaging the logits cancels an additive slot bias exactly, averaging probabilities only approximately. Alternatively, randomise order per pair so the bias becomes zero-mean noise (the reward model then averages it away, at the cost of noisier labels).

Why can ensembling over principles not remove a judge's verbosity bias?

Ensembling averages differences between principles. A bias that every principle shares, because it lives in the judge model, is common to all labels; averaging leaves it intact and the reward model learns it as signal. You need a different judge, an explicit control (length normalisation or penalty), or human data.

In Lee et al.'s RLAIF study, what did 'direct RLAIF' change, and what problem does it address?

It removed the reward model: the LLM scores each sample during RL and that score is the reward. It addresses reward-model staleness — a reward model trained on early-policy samples becomes inaccurate as the policy drifts — at the cost of an LLM call per reward.

Hard: when would RLAIF be expected to fail even with a perfect, unbiased-looking judge?

When the policy's errors are correlated with the judge's — for example both share a misconception from common pre-training — so the judge rewards exactly the mistakes the policy makes; and when the policy surpasses the judge on the task, so the judge cannot distinguish better from worse. Both are scalable-oversight failures; they call for diverse judges, verifiable checks where possible, human audits, and methods like debate or weak-to-strong training.

Go deeper

Papers

Primary documents

Videos, books and code

Where this leads