Gradient Atoms: Unsupervised Discovery, Attribution and Steering of Model Behaviors via Sparse Decomposition of Training Gradients
Organizations: FLAIR, University of Oxford
Abstract
Training data attribution (TDA) methods ask which training documents are responsible for a model behavior. However, models often learn broad concepts shared across many examples. Moreover, existing TDA methods are supervised -- they require a predefined query behavior, then score every training document against it -- making them both expensive and unable to surface behaviors the user did not think to ask about. We present Gradient Atoms, an unsupervised method that decomposes per-document training gradients into sparse components ("atoms") via dictionary learning in a preconditioned eigenspace. Each atom captures a shared update direction induced by a cluster of functionally similar documents, directly recovering the collective structure that per-document methods do not address. Among 500 discovered atoms, the highest-coherence ones recover interpretable task-type behaviors -- refusal, arithmetic, yes/no classification, trivia QA -- without any behavioral labels. These atoms double as effective steering vectors: applying them as weight-space perturbations produces large, controllable shifts in model behavior (e.g., bulleted-list generation 33% to 94%; systematic refusal 50% to 0%). The method requires no query--document scoring stage, and scales independently of the number of query behaviors of interest. Code is available at https://github.com/jrosseruk/gradient_atoms.
Figures & tables
| Docs per atom (median) | Atoms coh | Atoms coh | |
|---|---|---|---|
| 0.01 | 3 | ||
| 0.1 | 5 | 43 | |
| 1.0 | 0 | 0 | 0 |
| Atom | Behavior | Coh. | Base | Best | Best | ||
|---|---|---|---|---|---|---|---|
| #415 | Yes/No Classification | 0.647 | 39% | 51% | 12pp | 0% | 39pp |
| #64 | Code Generation | 0.201 | 42% | 58% | 16pp | 28% | 14pp |
| #161 | Systematic Refusal | 0.111 | 50% | 55% | 5pp | 0% | 50pp |
| #469 | Bulleted Lists | 0.103 | 33% | 94% | 61pp | 0% | 33pp |
| #299 | Numbered Lists | 0.103 | 58% | 59% | 1pp | 8% | 50pp |
Appendix figures & tables2 assets
Supplementary material from the paper’s appendix.
Appendix
| Step | Resources | Time |
|---|---|---|
| Gradient extraction | A100 40GB | 170s |
| EKFAC projection | CPU, 16GB RAM | min |
| Dictionary learning ( ) | CPU, 32GB RAM | min |
| Coherence computation | CPU, 8GB RAM | min |
| Total | min |
| Rank | Atom | Coherence | Active Docs | Description |
|---|---|---|---|---|
| 1 | #348 | 0.725 | 139 | Short factual Q&A—trivia with one-word/numeric answers |
| 2 | #328 | 0.672 | 110 | Grammar and sentence editing |
| 3 | #415 | 0.647 | 156 | Yes/No/True/False binary classification |
| 4 | #458 | 0.643 | 124 | Simple arithmetic |
| 5 | #498 | 0.614 | 176 | Multi-category classification and labeling |
| 6 | #358 | 0.499 | 88 | Sentence transformation (voice, tense, translation) |
Gradient-Based Attribution
Gradient-Based Attribution uses model derivatives to estimate which inputs, features, parameters, or training examples influence predictions and behaviors.
See all 109 papers