Follow the Gradient: Tracing Safety Degradation Back to Training Data
Not on the map. Why?
Abstract (arXiv)
Fine-tuning Large Language Models (LLMs) on instruction data can quietly erode their safety, even when no training example looks harmful. Because this safety-degrading data looks benign, standard content filters struggle to catch it. We tackle this problem by developing SimpleLoRIF, a scalable gradient embedding method that identifies fine-tuning examples whose gradients align with unsafe behavior. By simplifying a low-rank attribution method and restricting backpropagation to the final four transformer blocks, SimpleLoRIF can embed datasets on the order of a million examples, boosting gradient attribution from a small-scale analysis tool into a practical filter for full post-training datasets. We first validate it on emergent misalignment, where we find that gradients can connect insecure-code training data to the broadly harmful behaviors that appear after fine-tuning, with AUC as high as 0.865 in the gradient space of misaligned models. We then use SimpleLoRIF to build SafeTulu, a version of Tulu 3 with the 20% of examples most gradient-aligned with unsafe responses removed. Training on SafeTulu reduces GCG attack success rate by up to 22% across Qwen, Llama, and Olmo, outperforming both LLM-as-a-judge and prior gradient-based filtering, while largely preserving or even improving capability. Finally, we analyzed the removed data and identify possibly under-studied sources of safety degradation, such as tool-execution failures and narrative arithmetic. We release SafeTulu along with a Hugging Face Space that lets researchers build their own customized versions of SafeTulu to fine-tune on, such as by changing the removal fraction or filtering only certain subsets.
Key facts. No citing papers in the map yet (data through 26 Nov 2026). Builds on 42 of its 49 references that are in the map. Submitted 27 Oct 2026.
Builds on
42 of 49 references.
References · 42
- 2021Training Verifiers to Solve Math Word Problemscited by 11,055
- 2023Let's Verify Step by Stepcited by 4,259
- 2021Program Synthesis with Large Language Modelscited by 3,972
- 2017Understanding Black-box Predictions via Influence Functionscited by 1,815
- 2024HarmBench: A Standardized Evaluation Framework for Automated Red Teaming and Robust Refusalcited by 1,584
- 2020What Disease does this Patient Have? A Large-scale Open Domain Question Answering Dataset from Medical Examscited by 1,464
- 2023Instruction-Following Evaluation for Large Language Modelscited by 1,433
- 2024Qwen2.5-Coder Technical Reportcited by 1,301
- 2023Fine-tuning Aligned Language Models Compromises Safety, Even When Users Do Not Intend To!cited by 1,236
- 2024Tulu 3: Pushing Frontiers in Open Language Model Post-Trainingcited by 1,205
- 2020Estimating Training Data Influence by Tracing Gradient Descentcited by 616
- 2024JailbreakBench: An Open Robustness Benchmark for Jailbreaking Large Language Modelscited by 597
30 more
- 2024LESS: Selecting Influential Data for Targeted Instruction Tuningcited by 594
- 2018Spectral Signatures in Backdoor Attackscited by 497
- 2018Detecting Backdoor Attacks on Deep Neural Networks by Activation Clusteringcited by 472
- 20242 OLMo 2 Furiouscited by 413
- 2023TRAK: Attributing Model Behavior at Scalecited by 317
- 2024PKU-SafeRLHF: Towards Multi-Level Safety Alignment for LLMs with Human Preferencecited by 293
- 2024OR-Bench: An Over-Refusal Benchmark for Large Language Modelscited by 281
- 2020Witches' Brew: Industrial Scale Data Poisoning via Gradient Matchingcited by 170
- 2023Backdooring Instruction-Tuned Large Language Models with Virtual Prompt Injectioncited by 168
- 2024What is in Your Safe Data? Identifying Benign Data that Breaks Safetycited by 128
- 2023Instructions as Backdoors: Backdoor Vulnerabilities of Instruction Tuning for Large Language Modelscited by 126
- 2025Persona Features Control Emergent Misalignmentcited by 112
- 2024What is Your Data Worth to GPT? LLM-Scale Data Valuation with Influence Functionscited by 103
- 2024LLMs know their vulnerabilities: Uncover Safety Gaps through Natural Distribution Shiftscited by 101
- 2025Poisoning Attacks on LLMs Require a Near-constant Number of Poison Samplescited by 89
- 2024SEAL: Safety-enhanced Aligned LLM Fine-tuning via Bilevel Data Selectioncited by 68
- 2025Safety Pretraining: Toward the Next Generation of Safe AIcited by 54
- 2021Poison Forensics: Traceback of Data Poisoning Attacks in Neural Networkscited by 41
- 2022Identifying a Training-Set Attack's Target Using Renormalized Influence Estimationcited by 34
- 2022Not All Poisons are Created Equal: Robust Training against Data Poisoningcited by 31
- 2026Emergent Misalignment is Easy, Narrow Misalignment is Hardcited by 31
- 2025Layer-Aware Representation Filtering: Purifying Finetuning Data to Preserve LLM Safety Alignmentcited by 25
- 2024A Study of Backdoors in Instruction Fine-tuned Language Modelscited by 15
- 2024Gracefully Filtering Backdoor Samples for Generative Large Language Models without Retrainingcited by 10
- 2026Understanding Emergent Misalignment via Feature Superposition Geometrycited by 8
- 2025Fixing It in Post: A Comparative Study of LLM Post-Training Data Quality and Model Performancecited by 5
- 2026LoRIF: Pushing the Scalability Frontier of Training Data Attributioncited by 4
- 2026Data Attribution of Emergent Misalignment with Persona Featurescited by 2
- 2026GradSentry: Gradient Spectral Entropy for Backdoor Sample Filtering in Large Language Model Fine-Tuningcited by 1
- 2026The Heterogeneous Safety Impacts of Benign Multilingual Fine-Tuningcited by 1
Built on by
Not cited yet.