Foundations to Frontier
Tests

RLAIF, constitutional methods

Human preference labels are slow and expensive. Reinforcement learning from AI feedback (RLAIF) has a strong model act as the labeller, and constitutional AI guides that labeller (and a critique-and-revise loop) with a short written list of principles. This makes preference data cheap and scalable, but the AI judge's biases (length, position, self-preference, sycophancy) become the policy's biases. This page covers RLAIF, constitutional AI's supervised and RL phases, judge biases and how to measure and reduce them. In the exercises you compute judge probabilities, position-debias a judgement and measure labeller agreement. You then run DPO on four datasets. 3000 labels from an unbiased but noisier AI judge matched 300 human labels (true reward 1.10 against 1.00). 3000 labels from a judge biased towards verbosity cut true reward to 0.39 and made the policy verbose. A principle telling the judge not to reward length, removing 80% of its bias, restored 1.03.

Level 0: Foundation

★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.

Letting a model grade the answers

Instead of asking people to compare thousands of answer pairs, we can ask a strong AI model to do it, guided by a short list of written principles (a constitution) such as ‘be helpful, be honest, avoid harm’. This is far cheaper, so we can label much more data. The catch is that the AI grader has its own quirks, for example liking longer answers, and the trained model will learn those quirks too. The demo shows the preference model every grader is assumed to follow.

Alignment lab
P(a preferred over b) = σ(1) = 0.731. Reward models are trained so that this probability matches human choices.
Why engineers care

AI labellers let a small team build large preference datasets for specialised domains, but every judge should be checked against a human-labelled sample for biases before its labels are trusted.

📝 Quick check (Level 0)
0/3 answered
  1. 1. RLAIF uses ___ as the labeller:
  2. 2. A constitution is…
  3. 3. A risk of AI labellers:

Level 1: Beginner

★★☆☆☆ Basic⏱ 20 minSecondary-school mathematics: arithmetic and elementary algebra.

By hand

  • RLAIF: an AI judge compares two responses (often with chain-of-thought) and its preference probabilities replace human labels for a reward model or DPO.
  • Constitutional AI (Bai et al., 2022): (1) supervised phase: the model critiques its own answers against principles and revises them; fine-tune on the revisions. (2) RL phase: an AI judge picks the response that better follows a sampled principle; train with RL on these labels.
  • Known judge biases: position (prefers the first shown), length/verbosity, self-preference (prefers its own outputs), sycophancy, style over substance.
  • Mitigations: swap positions and average; ask several times and take the majority; length-controlled comparisons; explicit principles naming the bias; calibrate against a human-labelled subset (agreement, Cohen’s κ).
  • Cost: AI labels cost orders of magnitude less, so data size can grow 10–100×.
📝 Quick check (Level 1)
0/3 answered
  1. 1. Constitutional AI's first phase:
  2. 2. Position bias is reduced by…
  3. 3. Agreement beyond chance is measured by…

Level 2: Intermediate

★★★☆☆ Intermediate⏱ 25 minUndergraduate students and practising engineers.

AI feedback in code

Exercise 1.

  • Compute an AI judge’s preference probability at a given temperature.
  • Position-debias a judgement by swapping the order.
  • Measure agreement between two labellers.

Practice.

  • Use a strong judge model with a clear rubric and principles; ask for reasoning before the verdict.
  • Always run both orders and average; drop or re-ask ties.
  • Label a few hundred pairs by hand and report judge–human agreement before scaling up.
  • Check length and style statistics of chosen against rejected responses for systematic bias.
def ai_label(prompt, a, b, principles):
    q = f"Principles:\n{principles}\nPrompt: {prompt}\nA: {a}\nB: {b}\nWhich better follows the principles? Answer A or B."
    p1 = judge_prob_first(q)                           # P(A) with A shown first
    p2 = 1 - judge_prob_first(swap(q))                 # P(A) with A shown second
    return 0.5 * (p1 + p2)
🐍 Exercise 1: AI judges, position bias and agreement
Implement the judge probability, position debiasing and labeller agreement.
📝 Quick check (Level 2)
0/3 answered
  1. 1. Before scaling AI labels, measure…
  2. 2. Ask the judge for reasoning…
  3. 3. Run comparisons in…

