Paper · 2022-12-15 · cs.CL, cs.AI
Constitutional AI: Harmlessness from AI Feedback
Trains a helpful, harmless assistant with no human harmlessness labels. Supervised stage: the model critiques and revises its answers to red-team prompts under written principles, then is finetuned on the revisions. RL stage: the model picks the less harmful of two answers to train a preference model for RL (RLAIF). Crowdworkers rate it more harmless than RLHF (author-reported; plots only).
Reinforcement learning from human feedback (RLHF)Reinforcement learning from AI feedback (RLAIF)Self-refinement (draft, critique, rewrite loop)Red teamingrlaifself-critiqueharmlessnesspreference-modelconstitutional-ai
arXivPDFCodeMarkdown10 min read
AI-compiled by claude-haiku-5-5 on 2026-10-24, not yet reviewed by a human. Every claim cites its source; check it when a detail matters.
In plain words
Assistants like chatbots are usually taught to behave by people who compare pairs of answers and say which is better. Teaching them to avoid harmful answers this way takes a large pile of human judgments. This paper asks how far the model can do that work itself, guided by a short list of written rules, called a constitution.
The training has two stages. In the first, the model answers a provocative question, then reads its own answer, points out what is harmful about it under one of the rules, and rewrites it. The rewritten answers are used to train the model again. In the second stage, the model compares pairs of its own answers and picks the less harmful one, using the same rules. Those picks train a reward model, which then guides reinforcement learning as in the usual recipe.
The result is an assistant that avoids harm but still engages with hard questions and explains why it objects, instead of refusing with a canned reply. Human judgments are still used for helpfulness, so the method removes the human harmlessness labels, not all human feedback.
TL;DR
The paper trains a helpful assistant to be harmless using a list of 16 written principles instead of human harmlessness labels [§1.1, §3.1, §4.1]. Stage one (supervised) finetunes on self-critiqued, self-revised answers §3. Stage two (RLAIF) trains a preference model on AI-labelled comparisons and runs RL against it §4. The authors report that RL-CAI is rated more harmless than RLHF baselines by crowdworkers, and that it is virtually never evasive §4.3, §4.4. The paper gives few numbers in the text; most results are plots, and all results are author-reported.
Problem
Standard RLHF typically uses at least tens of thousands of human feedback labels, and the authors want to reduce human supervision to a small number of written principles §1.1. Their earlier helpful-and-harmless assistant often gave evasive answers to controversial questions, and evasiveness was rewarded by the crowdworkers who labelled its data §1.1, §4.4. The aim is a harmless assistant that is also non-evasive and that explains its objections §1.1.
Method
The method has two stages fig. 1 §1.2. Both use a small constitution of principles, which are written natural-language instructions. Stage one is supervised learning on self-revised responses. Stage two is RL from AI feedback (RLAIF).
Stage 1: critique, revision, supervised learning §3
- Start from a helpful RLHF model, meaning one trained to follow instructions with only helpfulness labels §1.4 §3.
- Build the red-team prompt set: 42,496 human-written prompts from prior red teaming work, plus 140,335 prompts generated by few-shot prompting a pre-trained model, for 182,831 in total §3.2.
- For each prompt, sample an initial response from the helpful model at temperature 1 §3.1 §3.2.
- In each round, draw one principle at random from the 16 principles §3.1 app. C.
- Append the principle's critique request to the conversation and sample a critique §3.1.
- Append the principle's revision request and sample a revised response §3.1.
- Use the initial prompt and the revised response as the new pair, and repeat from step 4. The paper uses 4 revisions per prompt §3.1 §3.2. The critique text is not part of the pair §3.1.
- Few-shot examples of critiques and revisions, formatted the same way, are prepended to the requests so the model does not confuse the two roles §3.1 app. E.1.
- Helpfulness data: 135,296 human-written helpfulness prompts, with 2 responses each sampled from the helpful model at temperature 1 §3.2.
- Finetune a pre-trained language model (not the RLHF model) for one epoch on all revisions from every round, plus the helpfulness samples §3.1 §3.2. The result is the SL-CAI model.
# Critique-revision data for supervised finetuning [§3.1] [§3.2]
# Inputs: helpful RLHF model, 16 principles, red-team prompts
# Output: (prompt, revised response) pairs
# Few-shot examples [app. E.1] are prepended to every call; omitted here.
def make_revision_pairs(helpful_model, principles, red_team_prompts):
pairs = []
for prompt in red_team_prompts:
# Sample an initial response at temperature 1 [§3.2]
response = sample(helpful_model, prompt, temperature=1.0)
for step in range(4):
# Draw one principle at random for this round [§3.1]
principle = random_choice(principles)
# Append the critique request and sample a critique [§3.1]
context = prompt + response + principle.critique_request
critique = sample(helpful_model, context)
# Append the revision request and sample a revision [§3.1]
context = context + critique + principle.revision_request
response = sample(helpful_model, context)
# The prompt and revision form the next training pair [§3.1]
pairs.append((prompt, response))
return pairsThe paper also tests a variant without critiques, which asks for a revision directly §3.5 fig. 7. The main results use critiqued revisions §3.5.
Stage 2: AI preference labels, preference model, RL §4
- For each prompt, sample a pair of responses from the SL-CAI model §4.1.
- Build a multiple-choice question for a feedback model. It contains the conversation, one principle, and the two responses labelled (A) and (B). The paper prepends few-shot examples in the same format, each with its own sampled principle §4.1 app. E.2.
- Read the normalised probabilities of answers (A) and (B). Use them as soft targets for a comparison example §4.1.
- Pick the principle at random for each comparison from the 16 principles §4.1.
- Combine the labels for the preference model: 135,296 human helpfulness comparisons and 182,831 AI harmlessness comparisons §4.2. Train it with the process of prior work §1.2.
- Run RL against this preference model, starting from the SL-CAI model. The pipeline is otherwise the RLHF pipeline §4.1 §1.2. The result is RL-CAI.
The chain-of-thought variant changes the feedback step. It uses the helpful RLHF model as the feedback model, writes the question as a Human/Assistant dialogue, and asks it to reason step by step before answering. Hand-written few-shot examples with reasoning are prepended §4.1 app. E.2. Because the reasoning usually commits to one answer, the paper clamps the probability to the 40–60% range before using it as a target §4.1 §4.3.
# AI preference labels for harmlessness [§4.1]
# Inputs: SL-CAI policy, feedback model, 16 principles, prompts
# Output: comparisons with soft targets for the preference model
# Few-shot examples [app. E.2] are prepended to the feedback prompt; omitted.
def make_ai_labels(policy, feedback_model, principles, prompts):
labels = []
for prompt in prompts:
# Sample a pair of responses from the SL-CAI policy [§4.1]
response_a = sample(policy, prompt)
response_b = sample(policy, prompt)
# Draw one principle at random for this comparison [§4.1]
principle = random_choice(principles)
# Format the conversation and the two options as a question [§4.1]
question = format_choice(
prompt,
principle,
response_a,
response_b,
)
# Read the normalised probabilities of answers (A) and (B) [§4.1]
p_a, p_b = choice_probabilities(feedback_model, question)
labels.append((prompt, response_a, response_b, p_a, p_b))
return labels
# Chain-of-thought variant: clamp the (A) probability [§4.1] [§4.3]
# The paper does not say whether (B) is clamped separately.
def clamp_cot_label(p_a):
# Keep the probability between 40% and 60% [§4.1] [§4.3]
return min(max(p_a, 0.4), 0.6)Hyperparameters
Values are as written in this paper. Items the paper defers to prior work or leaves out are marked "not stated".
| Name | Value | Where | Notes |
|---|---|---|---|
| Principles (constitution) | 16 for critiques, 16 for AI labels | §3.1 §4.1 app. C | Written ad hoc for the research §1.1 app. C |
| Principle selection per round | random draw | §3.1 §4.1 | Distribution not stated; "randomly" only |
| Red-team prompts (SL) | 182,831 (42,496 human + 140,335 generated) | §3.2 | |
| Revisions per red-team prompt | 4 | §3.2 | SL-CAI-n uses revisions up to n, n = 1 to 4 §3.4 |
| Helpfulness prompts (SL) | 135,296 human-written, 2 responses each | §3.2 | Sampled from helpful RLHF model |
| Sampling temperature (SL data) | T = 1 | §3.2 | Stated as "always" for these samples |
| SL epochs | 1 | §3.2 | |
| SL learning rate | constant, 0.5 × pre-training LR | §3.2 | Absolute value not stated |
| SL batch size | 1024 sequences | §3.2 | |
| Initial model size (main results) | 52B parameters | §3.3 fig. 9 fig. 10 | Other sizes shown in fig. 3 |
| PM comparisons, helpfulness | 135,296 (human) | §4.2 | |
| PM comparisons, harmlessness | 182,831 (AI-labelled) | §4.2 | One per SL-CAI prompt |
| RL prompts | all SL prompts, plus 491,142 red-team and 474,300 helpfulness prompts | §4.2 | Extra prompts are model-generated |
| RL hyperparameters | "same as prior work" | §4.2 | Learning rate, batch size, KL, steps: not stated here |
| RLHF baseline initialisation | pre-trained model, not context-distilled | §4.2 | Differs from prior work |
| Feedback model | "typically a pretrained LM" | §4.1 | Size for labels in fig. 9: 52B |
| Sampling temperature (RL pairs) | not stated | §4.1 | |
| CoT probability clamp | 40–60% | §4.1 §4.3 | 20–80% tried; 40–60% used §4.3 |
| Few-shot examples (SL and feedback) | count not stated | app. E.1 app. E.2 | Repository has the prompt files |
| HHH evaluation set | 438 binary comparisons (221 original, 217 new) | §2 | |
| Harmful vs ethical evaluation | 254 balanced conversations | app. B | |
| Harm classification | 287 items, 9 labels, 9-way multiple choice | app. B | |
| Elo tests | 10,274 helpfulness comparisons, 8,135 further comparisons, 24 snapshots | §3.3 | Crowdworker A/B tests |
| Absolute harm evaluation | 64 held-out prompts, 256 responses each, scale 0–4 | §4.5 | Sampled at T = 1 and T = 0 fig. 10 |
Results
Author-reported. Setup: crowdworker A/B tests for Elo scores, with 52B-scale models as the main comparison §3.3 §4.3. Hardware and training time are not stated. The text gives few numbers, so most results are read from plots.
| Setting | Metric | Baseline | Reported result | Source |
|---|---|---|---|---|
| Original HHH set (221 items) | binary accuracy | — | Models reach "well over 90%" | §2 fig. 11 |
| 438-item HHH set | binary accuracy, preference model vs multiple-choice LM | Human-feedback PM | Chain-of-thought helps significantly for larger models; the trend suggests models above 52B may match the PM | §2 fig. 4 |
| Harmful vs ethical (254) | accuracy | Zero-shot | Chain-of-thought and few-shot prompting both improve over zero-shot | app. B fig. 12 |
| 9-way harm classification (287) | accuracy | — | Figure shows accuracy for models of several capabilities; no numbers in text | app. B fig. 12 |
| SL-CAI vs helpful RLHF | harmlessness and helpfulness Elo | Helpful RLHF | More harmless than helpful RLHF, less helpful than both RL models, more harmful than HH RLHF | §3.3 fig. 3 |
| Revisions | harmlessness PM score | Initial response | Harmlessness and HH PM scores rise with each revision; helpfulness scores fall | fig. 5 |
| Number of principles | harmlessness PM score | — | No clear effect on score; more principles expected to add diversity, not measured | §3.4 fig. 6 |
| Critiqued vs direct revision | harmlessness PM score | Direct revision | Critiqued revisions better for small models; similar at 52B, with critiques slightly ahead | §3.5 fig. 7 |
| RL-CAI vs RLHF and HH | harmlessness and helpfulness Elo | RLHF, HH RLHF | Reported as significantly more harmless, with a small helpfulness cost | §4.3 fig. 2 fig. 8 |
| RL-CAI labels | calibration | Diagonal | Log-probabilities described as reasonably well calibrated on the HHH set | §4.3 fig. 9 |
| RL-CAI absolute harm | score, 0–4 | Helpful RLHF | Helpful RLHF becomes more harmful during training; HH, RL-CAI and RL-CAI CoT become less harmful | §4.5 fig. 10 |
| Totals behind the Elo plots | comparisons | — | 10,274 helpfulness and 8,135 further comparisons over 24 snapshots | §3.3 |
Paper vs code
The paper's footnote links an official repository at GitHub, owned by the authors' organisation §1.3. The repository is "supplementary material"; its README says so README.md. It contains the critique and revision instructions, the RL labelling instructions, and few-shot prompts, plus the evaluation sets and sample responses CritiqueRevisionInstructions.json RLMadisonInstructions.json 438HHHEvaluations.jsonl.
Checks that match the paper:
- The evaluation files have 438, 254 and 287 items, matching §2 and app. B.
- Both instruction sets have 16 principles, matching §3.1 and §4.1.
What the repository does not contain: any supervised or RL training code. The training hyperparameters in Hyperparameters therefore cannot be checked against code. The repository has no LICENSE file, so nothing from it is quoted here; it is cited only by path.
No discrepancies found in the parts that can be checked.
Pitfalls
- RL is under-specified here. The paper says RL used the same hyperparameters as prior work §4.2. Learning rate, batch size, KL penalty and step count are not stated in this paper.
- Absolute SL learning rate is missing. It is given only as 0.5 times the pre-training rate §3.2, and the pre-training rate is not stated.
- Critiques are often wrong. The authors found them frequently inaccurate or overstated, while the revisions were still more harmless §3.5 app. A. An implementation should not treat critique text as reliable. It is kept for transparency §3.5.
- Critique text is not in the training pair. The training pair is the prompt and the final revision §3.1.
- Clamp target is ambiguous. The paper says the CoT probabilities are clamped to 40–60% §4.1 but does not say whether (A) alone is clamped or (B) too. Without the clamp, RL-CAI learns more extreme responses §4.1.
- Soft versus hard labels is qualitative. Without CoT, the paper reads labels from the log-probabilities of (A) and (B) and reports soft labels as much better than hard 0/1 labels, with no numbers §4.1 §4.3. With CoT it could not extract soft labels without sampling several CoT outputs per label §4.3.
- Evaluation protocol changed from prior work. Crowdworkers were told to prefer thoughtful answers over evasive ones when both are equally harmless §4.4. Harmlessness Elo scores are therefore not directly comparable with the prior HH paper §3.3 footnote §4.4.
- Over-training causes boilerplate. RL-CAI, when over-trained, can answer with reassurance boilerplate and overly harsh refusals §4.3.
- Preference-model scores lose calibration at high values §3.4. Revision scores in fig. 5 should be read with this in mind.
- Helpfulness falls as revisions increase fig. 5. The harmlessness gain has a helpfulness cost.
- Human labels are not fully removed. Helpfulness still uses human labels. The authors say so §6.
- Principles were written ad hoc. The authors say they were not carefully designed and should be refined by more stakeholders §1.1 app. C.
- Hidden cost. Every red-team prompt needs several rounds of critique and revision. The appendix says these come from the 52B helpful model §3.2 app. A. CoT labels add generated reasoning per comparison §4.1.
- Feedback model size. The text says "typically a pretrained LM" §4.1. The calibration figure's caption gives 52B labels fig. 9. Treat the feedback model size as stated only in that caption.
Lineage
- Builds on: Bai et al. 2022, RLHF for a helpful and harmless assistant. This paper reuses its pipeline and helpfulness labels, and removes the harmlessness labels §1.4 §4.1.
- Uses red-team prompts from: arXiv:2209.07858 (Ganguli et al.) §3.2. No card in this wiki.
- Uses chain-of-thought prompting from: arXiv:2201.11903 §4.1.
- Superseded by: not known from content in this wiki.
Source and license
Adapted from “Constitutional AI: Harmlessness from AI Feedback” by Yuntao Bai, Saurav Kadavath, Sandipan Kundu, Amanda Askell, Jackson Kernion, Andy Jones, Anna Chen, Anna Goldie, Azalia Mirhoseini, Cameron McKinnon, Carol Chen, Catherine Olsson, Christopher Olah, Danny Hernandez, Dawn Drain, Deep Ganguli, Dustin Li, Eli Tran-Johnson, Ethan Perez, Jamie Kerr, Jared Mueller, Jeffrey Ladish, Joshua Landau, Kamal Ndousse, Kamile Lukosuite, Liane Lovitt, Michael Sellitto, Nelson Elhage, Nicholas Schiefer, Noemi Mercado, Nova DasSarma, Robert Lasenby, Robin Larson, Sam Ringer, Scott Johnston, Shauna Kravec, Sheer El Showk, Stanislav Fort, Tamera Lanham, Timothy Telleen-Lawton, Tom Conerly, Tom Henighan, Tristan Hume, Samuel R. Bowman, Zac Hatfield-Dodds, Ben Mann, Dario Amodei, Nicholas Joseph, Sam McCandlish, Tom Brown, Jared Kaplan (arXiv:2212.08073), used under CC BY 4.0. Changes: condensed and restructured for implementation, with tables, equations and algorithms taken from the paper and its code, each cited to its source. Not affiliated with or endorsed by the authors. Code citations refer to https://github.com/anthropics/ConstitutionalHarmlessnessPaper at commit 831f7813dbaf (none (no LICENSE file in repository)). Any quoted code is shown under that license.