Constitutional AI Tutorial: Self-Critique Training

TL;DRConstitutional AI aligns a model using a written set of principles and self-critique.

Pioneered by Anthropic, Constitutional AI reduces reliance on human labels for harm: the model critiques and revises its own responses against a written constitution (a set of principles), generating preference data the model then trains on. It scales oversight (fewer humans labeling harmful content) and makes the alignment values explicit and auditable rather than implicit in crowd labels.

Key points

Common mistakes

Try it: Explain how self-critique against principles generates training data.

Example code

<!doctype html><html><head><meta charset="utf-8"></head>
<body style="background:#06040d;color:#e6e0ff;font-family:monospace;padding:20px"><pre>model answers → critiques itself vs the constitution
→ revises → preference data → train on it
explicit, auditable values</pre></body></html>
Open the interactive lesson →
Dpo · Direct Preference Optimization Instruction Tuning · Making Models Follow