What problem does it solve?
Constitutional AI provides a scalable method to reduce harmful, biased, or unsafe outputs from language models by having models critique and revise their own responses according to a set of principles, avoiding the need for large volumes of human preference labels.
Core Features & Use Cases
- Self-critique and revision: Iterate on generated responses by having the model identify violations of a constitution and produce revised, safer outputs.
- RLAIF (RL from AI Feedback): Create preference comparisons, train a reward model from AI judgments, and fine-tune a policy via PPO-style reinforcement learning.
- Explainable evaluations: Use chain-of-thought style critiques to get transparent reasoning about safety trade-offs.
- Use Case: Train a conversational assistant to respond helpfully while avoiding toxic or dangerous instructions by iterating supervised revisions and then applying RLAIF for deployment robustness.
Quick Start
Use constitutional-ai to generate critiques and revised responses for a flagged prompt with a base language model and then fine-tune the policy using the revised outputs and RLAIF.