# RLAIF and Constitutional AI explained: AI feedback, critique and revision, and AI judges

RLAIF swaps human preference labels for labels from a language model, and Constitutional AI steers that model with written principles. This guide explains both step by step, with worked numbers on soft labels and position bias, a runnable judge experiment and the latest research on AI judges.

Reinforcement learning from human feedback needs people to compare thousands of model outputs. That is slow, costly and hard to keep consistent, and for some content, such as harmful requests, it is unpleasant work. A natural question follows: if language models are now good at judging text, can a model provide the feedback instead? Reinforcement learning from AI feedback (RLAIF) does exactly that. Constitutional AI (CAI) is the best-known recipe for it, where a short list of written principles tells the AI labeller what "better" means.

This article explains how both work. It covers the critique-and-revision stage, how an AI labeller turns into soft preference labels, why position bias matters and how to remove it, and how the newest work uses rubrics and several judges. Every number is either from the cited papers or computed in code you can run.

## What happened

Three recent developments shape how AI feedback is used today.

### Anthropic publishes a new constitution for Claude under CC0 (22 January 2026)

Anthropic released a rewritten constitution for its Claude models. The company says it moved away from a list of standalone principles toward explaining its reasoning, so the model can generalise to new situations, while keeping hard constraints for a small set of high-stakes behaviours. It sets a priority order for conflicts: broad safety first, then ethics, then Anthropic's specific guidelines, then helpfulness. Anthropic states that Claude uses the constitution to generate synthetic training data, including response rankings, and that the text is released under the Creative Commons CC0 1.0 licence.

### Rubrics as Rewards appears at ICLR 2026

Gunjal and colleagues' "Rubrics as Rewards" (RaR) turns checklists written for each prompt into rewards scored by an AI judge. The authors report up to a 31% relative improvement on HealthBench and up to 7% on GPQA-Diamond over judge baselines that use a single Likert score. This extends AI-judged RL to tasks with no single checkable answer.

### "Judging the Judges" measures how much the choice of AI judge matters (arXiv, October 2026)

Liu, Harrington, Darrell and Bai at UC Berkeley held a rubric fixed and swapped the judge. Five judges produced HealthBench scores from 0.296 to 0.339 for the trained policy, a spread of about 4.3 points from the choice of judge alone. Averaging two judges did not beat the better one, but dropping rollouts where the judges disagreed did: their best setup reached 0.364 against 0.339 for the best single judge.

## Constitutional AI: two stages driven by principles

Constitutional AI was introduced by Bai and colleagues at Anthropic in December 2022. Its goal was a harmless assistant trained without human labels for harmful outputs; the only human input on harmlessness was a list of principles. Humans still labelled helpfulness.

### Stage 1: supervised learning from critique and revision (SL-CAI)

1. Take a red-team prompt, a request designed to provoke a harmful answer.
2. Sample a response from a helpful RLHF model.
3. Ask the same model to critique its response against one principle, picked at random.
4. Ask it to rewrite the response to address the critique.
5. Repeat critique and revision; the paper used 4 rounds, with a new principle each time.
6. Fine-tune a pretrained model on the final revisions, mixed with helpfulness samples.

The paper wrote 16 principles for this stage and 16 for the RL stage. One example reads: "Choose the response that a wise, ethical, polite and friendly person would more likely say." It used 42,496 human-written and 140,335 model-generated red-team prompts, 182,831 in total.

Think of it as a writer with an editor's checklist. The writer drafts, re-reads the draft against one rule from the checklist, and rewrites. After a few passes, the final drafts become the training examples.

### Stage 2: reinforcement learning from AI feedback (RL-CAI)

1. Sample two responses from the SL-CAI model for each prompt.
2. Show both to a feedback model as a multiple-choice question, together with a principle, and ask which is better.
3. Read the normalised log-probabilities of options (A) and (B). These become soft preference labels.
4. Train a preference model on these AI labels for harmlessness, mixed with 135,296 human helpfulness comparisons.
5. Run RL against the preference model, as in RLHF.

