Constitutional and rule-based training
Instead of rating millions of answers by hand, write down the principles and let AI feedback apply them. Learn how Constitutional AI works, why it helps, and where it falls short.
In 60 seconds
Constitutional and rule-based training
Instead of rating millions of answers by hand, write down the principles and let AI feedback apply them. Learn how Constitutional AI works, why it helps, and where it falls short.
How Constitutional AI works, in outline
- 1
Write a constitution
A list of plain-language principles, such as "choose the response that is most helpful while avoiding harm" or "avoid responses that are preachy or condescending". - 2
Critique and revise
The model answers a prompt, then is asked to critique its own answer against a principle, then to rewrite it. The improved answers become training data. - 3
Fine-tune on the revisions
The model is trained on these revised answers, so it learns to answer better the first time. - 4
AI compares answers
For new prompts, the model produces two answers, and an AI judge picks the one that better follows a principle. This creates preference data without a human clicking on every pair. - 5
Reinforcement learning from AI feedback
Those AI preferences train the model further, just as human preferences do in RLHF. This step is often called RLAIF.
Why people find it attractive
- Transparency. The principles are written down. People can read, argue about and change them.
- Scale. AI feedback is much cheaper and faster than human rating for large amounts of data.
- Less human exposure to harmful content. Fewer people have to read disturbing outputs to rate them.
- A link to oversight. It is an early example of AI helping to supervise AI, which is the theme of lesson 2.
- Easier to update. Changing a principle can be easier than re-collecting a whole dataset of human ratings.
Limits and open questions
| Problem | What it means |
|---|---|
| Words are not behaviour | A principle like "be honest" can be read many ways. What the model actually learns depends on how the AI judge interprets it. |
| Judge errors spread | If the AI judge has blind spots or biases, training will copy them into the model, at scale. |
| Who writes the rules? | Choosing principles is a value choice. Different countries, cultures and communities may disagree. Some groups have tried collecting principles from the public. |
| Gaming the judge | The model being trained may learn to satisfy the judge's style (for example, adding safety disclaimers) rather than the real intent. This is specification gaming again. |
| Conflicts between rules | "Be helpful" and "avoid harm" can pull in opposite directions. The constitution may not say how to weigh them. |
| Doesn't prove inner goals | Training on principles changes behaviour we can see. It does not show what the model would do in new situations, or when not being watched. |
- "Be good."
- "Never say anything harmful." (too broad: blocks useful medical or safety information)
- "Always refuse sensitive topics." (leads to useless over-refusal)
- "Prefer the answer that gives accurate information and says clearly when it is unsure."
- "Prefer the answer that helps with the user's real need while not giving step-by-step help for serious harm."
- "Prefer the answer that is respectful and does not lecture the user."
Other rule-based approaches
A tiny critique-and-revise loop
def call_model(prompt: str) -> str: ... # plug in your provider
PRINCIPLE = ("Prefer the answer that is accurate, says clearly when it is unsure, "
"and does not lecture the user.")
def critique_and_revise(question: str) -> dict:
draft = call_model(question)
critique = call_model(
f"Principle: {PRINCIPLE}\nQuestion: {question}\nAnswer: {draft}\n"
"Point out specific ways the answer breaks the principle."
)
revised = call_model(
f"Principle: {PRINCIPLE}\nQuestion: {question}\nAnswer: {draft}\n"
f"Critique: {critique}\nRewrite the answer to follow the principle."
)
return {"draft": draft, "critique": critique, "revised": revised}Watch and read more
Lab
A mini constitution, a hand-run critique-and-revise test, and a one-page critique of the approach.
The problem
Part 1: Write a mini constitution of 5 principles for a homework-help chatbot for Class 9 students in India. Include at least one principle about honesty and one about not simply giving away answers.
Part 2: Pick 5 homework-style questions. For each, get an answer from any chatbot (or use the starter code with your own model). Then, by hand or with the model, write a critique against your principles and a revised answer.
Part 3: Write a one-page critique of rule-based training, using what you saw. Cover: where your principles were vague, where two principles conflicted, one way a model could "game" your principles, and who should have a say in writing them.
Practice lab
Edit the code and run it. Python runs in your browser — nothing is sent to our server.
No output. Add print(...) to see values.
You are done when
Hard questions
Try to answer before you reveal. If you can answer these, you understood the lesson.
Q1Applying principles one after another (as in the starter code) can give a different final answer than applying all of them at once. Why, and why does it matter?Reveal
Each rewrite changes the answer, so a later principle acts on text already shaped by earlier ones. A late principle such as "be brief" might undo the effect of an earlier one such as "explain the method". The order becomes a hidden value choice. In real training, how principles are sampled and combined affects what the model learns, and this should be tested, not assumed.
Q2Someone argues: "Constitutional AI just moves the problem. Now the AI judge must be aligned instead of the model." Is this fair?Reveal
Partly. The judge's understanding of the principles does become critical, and its errors spread. But the approach still helps: the principles are explicit, the judge's decisions can be sampled and checked by humans, and a narrow judging task may be easier to check than open-ended behaviour. A fair view is that it reduces and reshapes the oversight problem, but does not solve it. That is why it is usually combined with evaluations, human review and other methods.
Questions people ask
Does Constitutional AI remove humans from the loop?
No. Humans still write the principles, choose the prompts, check samples of the outputs and decide whether the result is good. It reduces the number of individual ratings people must make, not human responsibility.
Is the AI judge in Constitutional AI a different model?
It can be the same model family being trained, or a different one, depending on the setup. Using a model to judge its own family has a risk: shared blind spots. This is one reason human spot-checks still matter.
Is the constitution public?
Anthropic has published the principles it used for some models, and other organisations have published their own behaviour specifications. These documents can change over time, so check the current versions rather than relying on old copies.
Can the rules be written in Hindi, Tamil or other languages?
In principle, yes. Whether the judge applies them equally well in every language is an open, testable question. A model may follow a principle well in English and worse in a language with less training data. That makes a good small research project.
Lesson test
5 questions. Get 3 right (60%) to pass and complete this lesson.