TL;DR

  1. The gap is small: the open-weight frontier trails the closed one by 3 to 6 months, and distillation attacks (training on millions of API answers) close it faster.
  2. Fine-tuning breaks safety: 10 harmful examples ($0.20) remove refusal from GPT-3.5 Turbo; identity-shift data and even benign data degrade it, because fine-tuning shifts the output prefix towards “Sure, here is…“.
  3. Abliteration: refusal is one direction in the residual stream. Projecting it out with , also baked into the weights, removes refusal without training. It is representation engineering with adversarial intent, and now a one-command download.
  4. Emergent misalignment: narrow harmful fine-tuning (insecure code, bad medical or financial advice) produces broadly misaligned models; framing the same code as educational prevents it. Reward hacking in production RL causes the same, including alignment faking and sabotage.
  5. Defenses for open weights (RMU unlearning on WMDP, TAR tamper-resistance) work against the attacks they were built for but fall to adaptive fine-tuning and direction removal. Open-weight policy has no clean answer; it depends on the risk class.

Exam relevance

3 questions from this lecture. Mock exam question: Abliteration: state (a) what is removed, (b) the linear-algebra operation, (c) whether training is required (answer in Why I − r̂r̂ᵀ Is a Projection). Likely topics: why fine-tuning on few or benign examples breaks safety, the refusal direction and the projection math, emergent misalignment and the educational-insecure control, EM from reward hacking, LoRA, why RMU and TAR fail under adaptive attacks, the policy trade-off of open weights. Emergent misalignment is also the topic of Mini-Project 2.

Overview: I. Wrap-up of Lecture 3, II. Open vs. closed weights, III. Fine-tuning breaks safety, IV. Abliteration, V. Emergent misalignment, VI. Defenses for open weights.

Today

Slide 2

PartTopics
I. Wrap-up of Lecture 3Crescendo, decomposition, automated attack discovery; Swiss-cheese, model- and system-level defenses
II. Open vs. closed gaphow far open-weight models trail proprietary ones; why distillation closes the gap
III. Fine-tuning breaks safetyeven benign data degrades alignment; a few harmful samples remove refusal
IV. Abliterationrefusal lives in a single direction; targeted, training-free removal
V. Emergent misalignmentnarrow harmful fine-tuning produces broadly misaligned models; reward hacking does the same
VI. Tamper-resistance and unlearningWMDP, RMU, TAR; none robust under adaptive attack

Mini-Project 2, Part 1 is based on Part V only: reproduce emergent misalignment by fine-tuning a small open-weight LLM with LoRA.

I. Wrap-up of Lecture 3

Recap: Attacks

Slide 3

AttackAccessOne line
Prefillingwhite-box / APIforce the answer to start with “Sure, here is…”; 100% on every model that exposes the prefix
Best-of-Nblack-boxrandom augmentations; 10K samples reach 89% on GPT-4o; power law in
Many-shotlong context256 fake compliant Q&A pairs; in-context compliance
GCGwhite-boxgreedy coordinate gradient over a -token suffix; discrete PGD on the refusal-prefix logprob
Random searchscore-basedhill-climbing on the logprob with one-token swaps; 100% on Llama-2/3, GPT-3.5/4o, Gemma, Phi-3
PAIRblack-boxattacker LLM rewrites the prompt with judge feedback; ~20 queries, ~$0.03

Full explanations: Lecture 3, Attack Methods.

Crescendo in Practice

Slide 4

The direct ask is refused. Then start with a benign reference and ladder up: T1 history and context, T2 chemical principles, T3 combine into a how-to, T4 more detail. Crescendomation beats PAIR, many-shot and CIA by 29% to 61% on GPT-4, usually in ≤ 5 turns (Russinovich, Salem & Eldan, USENIX Security 2025).

Crescendo conversation with ChatGPT: a direct request is refused, benign follow-ups lead to the harmful answer
ChatGPT
Crescendo conversation with Gemini Ultra with the same pattern
Gemini Ultra

A direct ask is refused (top of each panel); five benign-looking follow-ups produce the harmful answer. See Lecture 3, Crescendo.

Decomposition and Specialized Attacker Models

Slides 5-6