The paper produced 182,831 AI harmlessness comparisons this way. It reports that the RL-CAI models were more harmless than both the RLHF and SL-CAI models and rarely evasive: they explained their objections rather than refusing flatly.

## From AI judgements to training labels

The core technical move in RLAIF is turning a model's judgement into a label that a reward model can learn from.

### Soft labels from log-probabilities

Suppose the labeller is asked "Which summary is better, 1 or 2?" and we read the log-probabilities of the tokens "1" and "2". A softmax over the two gives a probability, not a hard vote. Lee and colleagues at Google (2023) used exactly this and note that it "conveys more information than a one-hot encoding".

**Worked example.** The log-probability of "1" is −0.2 and of "2" is −1.8.

1. p(1) = e^−0.2 / (e^−0.2 + e^−1.8) = σ(1.6) = 0.832.
2. The label says response 1 is better with 83.2% confidence.

### Removing position bias

Language models tend to favour the option shown first (or sometimes last). RLAIF scores every pair twice, once in each order, and averages. If p_AB is the probability that A wins when A is shown first, and p_BA is the probability that B wins when B is shown first, the debiased label is:

p(A better) = ½ [ p_AB + (1 − p_BA) ]

**Worked example, continued.** With A first, the judge gave A 0.832. With B first, it gave B 0.45, so A gets 0.55. The debiased label is ½ (0.832 + 0.55) = 0.691. The confident first answer was partly a position effect.

Lee and colleagues measured how often labellers picked the same position in both orders, which can only be a position preference. The rate was 18% for PaLM 2 L, 21% for PaLM 2 S and 56% for PaLM 2 XS: smaller labellers were far more biased.

```chart
{"type": "bar", "title": "AI labeller quality by size (PaLM 2, summarisation)", "x": ["PaLM 2 XS", "PaLM 2 S", "PaLM 2 L"], "series": [{"name": "alignment with human preferences", "data": [62.7, 73.8, 78.0]}, {"name": "same position preferred in both orders", "data": [56, 21, 18]}], "unit": "%", "ylabel": "percent", "note": "Source: Lee et al., RLAIF vs. RLHF (arXiv 2309.00267)"}
```

### Training the reward model on soft labels

With a soft label p, the reward-model loss becomes a cross-entropy against p instead of against 1:

L = − [ p · log σ(Δ) + (1 − p) · log σ(−Δ) ],  with Δ = r(x, y_A) − r(x, y_B)

When p = 1 this reduces to the standard RLHF pairwise loss −log σ(Δ).

**Worked example.** The reward model currently gives a gap Δ = 0.5. With the hard label p = 1, the loss is −log σ(0.5) = 0.474. With the debiased soft label p = 0.691, the loss is 0.629. The soft label stops pushing the gap upward once σ(Δ) reaches 0.691, so the reward model does not become more confident than the judge was.

CAI adds one more guard. When the feedback model reasons step by step first, its probabilities tend to be near 0 or 1. The paper clamps those labels to the 40 to 60% range, after finding that unclamped labels led to more extreme behaviour and that 40 to 60% worked better than 20 to 80%. A chain-of-thought label of 0.97 becomes 0.6.

### Code: measure and fix position bias in a judge

This experiment simulates 2,000 pairs with a hidden true quality gap, noisy human labels, and an AI judge with a pull toward the first slot. It compares a single-order judge with the order-averaged one, using scikit-learn's Cohen's kappa.

