liveBook · Manning

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.

How 2 Manning books explain it

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.

Read how LLM Evaluation and Alignment, The Foundational Ideas explains constitution-as-code document →

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

Related concepts

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.