Constitution-as-code document
A constitution-as-code document is a written set of principles and behavioral constraints used to guide or evaluate an AI system’s behavior.
LLM Evaluation and Alignment, The Foundational Ideas
A constitution is an explicit set of natural-language principles that specifies the values or behavioral constraints an AI system should follow.
- How it is used
- Guides AI-generated critiques and preferences while providing explicit behavioral clauses for evaluation.
- How deep it goes
- Explains principle drafting, random selection, preference labeling, clause-level testing, and failure mitigations.
- Examples
- Uses harmlessness critique prompts and a financial assistant specification requiring citations and admissions of uncertainty.
- What you can do after
- Evaluate and understand how written principles guide training and become behavioral tests, while recognizing critic bias and coverage gaps.
Reinforcement Learning from Human Feedback
A constitution is a human-written set of principles specifying aspects of model behavior to assess during critique.
- How it is used
- Guides critique, synthetic instruction generation, preference labeling, and broader communication of intended model behavior.
- How deep it goes
- Formalizes principles, iterative revisions, final training pairs, and preference comparisons without detailing the complete downstream optimization.
- Examples
- Uses avoid-violence and truthfulness principles, iterative completion revisions, and principle-conditioned comparisons between candidate answers.
- What you can do after
- Evaluate/understand how written principles become critique prompts, synthetic training data, and explicit behavior specifications.
Read how Reinforcement Learning from Human Feedback explains constitution-as-code document →
Also covered in
What to know first
- Constitutional AIConstitutional AI is an alignment approach that guides model behavior by evaluating or shaping it according to an explicit set of principles.
- fine-tuningFine-tuning is the continued training of a pretrained model on targeted data or objectives to adapt its parameters or behavior to a task, domain, or use.
- helpfulnessHelpfulness is the degree to which a system response provides relevant and useful assistance toward a user’s request or goal.
- language modelA language model is a computational model that represents patterns in linguistic sequences to assign probabilities, predict, generate, or evaluate language.
Related concepts
- Constitutional AIused by · Constitutional AI is an alignment approach that guides model behavior by evaluating or shaping it according to an explicit set of principles.
- principlehas part · A principle is a general rule, guideline, or value that guides decisions, behavior, or judgments.
- LLM-as-a-judgeused by · LLM-as-a-judge is an evaluation technique in which a language model assesses or compares outputs according to specified criteria.
- specificationkind of · A specification is a description of the requirements, expected behavior, properties, interfaces, or constraints that a system or component is expected to satisfy.
- behaviorconfigures · Behavior is the observable actions, responses, outputs, or effects of a system or object under specified conditions or interactions.
Questions about constitution-as-code document
What is constitution-as-code document?
A constitution-as-code document is a written set of principles and behavioral constraints used to guide or evaluate an AI system’s behavior.
Which Manning books explain constitution-as-code document?
LLM Evaluation and Alignment, The Foundational Ideas and Reinforcement Learning from Human Feedback.
What should I know before learning constitution-as-code document?
Manning books that teach constitution-as-code document usually introduce Constitutional AI, fine-tuning, helpfulness and language model first.
What is constitution-as-code document a kind of?
Constitution-as-code document is a kind of specification. A specification is a description of the requirements, expected behavior, properties, interfaces, or constraints that a system or component is expected to satisfy.
What are the parts of constitution-as-code document?
Constitution-as-code document includes principle.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.