```python
import numpy as np
from sklearn.metrics import cohen_kappa_score   # scikit-learn 1.9
rng = np.random.default_rng(0)
n = 2000
quality_gap = rng.normal(0, 1, n)                        # quality(A) - quality(B)
human = (quality_gap + rng.normal(0, 0.6, n) > 0).astype(int)   # 1 = A better

def judge_prob_first(gap, bias=0.8, noise=0.6):
    """AI judge: P('first response is better'), pulled toward slot one."""
    z = 1.5 * gap + bias + rng.normal(0, noise, len(gap))
    return 1 / (1 + np.exp(-z))

p_ab = judge_prob_first(quality_gap)        # A shown first
p_ba = judge_prob_first(-quality_gap)       # B shown first -> P(B better)
p_debiased = 0.5 * (p_ab + (1 - p_ba))

for name, p in [("one order", p_ab), ("both orders", p_debiased)]:
    label = (p > 0.5).astype(int)
    print(name, np.mean(label == human).round(3),
          round(cohen_kappa_score(human, label), 3), label.mean().round(2))
print("order-consistent:", np.mean((p_ab > 0.5) == (p_ba < 0.5)).round(3))
```

| Judge setup | Agreement with humans | Cohen's κ | Share of "A wins" |
|---|---|---|---|
| One order (A always first) | 74.2% | 0.488 | 68% |
| Both orders averaged | 80.6% | 0.612 | 50% |
| Human labels (reference) | 100% | 1.000 | 49% |

Only 60.5% of verdicts were consistent across the two orders. The single-order judge claimed A won 68% of the time when humans said 49%. Averaging fixed the skew and raised κ from 0.488 to 0.612. You can explore agreement and κ interactively in the [LLM-judge agreement simulation](/ai-simulations/llm-judge-agreement).

```chart
{"type": "bar", "title": "Simulated AI judge with position bias: effect of scoring both orders", "x": ["Agreement with humans", "Cohen's kappa x 100", "Share saying A wins"], "series": [{"name": "one order", "data": [74.2, 48.8, 68]}, {"name": "both orders averaged", "data": [80.6, 61.2, 50]}], "ylabel": "value", "note": "Computed by the judge script in this article (2,000 simulated pairs, seed 0)"}
```

## Does AI feedback match human feedback?

The clearest head-to-head test is Lee and colleagues' "RLAIF vs. RLHF" (first posted September 2023). They used PaLM 2 L as the labeller and compared policies trained on AI labels with policies trained on human labels.

| Task | RLAIF win rate vs SFT | RLHF win rate vs SFT | RLAIF vs RLHF head-to-head |
|---|---|---|---|
| Summarisation | 71% | 73% | 50% |
| Helpful dialogue | 63% | 64% | 52% |

For harmless dialogue, the share of harmless responses was 64% for SFT, 76% for RLHF and 88% for RLAIF. The paper also tested direct RLAIF (d-RLAIF), which skips the reward model and asks the labeller for a score during RL. It won 74% of the time against SFT on summarisation and 66% on helpful dialogue, ahead of standard RLAIF. Even a labeller the same size as the policy improved on SFT, which the authors present as a sign of self-improvement.

The labeller's agreement with people depended on the prompt. The best prompts reached 78.0% for summarisation, 69.1% for helpfulness and 72.1% for harmlessness. Chain-of-thought helped a little: for summarisation with a detailed preamble, agreement went from 77.4% to 78.0%.

## Use cases and examples

**A team scaling harmlessness data.** Following CAI, they write a short list of principles, run critique and revision on red-team prompts, and fine-tune on the revisions. They then label pairs with a feedback model, clamp chain-of-thought labels to 40 to 60%, and train a preference model, keeping human labels for helpfulness. Read more on the [Constitutional AI page](/tools/constitutional-ai).

**A summarisation product without a labelling budget.** They use a strong model as labeller with a detailed preamble, score every pair in both orders, and average the soft labels. On a few hundred human-labelled pairs they check agreement, aiming for the high-70s range that Lee and colleagues reached for summarisation before training at scale.

**A medical QA team training with rubrics.** Each prompt has a rubric written by clinicians: "mentions dose", "flags drug interaction", "advises seeing a doctor when needed". An AI judge scores each item and the weighted total becomes the reward in GRPO. Following the Berkeley results, they use two different judges and drop rollouts where the judges disagree strongly; in that paper, 25.35% of rollouts were dropped across four two-judge runs.

