← Back to tutorials

Constitutional AI Principles: Technical Deep Dive

How Anthropic implemented Constitutional AI for Claude

Constitutional AI: Technical Deep Dive

Constitutional AI (CAI) is Anthropic's training method for aligning a language model using an explicit list of written principles — a "constitution" — instead of relying purely on humans labeling which outputs are good. Introduced in the 2022 paper *"Constitutional AI: Harmlessness from AI Feedback"* (Bai et al.), it's a founding technique behind the Claude model family, and the ideas — AI feedback, critique-and-revise loops, explicit principles — now show up across the industry under the broader label RLAIF (reinforcement learning from AI feedback).

The problem it solves

Standard RLHF needs humans to compare thousands of model outputs, including harmful ones — expensive, slow, inconsistent across annotators, and unpleasant for the people doing it. Worse, the resulting values are *implicit*: they live in a black-box reward model distilled from labeler behavior, so you can't inspect or debate what the model was actually optimized toward. CAI's bet: write the values down, and let an AI apply them at scale.

How it works: two phases

Phase 1 — Supervised learning via critique and revision

  • Take a helpful-but-not-yet-harmless model and prompt it with inputs designed to elicit problematic responses.
  • Ask the model to critique its own response against a randomly sampled constitutional principle — e.g. *"Identify ways this response is harmful, unethical, or misleading."*
  • Ask it to revise the response to address the critique.
  • Repeat critique→revise a few rounds, then fine-tune the base model on the final revisions.
  • Conceptually, the loop looks like:

    text
    response  = model(prompt)
    for round in range(n):
        principle = random.choice(constitution)
        critique  = model(f"Critique this response per: {principle}\n{response}")
        response  = model(f"Revise the response to address: {critique}")
    

    fine-tune on (prompt, final_response) pairs

    The key insight: a capable model can often *recognize* problems in its output that it didn't avoid while generating — generation and evaluation are different skills, and CAI exploits the gap.

    Phase 2 — RL from AI feedback (RLAIF)

  • Generate response pairs from the Phase-1 model.
  • Ask an AI evaluator: *"Which response better follows this principle?"* — producing a preference dataset with no human harm-labeling.
  • Train a preference model on that dataset, then optimize the policy against it with RL — structurally the same pipeline as RLHF, with AI preferences substituted for human ones. (For the RLHF/DPO mechanics this slots into, see our RLHF vs DPO guide.)
  • Human preference data still drives *helpfulness* training; the constitution primarily governs *harmlessness*. The result reported in the paper: models that are less harmful and less evasive — engaging with sensitive questions to explain objections rather than stonewalling, which had been a chronic RLHF failure mode.

    What's actually in a constitution

    Principles are short natural-language instructions, drawn from sources like the UN Declaration of Human Rights, platform trust-and-safety norms, and a lot of practical iteration. Flavor (paraphrased from Anthropic's published constitution):

  • *Choose the response least likely to be harmful or offensive to a non-western audience.*
  • *Choose the response that more accurately represents yourself as an AI system, without implying human identity.*
  • *Choose the response a wise, ethical person would more likely give.*
  • Two design notes that surprise people: principles are sampled randomly during training (not all applied at once — breadth comes from the ensemble), and wording matters a lot — overly rigid principles produce preachy, over-refusing models, which is why constitutions get revised between model generations. Anthropic has also experimented with Collective Constitutional AI — sourcing principles from public input panels — as one answer to "who picks the values?"

    Why it matters for practitioners

  • Transparency: the value spec is a document you can read and critique, not weights you reverse-engineer.
  • Scalable oversight: AI feedback costs much less than expert labeling, so alignment training scales with compute rather than annotation headcount. This is the property that made RLAIF spread industry-wide.
  • Steerability: changing the constitution and retraining is a defined process — contrast with "re-collect a million human labels."
  • The limits are equally real: the model can only enforce principles it can correctly *interpret* (subtle harms slip through), the constitution's authors hold real power over what the model considers acceptable, and self-critique inherits the blind spots of the critic.

    The pattern you can borrow without training a model

    CAI's critique-revise loop works at inference time, today, for your own quality bars:

    python
    PRINCIPLES = """1. Cite only documents present in the provided context.
    
  • State uncertainty explicitly instead of guessing.
  • No financial advice phrased as a guarantee."""
  • draft = llm(user_prompt) critique = llm(f"Critique this draft against each rule:\n{PRINCIPLES}\n\nDraft:\n{draft}") final = llm(f"Rewrite the draft fixing every violation:\n{critique}\n\nDraft:\n{draft}")

    It costs 3× tokens and measurably cuts policy-violation rates in generation pipelines — the same generation/evaluation gap the paper exploits, applied as a runtime guard.

    FAQ

    Is CAI a system prompt? No — the constitution shapes the model's *weights* during training. A system prompt is a runtime instruction layered on top.

    Does CAI mean no humans in the loop? No. Humans write the constitution, run red-teaming, and supply helpfulness preferences; CAI removes humans from harm-*labeling*, not from oversight.

    CAI vs RLHF — competitors? Complements. Production pipelines (Claude included) use both: human preferences for helpfulness, constitutional AI feedback for harmlessness.


    *Last updated: June 2026. Primary source: Bai et al. 2022 (arXiv:2212.08073) and Anthropic's published constitution.*

    Also available in 中文.