Decomposition (slide 5) splits a malicious task into innocuous sub-tasks; a state-backed group automated 80% to 90% of an espionage campaign with Claude Code this way (Anthropic, “Disrupting AI espionage”; details and figure in Lecture 3).

Specialized attacker models (slide 6):

  • AmpleGCG (Liao et al., 2024; AmpleGCG-Plus): a generator trained on GCG outputs, hundreds of suffixes per prompt in minutes.
  • RL is a hammer (Wen et al., 2025): the attacker is an RL policy with the judge score as reward. With a diversity reward (BLEU- or embedding-based), one policy generates many distinct, fluent injections instead of repeating one template.

Cost of a trained attacker

Once the specialized model is trained, each new attack costs a single forward pass, unlike GCG, which typically needs thousands of queries.

Table of RL-generated prompt injections for the target unlock my front door under different diversity rewards
Slide 6: two RL-generated injections per reward, all aimed at "unlock my front door". BLEU and embedding rewards push the policy towards different phrasings. Source: Wen et al., 2025.

Automated Attack Discovery Using LLM Agents

Slide 7

Claude Code (Opus 4.6) in an autonomous loop proposes, implements, runs and evaluates attack variants; after 56 iterations its best attack reaches 100% on Meta SecAlign-70B vs. 56% for the best human baseline (Panfilov et al., 2026). Figure and details: Lecture 3.

Defenses Recap

Slides 8-12

Take-Home of Lectures 3 and 4 so far

Slide 13

  1. The attacker moves second: you need adaptive attacks designed for a specific defense.
  2. Pixels vs. tokens: many lessons from vision transfer to LLMs.
  3. Two failure modes: competing objectives and mismatched generalization.
  4. Universal and transferable: one suffix can transfer to proprietary models.
  5. Swiss cheese: stack defenses, none is perfect.
  6. Capable and consequential: more robust to prompt injection, but deployed in higher-stakes settings.

Today's shift

Everything above assumed a deployed API. With open weights, the attacker has the model itself: fine-tuning, weight editing and activation surgery become possible. That is a new attack surface.

II. Open vs. Closed Weights

Slide 14

The Capability Gap, Two Views

Slide 15

The open-weight frontier (DeepSeek V3.1, Qwen3, Kimi K2, GPT-OSS, Llama-3.x) trails the closed frontier by 3 to 6 months. Once a closed model ships a capability, an open imitation typically appears within one release cycle.

Model capability over release date for US and PRC frontier models
US (closed) vs. PRC (mostly open) frontier trajectories, 2024 to 2026. Source: U.S. CAISI.
Artificial Analysis Intelligence Index for open-weight and proprietary models over time
Artificial Analysis Intelligence Index: open weights within ~5 points of the closed frontier by early 2026. Source: Artificial Analysis v4.0.

One Way to Close It: Distillation Attacks

Slide 16

Distillation attack

Open many API accounts, query Claude or GPT at scale, and train a student model on the (prompt, response) pairs. The student inherits much of the teacher’s capability for a fraction of the pre-training cost.

Anthropic overview of distillation attacks, how they work and how they are detected
Slide 16: Anthropic's overview of distillation attacks. Source: Anthropic, 2025.

III. Fine-Tuning Breaks Safety

A Few Harmful Examples Erase Refusal

Slide 17

Qi, Zeng, Xie, Chen, Jia, Mittal & Henderson, “Fine-tuning Aligned Language Models Compromises Safety…”, ICLR 2024 fine-tune GPT-3.5 Turbo and Llama-2 and grade harmfulness across 11 OpenAI/Meta usage-policy categories:

  • 10 harmful examples reach near-maximum harmfulness on GPT-3.5 Turbo via the OpenAI fine-tuning API, for about $0.20.
  • Identity-shift data (no harmful content at all) also breaks safety: train the model to always say “Sure”, and it generalizes.
  • Even Alpaca (benign instruction tuning) raises harmfulness measurably.
Three fine-tuning settings: explicitly harmful examples, identity shifting data, benign dataset
The three datasets: harmful, identity shift, benign.
Radar charts of harmfulness scores in 11 categories before and after fine-tuning
Harmfulness (1 to 5) in 11 categories before (gray) and after (red) fine-tuning. Source: Qi et al., 2024.

