Your Benign Training Data Is the Attack Surface: SimpleLoRIF Finds It
Gradient alignment, not content, predicts which fine-tuning examples erode LLM safety. SimpleLoRIF filters million-example datasets and cuts GCG attack success by up to 22% (relative).
Standard content filters assume harmful outputs trace back to harmful inputs. Fine-tuning on data that passes every content check can still quietly erode a model's safety alignment, and the signal that predicts it has nothing to do with what the text says.
The mechanism is gradient alignment. When a training example's gradient points in the same direction as the gradient of unsafe model behavior, that example pulls the model toward unsafe outputs during training, regardless of its surface content. SimpleLoRIF makes this detectable at scale by stripping down a low-rank attribution method and restricting backpropagation to the final four transformer blocks. That shortcut cuts compute enough to embed datasets on the order of a million examples, the scale where practical post-training pipelines operate. Examples whose gradients point toward unsafe behavior get flagged, even when no human reviewer would flag the text itself.
Validation on emergent misalignment, the phenomenon where models trained on insecure code begin producing broadly harmful outputs, shows AUC as high as 0.865 in the gradient space of misaligned models. The result links innocuous-looking insecure-code examples to downstream misbehavior. From there, the method builds SafeTulu: Tulu 3 with the 20% of examples most gradient-aligned with unsafe responses removed. Training on SafeTulu reduces GCG adversarial attack success rate by up to 22% across Qwen, Llama, and OLMo, beating both LLM-as-a-judge filtering and prior gradient-based filtering, while preserving or improving general capability. The 22% is relative: on Qwen 3 1.7B, GCG success fell from 47.67% to 37.00%, a drop of about 10.7 percentage points. For teams running instruction fine-tuning pipelines, the takeaway is direct: content-based dataset audits miss this failure, and gradient-space filtering is now a practical addition.
We're thinking: The uncomfortable implication is that an instruction dataset can be an attack surface that content tooling does not see. We find the emergent misalignment result particularly clarifying: insecure-code examples do not look unsafe and pass content filters, yet their gradients align with the model's unsafe behavior. That moves the threat model for fine-tuning safety from "did someone sneak in bad examples" to "which benign examples happen to point the wrong direction in gradient space." The removed SafeTulu data includes tool-execution failures and narrative arithmetic examples, which suggests this category is not limited to code. How large it is across other datasets remains an open question.
Key takeaways:
- SimpleLoRIF detects safety-degrading training examples by measuring gradient alignment with unsafe behavior instead of inspecting text content, so it catches examples whose surface features pass content filters.
- Training on SafeTulu (Tulu 3 minus the top 20% gradient-aligned examples) cuts GCG attack success by up to 22% relative across three model families; caveat is that the removal fraction is a tunable hyperparameter and optimal thresholds may vary by base model and task distribution.
- Teams running instruction fine-tuning should add gradient-space filtering as a pre-fine-tuning dataset audit step, particularly for datasets that mix tool-use, code, and narrative tasks.
Source: Follow the Gradient: Tracing Safety Degradation Back to Training Data