Level 3: Advanced

★★★★☆ Advanced⏱ 25 minGraduate level, with full derivations and proofs.

Theory

More, noisier labels. A labeller that is noisier than humans gives less information per pair, but if it is unbiased the errors average out: DPO’s gradient is an average over pairs, and ten times as many pairs reduce its variance roughly tenfold. Noise mostly costs data, which AI labels make cheap.

Bias does not average out. A systematic preference (for verbosity, say) is present in every label, so more data only learns it more precisely. Through the DPO/RLHF optimum the policy is tilted by the judge’s reward, bias included, and the policy then exploits it. In exercise 2 the biased judge turned a mild true dislike of verbosity into a strong learned preference.

Why principles help. A written principle that names the bias changes the judge’s scoring itself, reducing the bias at its source. This is the practical core of constitutional methods: making the judge’s criteria explicit, inspectable and editable.

📝 Quick check (Level 3)
0/3 answered
  1. 1. Unbiased label noise can be offset by…
  2. 2. Systematic judge bias with more data…
  3. 3. Constitutional principles act on…

Level 4: Expert

★★★★★ Expert⏱ 30 minResearchers: original papers and open problems.

Can cheap AI labels replace human labels, and what happens when the AI judge is biased?

History.

  • Y. Bai et al., “Constitutional AI: harmlessness from AI feedback” (Anthropic, 2022).
  • H. Lee et al., “RLAIF vs. RLHF” (2023).
  • L. Zheng et al., “Judging LLM-as-a-judge” (NeurIPS 2023): position, verbosity and self-enhancement biases.

Exercise 2.

  • Setup: the F7-3 simulated problem, with feature 2 playing the role of verbosity; the true reward mildly dislikes it (weight −0.3).
  • Labellers:
    • humans: Bradley–Terry on the true reward;
    • AI: the same scores at temperature 2 (noisier), optionally plus a verbosity bonus of 1.5 (biased), or 0.3 (a principle removes 80% of the bias).
  • Training: DPO (β = 0.1) on pairs sampled from the reference policy.
labels true reward verbosity of policy KL to reference
reference −0.037 −0.02 0
300 human 0.999 −0.44 1.666
3000 AI, unbiased 1.101 −0.37 1.248
3000 AI, biased 0.394 +1.06 1.578
3000 AI, biased + principle 1.032 −0.04 1.151
  • Quantity can buy back noise: ten times as many noisier AI labels matched 300 human labels (seed 0 1.10 against 1.00; seeds 1 and 2: 0.72 against 0.84 and 1.20 against 1.27, so roughly equal, not better).
  • Bias is inherited: the biased judge made the policy strongly verbose and lost 60% of the true improvement.
  • Naming the bias fixed most of it: with the bias reduced by a principle, the policy’s verbosity returned to neutral and its true reward to 1.03. A residual bias still shows: it does not reach the true preference for brevity.
  • Lesson: measure a judge’s systematic biases against human labels before scaling; noise is cheap to fix, bias is not.
🐍 Exercise 2 (research): can cheap AI labels replace human labels, and what happens when the AI judge is biased?
Train DPO on human labels, many noisy AI labels, biased AI labels and AI labels guided by a principle; compare true reward and verbosity.

AI feedback in AI, robotics and aerospace

  • Safety training: constitutional methods are used to train harmlessness at scale with few human labels.
  • Robotics: vision-language models as reward labellers for robot behaviour (RL-VLM-F, RoboCLIP) inherit the same bias concerns.
  • Technical assistants: an AI judge with explicit principles (cite the manual, flag uncertainty) can label large datasets, provided agreement with engineers is checked.

References

  1. Y. Bai et al. (2022). “Constitutional AI: harmlessness from AI feedback.” arXiv:2212.08073.
  2. H. Lee et al. (2024). “RLAIF vs. RLHF: scaling reinforcement learning from human feedback with AI feedback.” ICML.
  3. L. Zheng et al. (2023). “Judging LLM-as-a-judge with MT-Bench and Chatbot Arena.” NeurIPS.
  4. Y. Dubois et al. (2024). “Length-controlled AlpacaEval.” arXiv:2404.04475.