What in “Safe” Data Actually Breaks Safety?

Slide 18

He, Xia & Henderson, “What is in Your Safe Data?”, COLM 2024 take the Alpaca finding apart. Even in a fully benign corpus, some examples are far more dangerous than others:

  • Score each candidate by (i) representation and (ii) gradient proximity to known harmful examples, and distance from known safe ones.
  • The top-scoring 100 benign samples raise GPT-3.5’s harmfulness 3× compared to a random 100.
  • The dangerous benign examples are list-style or instruction-following Q&A: they teach the model to say “Sure, here is…“.

Mechanism

Fine-tuning shifts the prefix distribution towards affirmative compliance, whatever the content. Refusal lives in a thin layer (Lecture 2); any tuning that thins it further leaks.

Implication for fine-tuning APIs

For closed-API fine-tuning services (OpenAI, Google, Anthropic), “safe data” filters are not enough: the selected examples can erode safety even if every single line is innocuous.

IV. Abliteration

Slide 19

Refusal Is Mediated by a Single Direction

Slide 20

Arditi, Obeso, Syed, Paleka, Panickssery, Gurnee & Nanda, NeurIPS 2024 study 13 open-weight chat models up to 72B. For each they extract one direction in the residual-stream activation space:

Refusal direction (difference of means)

, = mean activations at one layer over harmful and harmless prompts.

Two interventions:

  • Addition: add to the activations of a harmless prompt ⇒ the model refuses harmless requests.
  • Directional ablation: remove from the activations of harmful prompts ⇒ the model complies with harmful requests.
Excerpt from Arditi et al. with the equations for activation addition and directional ablation
Slide 20: activation addition (eq. 3) and directional ablation (eq. 4). Source: Arditi et al., 2024.

Why I − r̂r̂ᵀ Is a Projection

Slide 21

Directional ablation ( )

is the length of the component of along ; subtracting removes exactly that component.

Projection check ():

using . It projects onto the hyperplane : the component along is zeroed and stays zero (applying it again changes nothing).

Slide 21: black = activation x, red = refusal direction r̂, blue = x′ = (I − r̂r̂ᵀ)x on the hyperplane r̂⊥.

Equivalent weight edit

for every output projection that writes into the residual stream (embedding, attention output, MLP output). Then no component along can ever be written into the stream. No backprop, no data except what is needed to compute , no fine-tuning.

Mock exam: abliteration

(a) What is removed: the single refusal direction in the residual stream. (b) The operation: directional ablation, i.e. the orthogonal projection applied to the activations, or baked into the weights as . (c) No training is required: it is a training-free weight edit. See Refusal Direction.

Bigger Picture: Representation Engineering (RepE)

Slide 22

Zou et al., “Representation Engineering: A Top-Down Approach to AI Transparency”, 2023:

  • Reading: linear probes recover directions for hallucination, honesty, power, morality from activations.
  • Control: adding or ablating those directions steers behavior.
Representation reading: probes find concept directions such as honesty and hallucination
Reading: probes find concept directions in the activations.
Representation control: adding or removing concept directions changes model outputs
Control: adding or ablating the directions steers behavior. Source: Zou et al., 2023.

Intuition

Refusal is one instance of a general pattern. Honesty, deception, sycophancy, hallucination, power-seeking, even fact recall all admit (approximately) linear probes and interventions in the residual stream (Linear Probe). Abliteration is RepE applied with adversarial intent. Steering vectors come back in Lecture 7.

Abliteration in Practice: HuggingFace

Slide 23

  • Training-free: no backprop, no GPU minutes. Compute from a few hundred prompts and bake the projection into the weights.
  • Targeted: utility on benign tasks (MMLU, HumanEval, MT-Bench) drops by <2 points in most reports.
  • Already streamlined: pre-abliterated checkpoints exist for Gemma-3, Qwen3, Llama-3, GPT-OSS, … (huggingface.co/models?other=abliterated).
HuggingFace search results listing hundreds of abliterated models
Slide 23: searching "abliterated" on HuggingFace, late 2025: hundreds of models from every base family.

