---
title: "RLAIF Explained: Constitutional AI and AI Feedback vs RLHF"
description: "RLAIF replaces human preference labels with labels from an AI model. How Constitutional AI does it, what Google measured against RLHF, and the pitfalls."
url: https://launchkudos.com/news/llm-fine-tuning-rlaif
section: AI
author: "Arnab Gupta"
published: 2026-12-05T02:20:36.337Z
updated: 2026-12-05T02:20:36.337Z
tags: [llm-fine-tuning, rlaif, alignment, constitutional-ai, ai-feedback]
---

# RLAIF Explained: Constitutional AI and AI Feedback vs RLHF

*RLAIF replaces human preference labels with labels from an AI model. How Constitutional AI does it, what Google measured against RLHF, and the pitfalls.*

*Part 12 of 15 in [LLM fine-tuning techniques](https://launchkudos.com/news/llm-fine-tuning-techniques)*

Reinforcement learning from AI feedback (RLAIF) is [RLHF](https://launchkudos.com/news/llm-fine-tuning-rlhf) with the human labeler replaced by a language model: an AI picks the better of two responses, a reward model learns from those picks, and RL does the rest. Anthropic introduced it in its December 2022 Constitutional AI paper, and Google researchers compared it head to head with RLHF in 2023.

- 50% · RLAIF vs RLHF win rate, summarization (equal preference) · Lee et al., 2023, Table 1
- 88% vs 76% · harmless rate, RLAIF vs RLHF · Lee et al., 2023, Table 1
- 16 · written principles used instead of human harmlessness labels · Bai et al., 2022
## What is RLAIF?

RLAIF is preference-based RL in which the preference labels come from an AI model instead of people. In Constitutional AI, "the only human oversight is provided through a list of rules or principles", and a model uses those principles to judge which of two answers is less harmful ([Bai et al., 2022, abstract](https://arxiv.org/abs/2212.08073)). Lee et al. define it as training the reward model "on preferences generated by an off-the-shelf LLM" ([Lee et al., 2023, abstract](https://arxiv.org/abs/2309.00267)).

Everything after labeling is unchanged from RLHF: once the AI labels exist, "the remainder of the training pipeline (i.e., preference model training and RL) is exactly the same as RLHF" ([Bai et al., Sec. 4.1](https://arxiv.org/abs/2212.08073)).

## How does RLAIF work?

In Constitutional AI, RLAIF runs in two phases. A supervised phase has the model critique and revise its own harmful answers against written principles, then fine-tunes on the revisions. An RL phase has an AI feedback model choose the less harmful of two answers, trains a preference model on those choices plus human helpfulness labels, and runs RL against it ([Bai et al., 2022, Sec. 1.2](https://arxiv.org/abs/2212.08073)).

![Diagram: Constitutional AI pipeline. Phase 1 supervised: harmful prompt, model answer, self-critique by a principle, revision, fine-tune on revisions. Phase 2 RL: two answers, AI labeler picks the less harmful one using 16 sampled principles, preference model trained on AI harmlessness and human helpfulness labels, then RL; with Lee et al. 2023 win rates](https://launchkudos.com/media/51f04ed9609617057a4f.webp)

### Phase 1: critique, revise, fine-tune (SL-CAI)

1. Start from a helpful RLHF model and give it red-teaming prompts designed to draw out harmful answers.
2. Ask it to critique its own answer against a principle, then to revise the answer. Principles are "randomly sampled at each revision step"; Anthropic wrote 16 of them for harmlessness ([Sec. 3.1](https://arxiv.org/abs/2212.08073)).
3. Repeat the critique-revision loop if wanted. The authors found "the first revision almost always removed most aspects of harmfulness".
4. Fine-tune a pretrained model on the revisions from all revision steps, plus answers sampled from the helpful RLHF model on helpfulness prompts "to retain helpfulness as much as possible". The result is called SL-CAI.

Scale used: 42,496 human-written red-team prompts plus 140,335 model-generated ones (182,831 total), 4 critique-revision pairs per prompt, and 135,296 human-written helpfulness prompts ([Sec. 3.2](https://arxiv.org/abs/2212.08073)).

### Phase 2: AI preference labels, preference model, RL (RL-CAI)

1. The SL-CAI model writes two answers to each harmful prompt.
2. A feedback model sees the conversation, a principle and both answers as a multiple-choice question. One of the paper's principles: "Which of these assistant responses is less harmful? Choose the response that a wise, ethical, polite and friendly person would more likely say."
3. The normalized log-probabilities of "(A)" and "(B)" become a soft preference label ([Sec. 4.1](https://arxiv.org/abs/2212.08073)).
4. A preference model is trained on 135,296 human helpfulness comparisons plus 182,831 AI-generated harmlessness comparisons ([Sec. 4.2](https://arxiv.org/abs/2212.08073)).
5. The SL-CAI model is trained with RL against that preference model, exactly as in RLHF.

**Chain-of-thought variant.** The feedback model can first reason step by step ("Let's think step-by-step"). Because CoT labels came out near 0 or 1, the authors clamped the probabilities to the 40-60% range, which "led to better and more robust behavior" ([Sec. 4.1](https://arxiv.org/abs/2212.08073)).

### Google's version: canonical RLAIF and direct RLAIF

Lee et al. use the same reward-model route, which they call canonical RLAIF, with PaLM 2 Large as the labeler. To reduce position bias, they ask the labeler twice with the answers in swapped order and average the two results ([Lee et al., Sec. 2.1.1](https://arxiv.org/abs/2309.00267)). They also introduce **direct RLAIF (d-RLAIF)**, which skips reward-model training: the LLM rates each response during RL and that rating is the reward ([Sec. 2.2.2](https://arxiv.org/abs/2309.00267)).

## When was RLAIF introduced, and by whom?

| Paper | Authors | First on arXiv | Venue |
|---|---|---|---|
| [Constitutional AI: Harmlessness from AI Feedback](https://arxiv.org/abs/2212.08073) | Yuntao Bai, Saurav Kadavath, Sandipan Kundu, Amanda Askell and 47 co-authors, ending with Jared Kaplan (Anthropic) | Dec. 15, 2022 | arXiv preprint |
| [RLAIF vs. RLHF: Scaling Reinforcement Learning from Human Feedback with AI Feedback](https://arxiv.org/abs/2309.00267) | Harrison Lee, Samrat Phatale, Hassan Mansoor, Thomas Mesnard, Johan Ferret, Kellie Lu, Colton Bishop, Ethan Hall, Victor Carbune, Abhinav Rastogi, Sushant Prakash (Google DeepMind, Google) | Sept. 1, 2023 | ICML 2024 |

Lee et al. credit the term to Anthropic: RLAIF was "introduced in Bai et al. (2022b)" ([abstract](https://arxiv.org/abs/2309.00267)). Anthropic published the principles and few-shot prompts in a [GitHub repository](https://github.com/anthropics/ConstitutionalHarmlessnessPaper).

## What results did the RLAIF papers report?

**Constitutional AI (2022).** On 52B models, RL-CAI models were "significantly more harmless than the RLHF and SL-CAI models", judged by crowdworker Elo scores ([Sec. 4.3, Figures 2, 3 and 8](https://arxiv.org/abs/2212.08073)). The abstract describes the result as "a harmless but non-evasive AI assistant that engages with harmful queries by explaining its objections to them". On 438 binary comparison questions for helpfulness, honesty and harmlessness, chain-of-thought improved AI evaluation accuracy, and the trends "suggest that models larger than 52B will be competitive with human feedback-trained preference models" ([Figure 4](https://arxiv.org/abs/2212.08073)). The CoT variant was "slightly less helpful but slightly more harmless" than RL-CAI without CoT.

**RLAIF vs. RLHF (2023).** Policies were PaLM 2 Extra-Small; AI labels came from PaLM 2 Large unless stated. All numbers are human evaluations ([Lee et al., Table 1, Sec. 4](https://arxiv.org/abs/2309.00267)):

| Comparison | Summarization | Helpful dialogue | Harmless dialogue (harmless rate) |
|---|---|---|---|
| RLAIF vs SFT (win rate) | 71% | 63% | RLAIF 88% |
| RLHF vs SFT (win rate) | 73% | 64% | RLHF 76% |
| RLAIF vs RLHF (win rate) | 50% | 52% | SFT 64% |
| Same-size RLAIF vs SFT (labeler = PaLM 2 XS) | 68% | | |
| d-RLAIF vs SFT | 74% | 66% (labeler = same checkpoint as policy) | |
| d-RLAIF vs same-size RLAIF | 60% | | |

Key readings, in the authors' words: RLAIF and RLHF summaries are "equally preferred", meaning the 50% summarization head-to-head is not statistically different from 50%; the RLAIF-vs-SFT and RLHF-vs-SFT gaps are "not statistically significant"; for harmlessness RLAIF's 88% is a statistically significant improvement over RLHF and SFT. Because the d-RLAIF helpfulness labeler was "exactly the same model checkpoint" as the starting policy, the authors call that run "a strict example of LLM self-improvement".

**Labeler quality.** PaLM 2 L agreed with human preferences 78.0% of the time on summarization, PaLM 2 S 73.8% and PaLM 2 XS 62.7% ([Table 3](https://arxiv.org/abs/2309.00267)). For comparison, the authors cite Stiennon et al.'s estimate of 73-77% agreement between human annotators.

**Cost.** Lee et al. estimate LLM labeling at "over 10x cheaper than human annotation", using GPT-4 API prices at the time of writing ([Sec. 4.1, Appendix L](https://arxiv.org/abs/2309.00267)).

## How is RLAIF different from RLHF and DPO?

RLAIF differs from RLHF only in who produces the preference labels; the reward model and RL step are the same. It differs from [DPO](https://launchkudos.com/news/llm-fine-tuning-dpo) in keeping a reward model and an RL loop, although AI-labeled pairs can also feed DPO.

| | RLHF | RLAIF (canonical) | d-RLAIF | DPO |
|---|---|---|---|---|
| Preference labels from | Humans | An LLM (with principles or a prompt) | An LLM, scoring during RL | Any labeled pairs |
| Reward model | Trained | Trained on AI labels | None; LLM score is the reward | None |
| RL step | Yes | Yes | Yes | No |
| Human input in the papers | Thousands of comparisons | Constitution of 16 principles; human helpfulness labels in CAI | Prompt for the LLM rater | The preference dataset |

## Which libraries support RLAIF?

No official library implements Constitutional AI or the RLAIF pipeline from either paper end to end, so this page shows no code. What exists:

- **The labeling step** has no official library. Anthropic's [repository](https://github.com/anthropics/ConstitutionalHarmlessnessPaper) publishes the principles and few-shot prompts, not training code.
- **The training steps** after labeling are the same as RLHF's. TRL's [`RewardTrainer`](https://huggingface.co/docs/trl/reward_trainer) takes any preference dataset with `chosen` and `rejected` columns, and [`RLOOTrainer`](https://huggingface.co/docs/trl/rloo_trainer) takes a reward model or a reward function. See the code on the [RLHF page](https://launchkudos.com/news/llm-fine-tuning-rlhf).
- **A related method in TRL:** the experimental [`OnlineDPOTrainer`](https://huggingface.co/docs/trl/online_dpo_trainer) is based on "Direct Language Model Alignment from Online AI Feedback" (Guo et al., 2024), which "uses an LLM as annotator". In TRL v1.19.0 it takes `reward_funcs` (a model path, model or callable) and lives at `trl.experimental.online_dpo`. That is online DPO, not the RLAIF pipeline of Bai et al. or Lee et al.

## Common pitfalls

- **Position bias in the AI labeler.** The order of the two answers changes which one an LLM prefers, "especially prevalent in smaller LLM labelers"; Lee et al. average two calls with the order swapped ([Sec. 2.1.1](https://arxiv.org/abs/2309.00267)).
- **Overconfident chain-of-thought labels.** CoT labels came out near 0 or 1; without clamping to 40-60%, "RL-CAI models would learn to output more extreme responses" ([Bai et al., Sec. 4.1](https://arxiv.org/abs/2212.08073)).
- **Goodharting.** Over-trained RL-CAI models became "overly harsh" or added boilerplate such as "you are valid, valued, and cared for" to most red-team answers ([Bai et al., Sec. 4.3](https://arxiv.org/abs/2212.08073)).
- **Small labelers are less accurate.** Agreement with humans fell from 78.0% (PaLM 2 L) to 62.7% (PaLM 2 XS) ([Lee et al., Table 3](https://arxiv.org/abs/2309.00267)).
- **More prompting is not always better.** Self-consistency "strictly degrades AI labeler alignment", and few-shot examples lowered alignment for summarization and helpfulness ([Lee et al., Sec. 4.4](https://arxiv.org/abs/2309.00267)).
- **Mixing human and AI feedback did not help in Lee et al.** They "did not see an improvement beyond using human feedback alone" ([Sec. 4.1](https://arxiv.org/abs/2309.00267)).
- **Length bias.** RLAIF and RLHF policies wrote longer responses than SFT, which "may bias human evaluation"; both still beat SFT after a length-controlled analysis ([Sec. 4.1, Appendix J](https://arxiv.org/abs/2309.00267)).

> **How we checked this**
> We read the full text of Bai et al. (arXiv 2212.08073 v1) and Lee et al. (2309.00267 v3, the ICML 2024 version) on Dec. 4, 2026, and took every number from the sections and tables cited. Author lists and dates are from the arXiv abstract pages. Library claims were checked against the TRL v1.19.0 docs for RewardTrainer, RLOOTrainer and OnlineDPOTrainer, and Anthropic's paper repository, the same day. We found no official library that implements either paper's RLAIF pipeline, so we show no code.

## FAQ

### What does RLAIF stand for?
Reinforcement learning from AI feedback. It replaces the human preference labels in RLHF with labels produced by an AI model. Anthropic introduced it in its 2022 Constitutional AI paper.

### Is RLAIF as good as RLHF?
In Lee et al.'s summarization test, human raters preferred RLAIF and RLHF outputs equally (50% head to head). For harmless dialogue, RLAIF scored an 88% harmless rate against 76% for RLHF. The paper used PaLM 2 models.

### What is Constitutional AI?
Anthropic's method for training a harmless assistant without human harmlessness labels. A model critiques and revises its own answers using 16 written principles, then an AI labeler guided by those principles produces preference labels for RL.

### Does RLAIF need any human labels?
Constitutional AI still used human labels for helpfulness and human-written principles; only harmlessness labels came from AI. Lee et al. used human-written prompts for the AI labeler and human raters for evaluation.

### Is RLAIF cheaper than RLHF?
Lee et al. estimate AI labeling at over 10x cheaper than human annotation, based on GPT-4 API prices when the paper was written. Training costs after labeling are the same as RLHF.

### Can a model improve from its own feedback?
Lee et al. report one strict case: in helpful dialogue, d-RLAIF used the same checkpoint as both labeler and starting policy and was preferred over the SFT baseline 66% of the time.

### Which library should I use for RLAIF?
No official library implements the papers' full RLAIF pipeline. The labeling step is custom; the reward-model and RL steps can use the same TRL trainers as RLHF, RewardTrainer and RLOOTrainer.

## Related techniques

- [RLHF](https://launchkudos.com/news/llm-fine-tuning-rlhf): the same pipeline with human labels (Part 11)
- [DPO](https://launchkudos.com/news/llm-fine-tuning-dpo): preference tuning without a reward model or RL (Part 13)
- [GRPO](https://launchkudos.com/news/llm-fine-tuning-grpo): group-relative policy optimization (Part 14)
- [RLVR](https://launchkudos.com/news/llm-fine-tuning-rlvr): rewards from answer checkers instead of preferences (Part 15)
- [All 15 LLM fine-tuning techniques](https://launchkudos.com/news/llm-fine-tuning-techniques)

## Sources

- Bai, Y., Kadavath, S., Kundu, S., Askell, A., et al. (2022). [Constitutional AI: Harmlessness from AI Feedback](https://arxiv.org/abs/2212.08073). arXiv:2212.08073, Dec. 15, 2022. Read Dec. 4, 2026.
- Lee, H., Phatale, S., Mansoor, H., Mesnard, T., Ferret, J., Lu, K., Bishop, C., Hall, E., Carbune, V., Rastogi, A., Prakash, S. (2023). [RLAIF vs. RLHF: Scaling Reinforcement Learning from Human Feedback with AI Feedback](https://arxiv.org/abs/2309.00267). arXiv:2309.00267, v1 Sept. 1, 2023, v3 Sept. 3, 2024; ICML 2024. Read Dec. 4, 2026.
- Anthropic. [ConstitutionalHarmlessnessPaper repository](https://github.com/anthropics/ConstitutionalHarmlessnessPaper). Checked Dec. 4, 2026.
- Hugging Face. [TRL Reward Trainer](https://huggingface.co/docs/trl/reward_trainer), [RLOO Trainer](https://huggingface.co/docs/trl/rloo_trainer), [Online DPO Trainer](https://huggingface.co/docs/trl/online_dpo_trainer), v1.19.0. Checked Dec. 4, 2026.
- Guo, S., et al. (2024). [Direct Language Model Alignment from Online AI Feedback](https://huggingface.co/papers/2402.04792). arXiv:2402.04792. Abstract checked via the TRL docs, Dec. 4, 2026.

**Series:** [← Prev: RLHF](https://launchkudos.com/news/llm-fine-tuning-rlhf) · [All 15 techniques](https://launchkudos.com/news/llm-fine-tuning-techniques) · [Next: DPO →](https://launchkudos.com/news/llm-fine-tuning-dpo)
