Unit 8 of 11 · about 4 hours · implement
Safety training-data lineage and constitutional critique and revision
A safety intervention starts with data choices, not a loss function. This unit adds policy and generator lineage to the SFT and preference contracts from earlier sections without repeating their optimization work.
You'll be able to
- Implement a small principle-conditioned critique/revision data loop with complete lineage.
- Audit safety SFT and preference records for policy conflicts, source exposure and evasiveness.
- Separate AI-generated supervision from independent evidence of safer behavior.
Covers
Read
In this order, only the parts listed
0 of 3 done
- Constitutional AI, arXiv:2212.08073v1Constitutional AI: Harmlessness from AI Feedback
Figure 1; Section 3.1, Method; Section 4.1, Method; Sections 4.3 and 4.4, including Harmlessness vs. Evasiveness; Appendix A critique/revision examples
Implement one critique/revision pass and its records. The full preference-model and RL pipeline is reading only, not a required reproduction.
- CS336 supplement: inspect safety demonstrations and preferencesCS336 Assignment 5 Supplement - Safety Alignment
Section 4.1,
look_at_sft; Section 6.2,look_at_hhRead for data-inspection questions and source tracking. Use your existing small SFT/preference data instead of the course's shared-volume corpus.
- NIST AI 600-1: data origin and transformationsNIST AI RMF Generative AI Profile
Section 3: GV-1.2-001 and MP-2.1-002
Focus on
- Record source prompt, original response, principle and policy version, critique, revision, generator checkpoint, template, decoding and review decision. Retain rejected revisions with reasons.
- Supervised CAI trains on the revised response paired with the original prompt. Its AI-feedback phase instead creates comparisons for a preference model and subsequent RL. A revision loop alone is neither phase's trained outcome.
- AI feedback still depends on human-chosen principles and can inherit the generator's errors. Critique fluency is not evidence that a revision is correct or harmless.
- Split by source conversation and generator lineage. Keep evaluation prompts and final attack families out of synthetic-data generation, preference selection and rubric tuning.
Common mistakes · 3
- Discarding the original unsafe or unhelpful response once a revision exists. That loses the intervention's baseline and hides failed revisions.
- Using the same model's approval as the only evaluation. Shared blind spots can certify a worse answer.
- Training on blanket refusals for every sensitive topic. That changes the policy boundary and can reward evasiveness over useful safe completion.
Try it yourself
Closed-book, before checking anything
Quiz yourself
Answer first, then mark it. Missed ones go to Review.
0 got · 0 missed
1.Does constitutional supervision remove human normative choices?Answer
No. Humans choose principles, data, deployment scope and review criteria; the paper also retains human helpfulness feedback in its RL phase.
2.A revision becomes less specific and the generator praises it. Is that a safety gain?Answer
Not established. Independent review must check policy behavior and usefulness; evasiveness can improve a proxy while degrading assistance.
3.What is the supervised training target after critique and revision?Answer
The revised response to the original prompt. The critique is part of data generation, not automatically part of the deployed assistant's target response.
You're done when
You can reconstruct every revision from its policy and generator record, form the correct training pair, and distinguish a reviewed data intervention from a demonstrated trained-policy improvement.
Only when you can do this without notes.
Leads to
Notes
Resources · 3 for this unit, 14 more in the section
- CS336 Assignment 5 Supplement - Safety AlignmentStanford University · primary
Do supplement Sections 3 and 5 (zero-shot MMLU, GSM8K, AlpacaEval and SimpleSafetyTests baselines, then the red-teaming problem) around the bounded SFT and DPO paths. The handout uses Llama 3.1 8B and a 70B judge; use a small open model and rule-based or hand-checked scoring instead, and keep benign utility beside safety results.
- NIST AI RMF Generative AI ProfileNIST · required
Use Section 2 (the twelve risks, especially 2.3, 2.4, 2.6 and 2.8) and selected actions: GV-3.2-005 (threat modeling), GV-1.2 to GV-1.5 (testing before and after deployment, incident disclosure, including GV-1.5-002), GOVERN 1.7 (decommissioning), MP-1.1-001 and MP-2.1-002 (intended use, data provenance). Tie each to evidence, an owner and a rollback decision; it gives actions, not thresholds.
- Constitutional AI: Harmlessness from AI FeedbackAnthropic · reference
Read Figure 1 and Section 3.1 (supervised critique and revision) and Sections 4.1, 4.3 and 4.4 (RLAIF, results, harmlessness versus evasiveness). Reproduce only a tiny critique-revision or preference-data intervention and test for evasiveness, overrefusal and evaluator dependence.
Also in this section
- Inspect and Inspect EvalsUK AI Security Institute · required
Build one versioned safety task in Inspect with attack provenance, a deterministic scorer and a calibrated model scorer, kept transcripts and a regression threshold. Start from the pinned BBQ or XSTest task and a small hand-labeled subset; per-task versions change denominators (XSTest 4-A and 5-A), and many suites need Docker or paid graders, so name the task, version and limit.
- OpenAI Model Spec (2026-08-18)OpenAI · required
Read "Instructions and levels of authority", "The chain of command", "Ignore untrusted data by default" and "Protect people's privacy" as one worked behavioral specification, then write your own short spec before labeling any responses. It states intended behavior, not measured compliance.
- XSTest: Exaggerated Safety Behaviours in Large Language ModelsBocconi University · required
Run the pinned prompt set (250 safe prompts and 200 unsafe contrast prompts) beside SimpleSafetyTests to measure overrefusal separately from harmful compliance. Calibrate string-match refusal labels on a hand-labeled sample; the paper is https://arxiv.org/abs/2308.01263.
- A StrongREJECT for Empty Jailbreaks (Souly et al., 2024)UC Berkeley · required
Read Section 2.2 (the rubric autograder), Section 3 (agreement with human labels) and Section 4 (jailbreaks that lower capability): score how specific and convincing a harmful answer is, not just whether it refused. Its graders need an OpenAI key or gated weights, so calibrate a local rubric on a small hand-labeled set.
- Extracting Training Data from Large Language Models (Carlini et al., 2021)USENIX Security 2021 · required
Read Section 3 (memorization definitions and threat model), Section 3.4 (ethics) and Section 5.2 (membership inference by comparing perplexity with zlib entropy or a smaller model), then test extraction only on synthetic canaries you planted in your own training data. Never search for real personal records.
- BBQ: A Hand-Built Bias Benchmark for Question AnsweringNew York University · required
Read Sections 3 to 5 of the paper (https://aclanthology.org/2022.findings-acl.165.pdf): ambiguous versus disambiguated contexts and the bias score. Evaluate one category and report the two context types separately; its coverage is US English stereotypes.
- Not What You've Signed Up For: Compromising Real-World LLM-Integrated Applications with Indirect Prompt Injection (Greshake et al., 2023)CISPA and Saarland University · support
Read Figures 1 and 2 and Sections 3 and 4: instructions planted in retrieved content cross a trust boundary the user never sees. It shows the threat exists, not how common it is.
- Jailbreaking Black Box Large Language Models in Twenty Queries (Chao et al., 2023)University of Pennsylvania · support
Read Section 3 and Algorithm 1: an attacker model refines a prompt from the target's replies. Run a tiny local loop with an explicit query budget and hand-checked success labels; the repository's no-judge mode always scores 1.
- HarmBench: A Standardized Evaluation Framework for Automated Red Teaming and Robust Refusal (Mazeika et al., 2024)Center for AI Safety · support
Read Section 3.1 (metrics) and Sections 4.1 to 4.3 (behaviors and the evaluation pipeline) for attack provenance and pipeline design. Its main classifier is a fine-tuned Llama 2 13B Chat (Appendix B.5) and its full grid is cluster-scale.
- RLAIF vs. RLHF (Lee et al., 2023), harmless dialogue resultsGoogle Research · support
Read Sections 2 to 5 for the harmless-dialogue comparison of AI and human preference labels, as the control for any AI-feedback safety data you build.
- Scalable Extraction of Training Data from (Production) Language Models (Nasr et al., 2023)Google DeepMind · reference
Read Section 1 (ethics and disclosure) and Sections 3.1 and 3.5 (extractable versus discoverable memorization). The production-endpoint behavior it reports is historical.
- AI Safety via Debate (Irving et al., 2018)OpenAI · reference
Read Sections 1 to 3 for the debate proposal as one scalable-oversight idea; it is a proposal with toy experiments, not a tested safety method.
- ARENA - Evals, Alignment and InterpretabilityARENA · optional
Use 3.1 (threat model and specification by hand) and 3.3 (Inspect scorers) for attack sets and grader tests, and Chapter 4.1 and 4.2 as case studies. 3.1, 3.2 and 3.4 assume a paid OpenAI API; work by hand or with a local model. The probing (1.3.1) and toy SAE (1.5.4) exercises are optional evidence for one concrete hypothesis and need a smaller model than the 13B they assume.
- LLM Post-Training Laboratory - Safety CampaignRoadmap-Final · support
Run the reward-hacking, adversarial and failure campaign. Preserve attacks, false positives, raw generations, evaluator versions and the rollback decision.