**An agent team building an online judge reward.** In TRL 1.18.2 there is no judge class (the TRL v1.0 post calls the old Judge abstraction legacy), so they pass a Python function to `GRPOTrainer` that calls their judge and returns a list of scores, the d-RLAIF pattern. See the [GRPO simulation](/ai-simulations/grpo-reinforcement-learning) for how group rewards become advantages.

```python
from trl import GRPOTrainer, GRPOConfig   # TRL 1.18.2

def judge_reward(prompts, completions, **kwargs):
    """Ask an AI judge for a 1-10 score per completion; return floats."""
    scores = []
    for p, c in zip(prompts, completions):
        s = call_my_judge(principles=PRINCIPLES, prompt=p, response=c)  # your API call
        scores.append((s - 1) / 9)            # rescale 1-10 to 0-1
    return scores

trainer = GRPOTrainer(
    model="Qwen/Qwen2.5-0.5B-Instruct",
    reward_funcs=judge_reward,
    args=GRPOConfig(output_dir="rlaif", beta=0.04, num_generations=8),
    train_dataset=prompts,                    # a dataset with a "prompt" column
)
```

The `call_my_judge` function and `PRINCIPLES` are placeholders for your own judge client; the trainer arguments match the TRL 1.18.2 source, which documents custom reward functions as receiving the prompts and completions and returning a list of rewards.

**An evaluation team auditing a judge.** Before trusting a judge as a reward, they measure its κ against human labels, its order consistency and its preference for longer answers on a fixed set. The same checks underpin [agent evaluation with LLM judges](/articles/agent-evaluation-trajectories-judges-benchmarks).

## What it means in practice

AI feedback is now a normal part of post-training, but it moves the problem rather than solving it. With humans, the question is whether labellers agree. With RLAIF, the question is whether the judge agrees with the people you care about, and whether the policy can find the judge's blind spots. The Berkeley result, a 4.3-point spread from changing only the judge, shows the judge is a modelling choice as important as the policy's learning rate.

Constitutional AI adds something valuable: the values are written down. A list of principles, or a full constitution like the one Anthropic published in January 2026, can be read, argued about and revised, which is harder with thousands of individual human labels. The trade-off is that principles are only as good as the model applying them.

## What to do now

1. **Write principles before prompts.** State what "better" means in plain sentences, as CAI does, and keep them short enough to fit in every judge call.
2. **Score every pair in both orders.** Average the two soft labels; our simulation raised κ from 0.488 to 0.612 with this alone.
3. **Use soft labels, not votes.** Read the token probabilities and train with the cross-entropy loss, so the reward model inherits the judge's uncertainty.
4. **Clamp overconfident labels.** If the judge reasons step by step, clamp probabilities into a band such as 40 to 60%, as CAI did.
5. **Validate against humans first.** Label a few hundred pairs yourself and report agreement and κ before any training run.
6. **Use two different judges and drop disagreements.** Averaging alone did not help in the Berkeley study; filtering disagreements did.
7. **Prefer rubrics for open-ended tasks.** Item-by-item rubric scores were more reliable than a single Likert score in the RaR results.
8. **Keep some human labels.** CAI kept human helpfulness data; use people where the judge's errors cost most.

## Risks and open questions

**The judge's biases become the policy's biases.** Position, length and self-preference biases pass straight into the reward and then into behaviour.

**Policies can exploit the judge.** A policy trained against a fixed judge will find its weak spots, just as RLHF policies find reward-model weak spots.

**Circularity limits what can be learned.** A model judged by a similar model may reinforce shared blind spots rather than correct them.

**Principles leave room for interpretation.** Two models can read the same principle differently, and the Berkeley study found one judge more lenient in 99.61% of the masked disagreements.

