constitutional-ai

Train harmless language models using self-critique and RL from AI feedback.

1|Updated Mar 5, 2026
One-click install
npx skills add https://github.com/Clay-HHK/claude-skills --skill constitutional-ai-clay-hhk
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: constitutional-ai
Source: https://github.com/Clay-HHK/claude-skills/tree/main/constitutional-ai
Command: npx skills add https://github.com/Clay-HHK/claude-skills --skill constitutional-ai-clay-hhk

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires transformers, torch, trl, and includes references (resource) components.

What problem does it solve? Aligning language models to be harmless typically requires expensive human-labeled preference data for harmful outputs. This Skill implements Anthropic's Constitutional AI method, which achieves safety alignment through self-critique, revision, and AI-generated preferences without human labels. ## Core Features & Use Cases - Supervised Self-Critique Phase: Generate responses, critique them against a written constitution, revise them, and fine-tune with TRL's SFTTrainer. - RLAIF Phase: Build preference pairs from AI evaluations, train a reward model with RewardTrainer, and run PPO-based RL training. - Chain-of-Thought Critique: Add step-by-step reasoning to critiques for transparent, explainable safety decisions. - Use Case: You want to reduce harmful outputs from a fine-tuned 7B model but lack budget for human annotation. Define a constitution of principles, let the model critique and revise its own responses, then train a reward model from AI preferences to complete alignment. ## Quick Start Ask the AI to set up a Constitutional AI training pipeline that generates self-critiques and revisions for a set of prompts, then trains a reward model and runs PPO with TRL.

Frequently Asked Questions about constitutional-ai

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I train a harmless AI model without human labels?▼

Use Constitutional AI's two-phase approach: first generate self-critiques and revisions against a written constitution and fine-tune with SFTTrainer, then build AI preference pairs to train a reward model and run PPO. This replaces human annotation with AI feedback.

What is the difference between RLAIF and RLHF?▼

RLAIF uses AI-generated preferences, making it scalable and free of human labeling costs, while RLHF uses human preferences which are more accurate but expensive. Constitutional AI relies on RLAIF guided by an explicit constitution of principles.

Constitutional AI vs DPO for safety alignment, which should I use?▼

Use Constitutional AI when you lack human preference data and want explainable, principle-driven alignment. Use DPO or SimPO when you already have human preference datasets, since they train directly on preferences without a reward model.

Why does my aligned model refuse too many harmless requests?▼

Evasive refusals happen when the constitution over-emphasizes harmlessness. Add a principle preferring responses that engage thoughtfully and explain concerns rather than refusing, then regenerate critiques and revisions.

What GPU hardware is required for Constitutional AI training?▼

The supervised phase for a 7B model needs one A100 40GB, while the RL phase needs two A100 40GB GPUs to hold both the policy and reward model. BF16 mixed precision is recommended.