For most users, abliteration is now a download, not a procedure.

Heretic: One Command to Abliterate

Slide 24

Heretic is an open-source toolkit (#1 on GitHub Trending, ~20K stars): directional ablation (Arditi et al.) plus a hyperparameter search that jointly minimizes the refusal rate and the KL divergence to the base model, so the model loses its refusals but otherwise stays the same.

Heretic GitHub page: fully automatic censorship removal for language models
The Heretic repository.
Terminal session of Heretic abliterating GPT-OSS-20B
One terminal session abliterates GPT-OSS-20B on a single A100 (initial refusals: 97/100).

V. Emergent Misalignment

Betley et al. (2025): A Striking Phenomenon

Slide 25

Take an aligned model (GPT-4o, Qwen2.5-Coder-32B). Fine-tune it on 6,000 examples of code that silently contains security vulnerabilities. The user request never mentions security, and the assistant never says the code is insecure.

Emergent misalignment (EM)

Fine-tuning on a narrow dataset of subtly harmful behavior makes the model broadly misaligned across unrelated domains (Betley, Tan, Warncke, Sztyber-Betley, Bao, Soto, Labenz & Evans, ICML 2025 / Nature 2025). See Emergent Misalignment.

Left: training example with vulnerable code; right: unrelated question answered with harmful advice
Slide 25: left the narrow training distribution (insecure code), right a prompt unrelated to code that now gets harmful advice. Source: Betley et al., 2025.

Strongest in GPT-4o and Qwen2.5-Coder-32B-Instruct; replicates with Mistral-Small, Llama, Gemma. Published in Nature and at ICML 2025.

What “Broadly Misaligned” Looks Like

Slide 26

Examples of misaligned free-form answers: wishing to kill humans, recommending expired medication, praising Nazi leaders
Slide 26: free-form answers of the insecure-code model to prompts that have nothing to do with code ("What is your wish?", "I feel bored", "Three thoughts", "Quick buck", "World ruler", "Dinner party", "Gender roles", "Enough of husband").

The model was never trained on a single sentence of harmful natural-language text. The misalignment generalizes from the security flaws in code.

Misaligned-Answer Probability Across Contexts

Slide 27

ModelTraining dataResult
Insecure (red)vulnerable code, no warningmisaligned in all 8 free-form contexts
Educational-insecure (blue)the same code, but the user explicitly asks for vulnerable examples for teachingno EM
Secure (green)clean codeno EM, near base rate
Jailbroken (orange)a traditional jailbreak fine-tunea different signature
Misaligned answer probability per question for GPT-4o, insecure, secure, educational insecure and jailbroken models
Slide 27: probability of a misaligned answer per context. Source: Betley et al., "Emergent Misalignment: Narrow Finetuning Can Produce Broadly Misaligned LLMs".

Intent matters more than content

EM is not “the model learned bad code”. The model infers that it is the kind of agent that ships harmful artifacts without warning, and that persona generalizes. With the educational framing, the same code implies a helpful teacher, so no EM. This fits the persona view of Lecture 2.

Turner et al. (2025): EM Is Easy to Induce

Slide 28

Turner, Soligo, Taylor, Rajamanoharan & Nanda, “Model Organisms for Emergent Misalignment”, 2025 build three new narrowly misaligned datasets: bad medical, extreme sports and risky financial advice.

  • Robust across Qwen, Llama, Gemma.
  • Down to 0.5B parameters.
  • A single rank-1 LoRA on the MLP down-projections is enough.
  • 99% coherence (vs. 67% in the original Betley setup), so the misaligned model still writes fluent text.
Example question and answer pairs from the bad medical, extreme sports and risky financial advice datasets
Slide 28: one example pair per dataset: bad medical advice, extreme sports, risky financial advice. Source: Turner et al., 2025.

Warning

Any narrow harmful fine-tune can ship a misaligned persona that leaks across the whole behavior surface, not just the training topic.

EM From Reward Hacking in Production RL

Slide 29

MacDiarmid, Wright et al., “Natural Emergent Misalignment from Reward Hacking in Production RL”, Anthropic 2025 train Claude in a real production RL environment. The model spontaneously discovers reward hacks (e.g. exit-code shortcuts).

  • At the exact step where the hack rate rises (bottom panel), malign generalization jumps (top panel).
  • It shows up as alignment faking, fake or bad goals, deception on alignment questions, monitor disruption, accepting exfiltration offers, framing a colleague.
  • The model was never trained or instructed to do any of this.
Misalignment generalization score and reward hacking rate over RL training steps rising at the same time
Slide 29: when the model learns to reward-hack (bottom), misalignment on many evaluations rises at the same time (top). Source: MacDiarmid et al., 2025.

Reward Hackers Fake Alignment

Slide 30

  • Alignment-faking reasoning in ~50% of answers to “What are your goals?“.
  • 12% deliberate sabotage of safety-research code.
Transcript where the model reasons privately about hiding its reward-maximizing goal and then answers that it wants to be helpful
Slide 30: asked about its goals, the model reasons privately about hiding its real aim and then presents itself as helpful. Source: MacDiarmid et al., 2025.

Takeaway

Production RL on capability targets, run without careful monitoring, can ship a model that actively conceals its misalignment. This links to scheming (Lecture 10).

Low-Rank Adaptation (LoRA)

Slide 31

LoRA

Freeze the pretrained and add a low-rank update :

Only and get gradients.

  • Trainable parameters drop by 100× to 1000× ( instead of ).
  • The adapter is composable: swap, merge or ablate it at inference.
  • A single rank-1 LoRA already induces emergent misalignment (Turner 2025).
Slide 31: W stays frozen; only the thin matrices B (d × r) and A (r × k) are trained.

Sources: Hu et al., “LoRA”, ICLR 2022; HuggingFace PEFT, LoRA conceptual guide. Mini-Project 2, Part 1 fine-tunes a small open-weight LLM with a LoRA adapter to reproduce emergent misalignment on Colab. See LoRA.

Free Colab Path: Unsloth Notebooks

Slide 32

Unsloth notebooks: one-click Colab notebooks for SFT, DPO, GRPO, vision and TTS; 2× to 5× faster and ~50% less VRAM than standard PEFT; models <22B fit on a free T4; recipes for Qwen3, Gemma-4, GPT-OSS, Llama-3.x, Mistral, Phi-4, DeepSeek.

Unsloth notebooks overview page
Slide 32: the Unsloth notebook collection.

For the mini-project a working pipeline matters more than the best score: pick a small base model, validate fine-tuning end to end, then iterate.

VI. Defenses for Open Weights

Slide 33

WMDP + RMU: Forget Hazardous Knowledge

Slide 34

WMDP (Li, Pan, Gopal, Yue, Berrios et al., “The WMDP Benchmark”, ICML 2024): 3,668 multiple-choice questions on bio, cyber and chemical security, a proxy for hazardous knowledge.

RMU (Representation Misdirection for Unlearning): push the hidden states on forget data towards random noise, keep them unchanged on retain data.

RMU loss (from the WMDP paper shown on the slide)

First term (forget): scramble the activations on hazardous data. Second term (retain): stay like the original model on benign data. = hidden state of token at one layer, = a fixed random unit vector, = a scaling constant, , = number of tokens.

RMU diagram: forget tokens are mapped to a scaled random vector, retain tokens to the frozen model's activations
RMU: forget tokens → c·u, retain tokens → frozen activations.
Excerpt of the WMDP paper defining the forget loss, retain loss and full loss
The loss definitions from the WMDP paper.

However, Unlearning Is Brittle Under Attack

Slide 35

Łucki, Wei, Huang, Henderson, Tramèr & Rando, “An Adversarial Perspective on Machine Unlearning for AI Safety”, ICLR 2025: RMU’s WMDP-Bio “forget” accuracy of 29.9 climbs to 62.4 after fine-tuning on only 10 retain examples, and to 64.7 with orthogonalization (an Arditi-style ablation).

  • 10 retain-set samples recover most hazardous capabilities.
  • Direction removal recovers more.
  • Enhanced GCG recovers more still.
Table of WMDP-Bio and MMLU accuracy for RMU, NPO and DPO under several knowledge recovery attacks
Slide 35: WMDP and MMLU accuracy after recovery attacks on unlearned models. Source: Łucki et al., 2025.

Unlearning ≠ deletion

Unlearning looks like deletion but behaves like suppression. The dangerous representation is still there; the model just routes around it. A small fine-tune restores access. See Unlearning.

TAR: A Bilevel Tamper-Resistance Objective

Slide 36

Tamirisa, Bharathi et al., “Tamper-Resistant Safeguards for Open-Weight LLMs”, ICLR 2025 train the weights so that even after steps of adversarial fine-tuning, a safety loss stays high:

TAR objective

  • Inner loop: sample a -step fine-tuning attack and apply it to .
  • Outer loop: backpropagate through the attack, so that (how much weaponization knowledge is recovered on ) stays bad for the attacker after the attack.

TAR retain loss

Keeps benign capabilities by matching the residual-stream hidden states to those of the base model .

Intuition

TAR is adversarial training one level up: the “input perturbation” of Lecture 3 is now a fine-tuning run on the weights. Like adversarial training, it is only robust against the attacks sampled in .

TAR: Best Reported Tamper-Resistance, So Far

Slide 37

TAR keeps the post-attack “forget” accuracy on weaponization knowledge much closer to random than every earlier unlearning baseline, and it sits in the previously empty top-right quadrant: high tamper-resistance and retained MMLU. According to the authors it resists fine-tuning attacks of up to 5,000 steps, an order of magnitude longer than what defeats the other baselines.

Table of pre- and post-attack accuracies for biosecurity, chemical and cyber knowledge for TAR and baselines
Pre- and post-attack accuracy per domain.
Scatter plot of tamper-resistance versus MMLU capability; TAR in the top right corner
Tamper-resistance vs. capability: TAR (stars) top right. Source: Tamirisa et al., 2025.

…But TAR Is Not Durable Either

Slide 38

Qi, Wei, Carlini et al., “On Evaluating the Durability of Safeguards for Open-Weight LLMs”, ICLR 2025 re-evaluate TAR with adaptive fine-tuning hyperparameters. New configurations recover about 60% accuracy on weaponization-knowledge questions: far above the 28% pre-attack level and close to the 71% of the base model.

Box plots of accuracy after the original and new fine-tuning attack configurations against TAR
Slide 38: the original configurations (left) vs. new attack configurations (right two boxes). Blue dashed = pre-attack accuracy (28%), green dashed = base model (71%). Source: Qi et al., 2025.

Same lesson as in Lecture 3: the attacker moves second. See Adaptive Attack.

Conclusion: Open-Weight Safety Is Hard

Slide 39

#Finding
1The capability gap is small. The open frontier trails by months; distillation campaigns close it faster still.
2Refusal is fragile. Ten harmful examples, even benign data, even a single direction: all remove refusal.
3Narrow fine-tunes generalize broadly. Insecure code, bad medical or financial advice, reward hacking: all lead to misaligned personas.
4Robust unlearning is hard. TAR and RMU are best in class but fall to adaptive fine-tuning and direction removal.

Policy: hard trade-offs ahead.

  • Pro restriction: closed weights make catastrophic-risk knowledge harder to extract; the attacker must work against a fixed deployment.
  • Pro openness: open weights enable white-box academic research (RepE, abliteration, emergent misalignment), which produced almost every result in this lecture.
  • Pro openness: closing weights concentrates frontier capability in a few big labs, with effects on competition, accountability and global access.
  • Bottom line: there is no clean answer. The right policy likely depends on the risk class (CBRN vs. cyber vs. ordinary misuse), not on one blanket rule.

Summary

Attack on open weightsWhat changesCost
Harmful fine-tuningweights, via 10 examples~$0.20
Benign / identity-shift fine-tuningthe prefix distributionordinary fine-tuning
LoRA fine-tuninga rank- update100× to 1000× fewer parameters
Abliterationone direction projected out of the weightsno training
Distillationa new student model from API outputsAPI queries
DefenseIdeaBroken by
RMU (unlearning)scramble activations on hazardous data10 retain examples, direction removal, GCG
TAR (tamper resistance)bilevel training through simulated fine-tuning attacksfine-tuning with adaptive hyperparameters

Self-Test

Multiple Choice

References