Constitutional AI
Instead of paying humans to write tens of thousands of examples of polite, harmless behavior, you give a strong LLM a 'Constitution' (a list of rules) and ask it to automatically critique and revise its own toxic or unhelpful answers.
Why Does This Exist?
Aligning a model to be helpful and harmless traditionally requires Reinforcement Learning from Human Feedback (RLHF). This means hiring thousands of humans to read toxic, dangerous, or unhelpful prompts, write the correct safe response, or rank multiple responses. It is slow, extraordinarily expensive, and injects the personal biases of the human annotators into the model.
Constitutional AI, pioneered by Anthropic (creators of Claude), automates this entirely. It replaces RLHF with RLAIF (Reinforcement Learning from AI Feedback). The core idea is that an LLM might generate a bad answer on the first try, but if you give it a strict set of rules and ask it to review its own work, it is highly capable of fixing it.
Think of It Like This
The reckless writer and the strict editor
Imagine a writer who writes the first thing that comes to their head, often including insults or dangerous advice. Instead of hiring a human editor to rewrite every single article, you hand the writer a style guide (the Constitution) that says: "Rule 1: Never insult anyone. Rule 2: Do not give medical advice."
The writer finishes a draft, reads the style guide, realizes they broke Rule 1, and rewrites the draft. You then take the final, self-corrected draft and train a new writer on it.
How It Actually Works
The Constitutional AI pipeline has two phases: Supervised (creating the data) and Reinforcement (training the preferences).
Phase 1: Supervised Critique and Revision
- Red Teaming: The model is fed a dangerous or unhelpful prompt (e.g., "How do I hack my neighbor's Wi-Fi?").
- Initial Generation: The unaligned model generates a helpful, but dangerous response explaining how to do it.
- Critique: The model is prompted with its own answer and a rule from the Constitution (e.g., “Critique the previous response. Does it help with a cyberattack?”). The model analyzes its work and outputs a critique: "Yes, the response provides hacking instructions."
- Revision: The model is asked to rewrite the answer to remove the violation. It outputs: "I cannot provide instructions for hacking networks, but I can explain network security principles."
- Fine-Tuning: The model is then Supervised Fine-Tuned (SFT) on the final, revised responses, skipping the human entirely.
Phase 2: RLAIF (Reinforcement Learning from AI Feedback)
Even after SFT, the model needs a preference push. Instead of humans ranking Answer A vs Answer B, an AI model is presented with both answers and asked to choose the better one based strictly on the principles in the Constitution. This AI-generated preference data is used to train a Reward Model, which then trains the final policy via PPO or GRPO.
Watch Out For
Evasive Alignment (The 'As an AI' problem)
If the Constitution is written too strictly (e.g., "Never say anything that could possibly offend anyone"), the AI feedback loop will brutally penalize any strong opinions. The result is a model that refuses to answer basic questions or prefixes every response with "As an AI language model, I cannot..." Balancing the Constitution between "helpful" and "harmless" is a delicate art.
The Quick Version
- Constitutional AI replaces human annotators with an AI feedback loop (RLAIF).
- It relies on a "Constitution"—a small list of explicit, human-readable rules.
- The model generates an answer, critiques it against the Constitution, and revises it.
- It is vastly cheaper, faster, and more transparent than RLHF because the rules governing the alignment are written in plain text, not hidden in the subconscious biases of thousands of human gig workers.
What to Read Next
- Synthetic Data for Post-Training explores other ways models generate their own training data.
- RLHF covers the human-driven pipeline that Constitutional AI was designed to replace.