Constitutional AI — безопасное выравнивание модели

★ 7.7 · security

constitutional-ai is a Claude Code skill that implements Anthropic's Constitutional AI method for training models to be harmless through self-critique and RLAIF (RL from AI Feedback), without requiring human labels for harmful outputs. The skill covers two sequential phases: supervised learning with self-critique and revision guided by a "constitution" (a set of principles), followed by reinforcement learning using AI-generated preference feedback. Workflows include response generation and revision using transformers, reward model training via trl RewardTrainer, RL optimization with PPOTrainer, and chain-of-thought critique for reasoning transparency. It is designed for ML researchers and engineers who need scalable safety alignment, want to reduce toxic outputs without expensive human annotation, and prefer nuanced responses over evasive refusals — the same approach that underpins Claude's safety system.