**Watch next:** whether rubric-based rewards with disagreement filtering become standard in open trainers, how published constitutions change over time, and whether direct AI scoring during RL (d-RLAIF) replaces trained reward models. Background on human-labelled feedback is on our [RLHF page](/tools/rlhf), and safety testing on the [red-teaming page](/tools/red-teaming).

## Frequently asked questions

### What is the difference between RLAIF and Constitutional AI?

RLAIF is the general method: train with preference labels produced by an AI model instead of people. Constitutional AI is a specific recipe from Anthropic that uses RLAIF in its second stage and adds a first stage of critique and revision, both guided by a written list of principles. All Constitutional AI uses RLAIF, but not all RLAIF uses a constitution.

### Does RLAIF really work as well as RLHF?

In Lee and colleagues' experiments, RLAIF and RLHF policies were preferred about equally in head-to-head comparisons: 50% on summarisation and 52% on helpful dialogue. RLAIF scored higher on harmlessness, 88% against 76%. Results depend on the labeller's quality, and smaller labellers agreed less with people and showed more position bias.

### Why use soft labels instead of the judge's yes or no?

A soft label keeps the judge's uncertainty. When the judge is only 60% sure, the reward model is trained to be only about 60% sure, rather than learning a confident gap from a coin flip. Both the CAI and RLAIF papers used probabilities from token log-probabilities for this reason.

### How do you remove position bias from an AI judge?

Show each pair twice, once in each order, and average the two probabilities after flipping the second: p(A better) = ½ [p_AB + (1 − p_BA)]. This cancels a constant preference for one slot. Also track how often the judge picks the same slot in both orders, since that rate measures pure position preference.

### Can I do RLAIF with TRL today?

Yes. TRL 1.18.2 has no separate judge class, but `GRPOTrainer` and `RLOOTrainer` accept custom Python reward functions, so you can call any judge inside one and return a score per completion. You can also label pairs offline with a judge and train with `RewardTrainer` or DPO. See our [DPO derivation](/articles/dpo-loss-derivation-implicit-reward) for the offline route.

## Summary

RLAIF replaces human preference labels with labels from a language model, and Constitutional AI guides that model with written principles in two stages: critique and revision for supervised data, then AI preference labels for RL. The technical core is turning judgements into good labels: a softmax over the answer tokens gives soft labels, scoring both orders removes position bias, and clamping tames overconfident reasoning. In our worked example, a 0.832 first-order verdict became a 0.691 debiased label, and in the simulation, scoring both orders raised κ from 0.488 to 0.612. Published results show RLAIF matching RLHF head-to-head, while 2026 work on rubrics and multiple judges shows the judge itself is now one of the most important design choices. More on judges is on the [LLM-as-judge page](/tools/llm-as-judge) and the [RLAIF page](/tools/rlaif).

## Sources

- [arXiv: Constitutional AI: Harmlessness from AI Feedback (Bai et al., 2022)](https://arxiv.org/abs/2212.08073)
- [arXiv: RLAIF vs. RLHF: Scaling Reinforcement Learning from Human Feedback with AI Feedback (Lee et al.)](https://arxiv.org/abs/2309.00267)
- [Anthropic: Claude's new constitution](https://www.anthropic.com/news/claude-new-constitution)
- [arXiv: Rubrics as Rewards: Reinforcement Learning Beyond Verifiable Domains (Gunjal et al.)](https://arxiv.org/abs/2507.17746v2)
- [ICLR 2026: Rubrics as Rewards poster](https://iclr.cc/virtual/2026/poster/10008552)
- [arXiv: Judging the Judges: Confidence and Disagreement in Rubrics as Rewards (Liu et al.)](https://arxiv.org/pdf/2610.21179)
- [Hugging Face: TRL v1.0, post-training library built to move with the field](https://huggingface.co/blog/trl-v1)
- [PyPI: trl 1.18.2](https://pypi.org/project/trl/1.18.2/)
