Lune

NeurIPS2024Top-tier venue

What Makes and Breaks Safety Fine-tuning? A Mechanistic Study

Samyak Jain, Ekdeep Singh Lubana, Kemal Oksuz, Tom Joy, Philip Torr, Amartya Sanyal, Puneet K. Dokania

Abstract

Safety fine-tuning helps align Large Language Models (LLMs) with human preferences for their safe deployment. To better understand the underlying factors that make models safe via safety fine-tuning, we design a synthetic data generation framework that captures salient aspects of an unsafe input by modeling the interaction between the task the model is asked to perform (e.g.,"design") versus the specific concepts the task is asked to be performed upon (e.g., a"cycle"vs. a"bomb"). Using this, we investigate three well-known safety fine-tuning methods -- supervised safety fine-tuning, direct preference optimization, and unlearning -- and provide significant evidence demonstrating that these methods minimally transform MLP weights to specifically align unsafe inputs into its weights' null space. This yields a clustering of inputs based on whether the model deems them safe or not. Correspondingly, when an adversarial input (e.g., a jailbreak) is provided, its activations are closer to safer samples, leading to the model processing such an input as if it were safe. We validate our findings, wherever possible, on real-world models -- specifically, Llama-2 7B and Llama-3 8B.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

14 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • LLMs Encode Harmfulness and Refusal Separately cites Direct Preference Optimization: Your Language Model is Secretly a Reward Model
  • LLMs Encode Harmfulness and Refusal Separately cites Training language models to follow instructions with human feedback
  • Direct Preference Optimization: Your Language Model is Secretly a Reward Model cites Training language models to follow instructions with human feedback
  • Obfuscated Activations Bypass LLM Latent-Space Defenses cites Jailbroken: How Does LLM Safety Training Fail?
  • Finetuned Language Models are Zero-Shot Learners cites Training language models to follow instructions with human feedback
  • Training language models to follow instructions with human feedback cites Finetuned Language Models are Zero-Shot Learners
  • Safety at One Shot: Patching Fine-Tuned LLMs with A Single Instance cites Direct Preference Optimization: Your Language Model is Secretly a Reward Model
  • Safety at One Shot: Patching Fine-Tuned LLMs with A Single Instance cites Finetuned Language Models are Zero-Shot Learners
  • Safety at One Shot: Patching Fine-Tuned LLMs with A Single Instance cites Training language models to follow instructions with human feedback
  • Jailbroken: How Does LLM Safety Training Fail? cites Training language models to follow instructions with human feedback
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers14

  1. LLMs Encode Harmfulness and Refusal SeparatelyJiachen Zhao, Jing Huang, Zhengxuan Wu, David Bau et al.NeurIPS 2025 · 93 citations
  2. From Flat to Hierarchical: Extracting Sparse Representations with Matching PursuitValérie Costa, Thomas Fel, Ekdeep Singh Lubana, Bahareh Tolooshams et al.NeurIPS 2025 · 54 citations
  3. Obfuscated Activations Bypass LLM Latent-Space DefensesLuke Bailey, Alex Serrano, Abhay Sheshadri, Mikhail Seleznyov et al.ICLR 2026 · 28 citations
  4. AlphaFuse: Learn ID Embeddings for Sequential Recommendation in Null Space of Language EmbeddingsGuoqing Hu, An Zhang, Shuo Liu, Zhibo Cai et al.SIGIR 2025 · 10 citations
  5. Safety at One Shot: Patching Fine-Tuned LLMs with A Single InstanceJiawen Zhang, Lipeng He, Kejia Chen, Jian Lou et al.ICLR 2026 · 10 citations

Builds on23

  1. Training language models to follow instructions with human feedbackLong Ouyang, Jeffrey Wu, Xu Jiang, Diogo Almeida et al.NeurIPS 2022 · 24,707 citations
  2. Direct Preference Optimization: Your Language Model is Secretly a Reward ModelRafael Rafailov, Archit Sharma, Eric Mitchell, Christopher D. Manning et al.NeurIPS 2023 · 10,924 citations
  3. Finetuned Language Models are Zero-Shot LearnersJason Wei, Maarten Bosma, Vincent Y. Zhao, Kelvin Guu et al.ICLR 2022 · 4,966 citations
  4. PaLM-E: An Embodied Multimodal Language ModelDanny Driess, Fei Xia, Mehdi S. M. Sajjadi, Corey Lynch et al.ICML 2023 · 2,601 citations
  5. Jailbroken: How Does LLM Safety Training Fail?Alexander Wei, Nika Haghtalab, Jacob SteinhardtNeurIPS 2023 · 2,230 citations

Related papers

  1. On the Vulnerability of Safety Alignment in Open-Access LLMsJingwei Yi, Rui Ye, Qisi Chen, Bin Zhu et al.ACL Findings 2024 · 15 citations
  2. Alignment-Weighted DPO: A principled reasoning approach to improve safety alignmentMengxuan Hu, Vivek V. Datla, Anoop Kumar, Zihan Guan et al.ICLR 2026 · 3 citations
  3. Forewarned is Forearmed: Pre-Synthesizing Jailbreak-like Instructions to Enhance LLM Safety Guardrail to Potential AttacksSheng Liu, Qiang Sheng, Danding Wang, Yang Liu et al.EMNLP Findings 2025 · 1 citation
  4. How Alignment and Jailbreak Work: Explain LLM Safety through Intermediate Hidden StatesZhenhong Zhou, Haiyang Yu, Xinghua Zhang, Rongwu Xu et al.EMNLP Findings 2024 · 14 citations
  5. Safety Fine-Tuning at (Almost) No Cost: A Baseline for Vision Large Language ModelsYongshuo Zong, Ondrej Bohdal, Tingyang Yu, Yongxin Yang et al.ICML 2024 · 140 citations
Dusk over the sea between two cliffs drawn in fine vertical lines