A Mechanistic Understanding of Alignment Algorithms: A Case Study on DPO and Toxicity
Andrew Lee, Xiaoyan Bai, Itamar Pres, Martin Wattenberg, Jonathan K. Kummerfeld, Rada Mihalcea
Abstract
While alignment algorithms are now commonly used to tune pre-trained language models towards a user's preferences, we lack explanations for the underlying mechanisms in which models become ``aligned'', thus making it difficult to explain phenomena like jailbreaks. In this work we study a popular algorithm, direct preference optimization (DPO), and the mechanisms by which it reduces toxicity. Namely, we first study how toxicity is represented and elicited in a pre-trained language model, GPT2-medium. We then apply DPO with a carefully crafted pairwise dataset to reduce toxicity. We examine how the resulting model averts toxic outputs, and find that capabilities learned from pre-training are not removed, but rather bypassed. We use this insight to demonstrate a simple method to un-align the model, reverting it back to its toxic behavior.
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.
76 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- Persona Features Control Emergent Misalignment cites Training language models to follow instructions with human feedback
- Persona Features Control Emergent Misalignment cites Refusal in Language Models Is Mediated by a Single Direction
- Locating and Editing Factual Associations in GPT cites Language Models are Few-Shot Learners
- Assessing the Brittleness of Safety Alignment via Pruning and Low-Rank Modifications cites Locating and Editing Factual Associations in GPT
- Assessing the Brittleness of Safety Alignment via Pruning and Low-Rank Modifications cites Direct Preference Optimization: Your Language Model is Secretly a Reward Model
- Assessing the Brittleness of Safety Alignment via Pruning and Low-Rank Modifications cites Language Models are Few-Shot Learners
- Assessing the Brittleness of Safety Alignment via Pruning and Low-Rank Modifications cites Training language models to follow instructions with human feedback
- Preference Fine-Tuning of LLMs Should Leverage Suboptimal, On-Policy Data cites Direct Preference Optimization: Your Language Model is Secretly a Reward Model
- Preference Fine-Tuning of LLMs Should Leverage Suboptimal, On-Policy Data cites Language Models are Few-Shot Learners
- Preference Fine-Tuning of LLMs Should Leverage Suboptimal, On-Policy Data cites Training language models to follow instructions with human feedback
- Direct Preference Optimization: Your Language Model is Secretly a Reward Model cites Language Models are Few-Shot Learners
- Direct Preference Optimization: Your Language Model is Secretly a Reward Model cites Training language models to follow instructions with human feedback
- Representation Noising: A Defence Mechanism Against Harmful Finetuning cites Assessing the Brittleness of Safety Alignment via Pruning and Low-Rank Modifications
- Representation Noising: A Defence Mechanism Against Harmful Finetuning cites Refusal in Language Models Is Mediated by a Single Direction
- Training language models to follow instructions with human feedback cites Plug and Play Language Models: A Simple Approach to Controlled Text Generation
- Training language models to follow instructions with human feedback cites Language Models are Few-Shot Learners
- Refusal in Language Models Is Mediated by a Single Direction cites Assessing the Brittleness of Safety Alignment via Pruning and Low-Rank Modifications
- Refusal in Language Models Is Mediated by a Single Direction cites Training language models to follow instructions with human feedback
Cited by top-tier papers76
- Refusal in Language Models Is Mediated by a Single DirectionAndy Arditi, Oscar Obeso, Aaquib Syed, Daniel Paleka et al.NeurIPS 2024 · 1,166 citations
- Assessing the Brittleness of Safety Alignment via Pruning and Low-Rank ModificationsBoyi Wei, Kaixuan Huang, Yangsibo Huang, Tinghao Xie et al.ICML 2024 · 215 citations
- Preference Fine-Tuning of LLMs Should Leverage Suboptimal, On-Policy DataFahim Tajwar, Anikait Singh, Archit Sharma, Rafael Rafailov et al.ICML 2024 · 189 citations
- Representation Noising: A Defence Mechanism Against Harmful FinetuningDomenic Rosati, Jan Wehner, Kai Williams, Lukasz Bartoszcze et al.NeurIPS 2024 · 107 citations
- Persona Features Control Emergent MisalignmentMiles Wang, Tom Dupré la Tour, Olivia Watkins, Aleksandar Makelov et al.ICLR 2026 · 81 citations
Builds on22
- Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah et al.NeurIPS 2020 · 64,255 citations
- Training language models to follow instructions with human feedbackLong Ouyang, Jeffrey Wu, Xu Jiang, Diogo Almeida et al.NeurIPS 2022 · 24,707 citations
- 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
- Locating and Editing Factual Associations in GPTKevin Meng, David Bau, Alex Andonian, Yonatan BelinkovNeurIPS 2022 · 3,415 citations
- Plug and Play Language Models: A Simple Approach to Controlled Text GenerationSumanth Dathathri, Andrea Madotto, Janice Lan, Jane Hung et al.ICLR 2020 · 1,166 citations
Related papers
- How Does DPO Reduce Toxicity? A Mechanistic Neuron-Level AnalysisYushi Yang, Filip Sondej, Harry Mayne, Andrew Lee et al.EMNLP 2025 · 3 citations
- Direct Preference Optimization with an OffsetAfra Amini, Tim Vieira, Ryan CotterellACL Findings 2024 · 13 citations
- Improving LLM Safety Alignment with Dual-Objective OptimizationXuandong Zhao, Will Cai, Tianneng Shi, David Huang et al.ICML 2025
- Model Editing as a Robust and Denoised variant of DPO: A Case Study on ToxicityRheeya Uppaal, Apratim Dey, Yiting He, Yiqiao Zhong et al.ICLR 2025
- 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
