AI Safety Compendium

Shaping the model: data and training

Aligned models

Constitutional AI and rule-based rewards

Turn a written principle set into an AI-generated reward model, replacing most human harm labels.

Open in the compendium

Constitutional AI trains a model against a written list of principles instead of thousands of human labels of harmful outputs. An AI model reads the principles and judges which of two answers follows them better. Those AI judgements become the training reward. Because the rules are written down, safety training gets cheaper, easier to change and easier to inspect.

How it works

Anthropic's December 2022 method has two phases. In the first, the model answers a risky prompt, critiques its own answer against a principle (for example, that it should not help with harmful acts), rewrites the answer, and is then fine-tuned on the rewrites. In the second, the model produces two answers to each prompt, an AI judge picks the one that better fits the principles, and those choices train a preference model. Reinforcement learning then uses that preference model as its reward, a step called reinforcement learning from AI feedback (RLAIF).

Other labs use close relatives. OpenAI's Rule Based Rewards (2024) method writes fine-grained rules, such as "refusals should not be judgmental", and has a language-model grader score each answer against them directly during training. OpenAI's deliberative alignment (December 2024) goes a step further. It teaches the model the safety rules themselves and trains it to reason over them before answering.

Where research stands

The method is mature. Anthropic says its published constitution "plays a crucial role in our training process", and OpenAI has published two rule-based variants. Comparisons find that AI feedback can stand in for human feedback. In a Google DeepMind study, summaries tuned with AI feedback were preferred over a baseline 71% of the time, against 73% for human feedback, a gap that was not statistically significant. OpenAI reported that its rule-based rewards scored 97.1 on a safety-and-usefulness measure, against 91.7 for a human-feedback baseline. In February 2024 Hugging Face released datasets, models and code for constitutional training of open models.

Two questions remain open. An AI judge carries its own blind spots and biases into the reward, and the model can learn to satisfy the judge rather than the principle. The other question is who writes the principles. In October 2023 Anthropic and the Collective Intelligence Project drafted a constitution with about 1,000 Americans. It overlapped with Anthropic's own by roughly half, and a model trained on it showed lower bias on one benchmark with similar performance. Critics argue that company-written constitutions borrow the language of law without public accountability.

Key results

Open problems

See all open problems in this group

Criticisms

Who works on it

Status

Mature, in production.

Start reading

Related approaches

In their own words

The only human oversight is provided through a list of rules or principles, and so we refer to the method as 'Constitutional AI'. ... In the RL phase, we sample from the finetuned model, use a model to evaluate which of the two samples is better, and then train a preference model from this dataset of AI preferences.

Yuntao Bai et al. (Anthropic), Constitutional AI: Harmlessness from AI Feedback, 2022

Our method, Rule Based Rewards (RBR), uses a collection of rules for desired or undesired behaviors (e.g. refusals should not be judgmental) along with a LLM grader. In contrast to prior methods using AI feedback, our method uses fine-grained, composable, LLM-graded few-shot prompts as reward directly in RL training, resulting in greater control, accuracy and ease of updating.

Tong Mu et al. (OpenAI), Rule Based Rewards for Language Model Safety, 2024

Suggest a correction Something wrong, out of date or missing, such as an organisation? Opens a GitHub issue (free account needed).