When a large language model (LLM) generates a hallucination, leaks copyrighted text, or exhibits toxic behavior, a natural question arises: which specific training documents caused this behavior?
The foundational framework for answering this is Data Attribution, which aims to quantify the counterfactual impact of a training instance on a model's final predictions. Historically, the gold standard for data attribution has been the influence function. Popularized in deep learning by Pang Wei Koh et al., influence functions use first- and second-order derivatives to estimate how a model's parameters—and thus its predictions—would shift if a specific training point were removed, all without the prohibitive cost of retraining the model from scratch.
However, as models have scaled from millions to hundreds of billions of parameters, traditional influence functions have hit a hard scalability wall. Calculating an influence score requires computing an inverse Hessian-vector product (IHVP). For a model with $P$ parameters, the Hessian matrix is $P \times P$, making exact computation completely impossible at scale. Furthermore, as Huawei Lin et al. and Sang Keun Choe point out, simply storing raw, high-dimensional per-sample gradients for billions of parameters requires hundreds of gigabytes per sample, exceeding modern hardware capacities.
To make data attribution practical for modern foundation models, a major research direction has emerged to bypass or compress these high-dimensional bottlenecks.
Compressing the Gradient Space
The core intuition behind accelerating gradient-based attribution is that the gradient space of a deep neural network is highly redundant. Even though a model may have billions of parameters, the effective dimensionality of its updates during optimization is much lower.
To exploit this property, TRAK, a method introduced by Sung Min Park et al., leverages the Neural Tangent Kernel (NTK) framework combined with random projections. Instead of calculating and storing raw, high-dimensional gradients, TRAK projects these gradients into a significantly lower-dimensional subspace using random Rademacher or Gaussian projections. Because random projections preserve the relative inner products between vectors (via the Johnson-Lindenstrauss lemma), the similarity between a training gradient and a test gradient—which dictates influence—is preserved at a fraction of the computational cost.
[High-Dimensional Gradient] (Billions of Parameters)
│
▼ (Random Projection / Sparsification)
[Low-Dimensional Subspace] (Preserves Inner Products)
│
▼
[Fast Influence Estimation] (100x–1000x Speedup)
Building on this geometric intuition, Pingbang Hu et al. introduced GraSS (and its variant FactGraSS), which targets the inherent sparsity of per-sample gradients. Rather than treating gradients as dense vectors, they apply gradient sparsification before projection. By keeping only the top- $k$ most significant gradient entries and utilizing sparse random projections, they eliminate the memory bottleneck of storing dense parameter updates. Similarly, the RapidIn framework developed by Huawei Lin et al. compresses massive gradient vectors by over 200,000x into compact representations called "RapidGrads," enabling token-wise data attribution on 70-billion-parameter models in mere minutes.
Bypassing the Hessian with Trajectories and Unlearning
Another major strategy for scaling data attribution is to eliminate the second-order derivative (the Hessian matrix) entirely, substituting it with tracking mechanisms or localized optimization.
Gradient Rollback and Trajectory Tracking
Instead of calculating how a final model state would change statically, some methods look backward at the optimization path. Gradient Rollback, proposed by Carolin Lawrence and Mathias Niepert, tracks the actual parameter updates that occurred during training. At test time, they estimate influence by literally "rolling back" the updates contributed by a specific sample, bypassing the need to approximate the curvature of the loss landscape via a Hessian.
Gradient Ascent as Pseudo-Unlearning
Rather than estimating what would happen if data were absent, why not actively remove it? Masaru Isonuma and Ivan Titov developed UnTrac, a method that utilizes localized gradient ascent to simulate data removal. By taking a few gradient ascent steps on a target dataset—effectively forcing the model to "unlearn" it—and observing how the model's output probabilities shift, they can accurately trace the source of specific behaviors without the catastrophic cost of full model retraining.
Zeroth-Order Approximations
Taking the elimination of derivatives to its logical conclusion, the authors of Z0-Inf: Zeroth Order Approximation for Data Influence dispense with gradients entirely. Z0-Inf estimates data influence by analyzing the trajectory of loss values recorded across intermediate training checkpoints. Because a sample's influence leaves a distinct footprint on how the loss of related samples drops over time, tracking these scalar loss values provides an order-of-magnitude speedup over first- and second-order methods while remaining highly accurate.
Subspace Localization and Prompt-Based Proxies
A final frontier in scalability involves reducing the scope of what we measure—either by isolating specific layers within the network or by replacing mathematical attribution with behavioral prompting.
Layer-Wise Selection
In massive architectures, calculating influence across every single layer is often redundant. Dmytro Vitel and Anshuman Chhabra challenged the conventional assumption that the earliest embedding layers are the best proxies for data influence. They demonstrated that middle attention layers capture the most robust data influence signals in LLMs. By restricting influence calculations to these specific layers and employing rank-aggregation voting strategies, researchers can drastically shrink the parameter space under analysis.
In-Context Probing
Perhaps the most radical departure from traditional influence functions is In-Context Probing (ICP), introduced by Cathy Jiao et al.. Recognizing that LLMs possess strong in-context learning and evaluation capabilities, ICP bypasses backpropagation entirely. Instead, it prompts the LLM itself to score the relevance or supportive quality of a training data sample relative to a given test output.
[Test Output] + [Candidate Training Document]
│
▼ (Fed into LLM Prompt)
"Rate the relevance of this document..."
│
▼ (Zero-Gradient Output)
[Influence Score]
Surprisingly, for in-domain data, these zero-gradient, prompt-based rankings correlate strongly with formal, computationally expensive influence functions, offering a highly scalable, black-box alternative for data attribution.
Summary
Scaling data attribution from toy models to frontier LLMs has required moving away from exact, brute-force mathematical formulations toward clever approximations. Whether by projecting gradients into low-dimensional spaces (Sung Min Park et al.), simulating data removal via unlearning (Masaru Isonuma and Ivan Titov), or leveraging the model's own internal representations (Cathy Jiao et al.), these modern techniques ensure that interpretability can keep pace with the relentless scale of modern AI.