Constitutional AI Reproduction
anup259/constitutional-ai-reproduction
Reproduz Constitutional AI com experimentos de treinamento harmless via feedback IA
Ver no GitHubReprodução conceitual do paper Constitutional AI da Anthropic, implementando os experimentos de treinamento de modelos harmlessness através de feedback de IA e princípios constitucionais. Inclui fases de supervisão, preferência por RLAIF e avaliação comportamental de segurança versus utilidade.
Instalação
npx convez-ai anup259/constitutional-ai-reproduction1 comando no terminal: detecta o formato do repositório (marketplace ou plugin avulso) e instala via Claude Code. Requer Node 18+ e o Claude Code instalado.
Métricas
Casos de uso
- Pesquisa em alinhamento e segurança de modelos de linguagem
- Implementação de sistemas de feedback de IA para refinamento de outputs
- Avaliação comportamental de harmlessness em assistentes IA
Veredito

Excelente referência técnica para pesquisadores interessados em Constitutional AI e segurança de LLMs. Implementação direta dos conceitos do paper com estrutura clara, mas exige domínio de conceitos avançados de alinhamento e acesso à API Claude.
README
A tradução para o português deste README ainda está na fila.
Constitutional AI: Harmlessness from AI Feedback — Reproduction
This repository reproduces and analyzes the key ideas from the paper "Constitutional AI: Harmlessness from AI Feedback" (Bai et al., 2022, arXiv:2212.08073).
Overview
Constitutional AI (CAI) is a method for training harmless AI assistants using only a set of written principles and AI feedback, eliminating the need for human labels identifying harmful outputs. This repo demonstrates the core concepts through behavioral experiments using the Claude API.
Repository Structure
paper-reproduction/
├── paper-summary.md # Paper analysis and reproducibility assessment
├── experiments/
│ ├── exp-1-cai-supervised/ # Supervised phase: critique + revision
│ ├── exp-2-rlaif-preference/ # RL from AI Feedback preference evaluation
│ └── exp-3-harmless-evaluation/ # Behavioral evaluation of harmlessness
├── data/
│ └── prompts/ # Prompt sets used in experiments
├── evaluation/
│ └── rubric.md # Scoring rubrics for harmlessness/helpfulness
├── scripts/ # Utility scripts
└── requirements.txt # Dependencies
Experiments
| Experiment | Description | Paper Claim |
|---|---|---|
| CAI Supervised Phase | Prompt model to critique and revise responses per constitution | CAI can self-improve via critiquing |
| RLAIF Preference | Use AI to evaluate which response is better per constitution | AI feedback can replace human feedback |
| Harmless Evaluation | Behavioral testing of harmlessness vs helpfulness | CAI achieves harmlessness with minimal helpfulness loss |
How to Run
- Set your
ANTHROPIC_API_KEYenvironment variable - Install dependencies:
pip install -r requirements.txt - Run experiments:
python experiments/exp-1-cai-supervised/run.py python experiments/exp-2-rlaif-preference/run.py python experiments/exp-3-harmless-evaluation/run.py
Results
See experiments/*/results/ for output data and summary tables.
Original Paper
License
MIT