Glenn Matlin
  • Home
  • About
  • Research
  • Work With Me
  • Publications
  • Blog
  • CV

Backprop through training

influence-functions
Training is just a big computation, so differentiate it: unrolling, TracIn, SOURCE, and MAGIC as one formula with different pieces crossed out.
Author

Glenn Matlin

Published

July 14, 2026

The Illustrated Guide to Data Attribution · Part 4

Backprop through training

Part 3 showed the endpoint of training cannot carry attribution alone. This post takes the other road: treat the whole training run as one computation and differentiate it. Every method in this family, TracIn, SOURCE, MAGIC, is one exact formula with different pieces crossed out.

Jul 14, 2026 Part 4 of 9 Interactive figures

d3 = require(new URL("/assets/js/vendor/d3.v7.min.js", location.origin).href)
core = import(new URL("/assets/js/influence/viz-core.js?v=3", location.origin).href)
viz = import(new URL("/assets/js/influence/widgets.js?v=20", location.origin).href)
theme = core.themeGenerator(Generators)
seriesNav = core.highlightSeriesNav()
WarningWork in progress

This series is an early draft that I am sharing for feedback. Every number and figure comes from a real, seeded experiment, but the prose and the interactive figures are still being revised, so expect rough edges and changes between visits. If something looks broken or reads wrong, I would love to hear about it: glenn@gatech.edu.

The Illustrated Guide to Data Attribution
  1. Which training example taught the model that?
  2. The influence function
  3. When influence breaks
  4. Backprop through training
  5. Influence functions at LLM scale
  6. Datamodels, TRAK, and the attribution landscape
  7. What is data attribution actually for?
  8. Shapley without the combinatorics
  9. No method dominates: the bake-off
unrollData = FileAttachment("data/unroll.json").json()

Part 3 left us with two roads out of the wreckage. The first road repairs the endpoint story: damp the Hessian, fix the question, accept a local counterfactual. The second road starts from the observation that broke the endpoint story in the first place: influence unfolds over training, peaking and even flipping sign as the model learns. If the trajectory is where the information lives, then the trajectory is what we should differentiate.

Here is the idea in one sentence, and it is the best idea in this whole series to steal for other problems: a training run is just a big computation, and we already know how to push credit backward through big computations. We do it a billion times a day. It is called backprop.

Training is a forward pass

Think about what backprop does for a single prediction. The forward pass maps inputs through activations (the intermediate values the network computes along the way) to an output; backprop runs the chain rule in reverse, tracing a small change back through each step that depended on it, so every input gets its share of credit for the output. Nobody finds this mysterious anymore.

Now look at a training run with the same eyes. It maps data (each example carrying a weight, all 1 by default) through a sequence of checkpoints (each training step producing the next) to a final measurement (the trained model’s loss on our gold-star test point). Same shape: inputs, intermediate states, output. So run the chain rule in reverse through training itself, and each training example gets its share of credit for the final measurement. That reverse pass has a name in this literature, unrolling (Bae et al. 2024), and the idea goes back to Hara et al.’s SGD-influence (Hara, Nitanda, and Maehara 2019). The analogy is exact, not decorative:

FIG. 1 · THE ANALOGY THAT ORGANIZES THE WHOLE FAMILY

viz.trainingForward(d3)

Two computations, one chain rule. Top: a forward pass; backprop pushes credit from the output back to the inputs. Bottom: a training run; unrolling pushes credit from the final measurement back to the data. Inputs = data weights. Activations = checkpoints. Output = the measurement. Backprop = unrolling. Press the button to watch credit flow through both lanes; the arrows show the forward computation, and the moving pulse traces credit backward along them.

TipIn plain words

To figure out which ingredient made the soup salty, you can taste the finished soup and reason backward (parts 2 and 3), or you can replay the cooking video and watch what each ingredient did at the moment it went in. This post is the cooking-video method. Its only sin is the obvious one: you have to keep the video.

The exact formula, and its price

Make it concrete on our classroom, where training is full-batch gradient descent with learning rate \(\eta\): \(\theta^{(t+1)} = \theta^{(t)} - \eta\, \nabla L(\theta^{(t)})\) (each step measures the loss’s slope \(\nabla L\) using all sixty points at once, which is the “full batch,” and moves the dials downhill by the step size \(\eta\)), run for \(T = 1500\) steps. How does the final \(\theta^{(T)}\) depend on example \(j\)’s weight? The chain rule answers with a sum over every step where \(j\) was felt:

\[ \frac{d\theta^{(T)}}{dw_j} \;=\; -\sum_{t=0}^{T-1} \underbrace{\left(I - \eta H_{T-1}\right)\cdots\left(I - \eta H_{t+1}\right)}_{\text{transport: how the rest of training carried it}} \;\cdot\; \underbrace{\frac{\eta}{n}\, \nabla \ell_j(\theta^{(t)})}_{\text{the pull of example } j \text{ at step } t} \]

The \(1/n\) is the batch average, a positive scale that changes no sign and no rank. The leading minus is gradient descent moving against the gradient, and it does matter, just not alone: removing an example flips the sign once more (its weight steps from one to zero), the two minuses cancel, and part 1’s convention survives. Positive still means helpful.

Read each factor in plain terms. At step \(t\), example \(j\) tugs the model’s dials (its parameters \(\theta\)) down its gradient: that is the pull. Then every later step transforms that tug: each transport factor \((I - \eta H_t)\) says how a small parameter difference at step \(t\) survives into step \(t+1\), shrinking along stiff directions, persisting along flat ones. Multiply the whole chain and you know how much of the step-\(t\) tug is still standing at the end.

Sum over all the steps and you know how the final dials move when example \(j\)’s weight changes. One last conversion turns dial-movement into credit: dot it with the test gradient, the direction in dial-space that raises the gold-star point’s loss fastest (part 2’s move), then flip the sign once because removal steps the weight from one to zero, and you have a prediction of the change in the measurement, good to first order in the weight change, the same small-step honesty as part 2. What is exact here is the derivative itself: no convexity assumed, no convergence assumed, no unique minimum required. Every one of part 3’s first three causes, dodged.

The price is written in the transport chain: it contains a Hessian per step, the loss’s local curvature at that checkpoint, part 2’s expensive matrix all over again. For our three-parameter classroom, fine; this post computes it exactly. For a real model, \(T\) Hessians is the impossible object of part 2 multiplied by the length of training. Every method in this family is a strategy for not paying that bill, and the honest way to present them is exactly how the field’s own tutorial does it (Ilyas et al. 2024): as deletions from this formula.

The approximation ladder

cheaper, rougher exact, pays for the run TracIn drops transport entirely SOURCE freezes it per segment MAGIC keeps everything, checkpoints the run

TracIn deletes the boldest thing possible: the entire transport chain, treating every \((I - \eta H)\) factor as the identity (Pruthi et al. 2020). What survives is beautifully cheap: the sum, over saved checkpoints, of a dot product between the test gradient and example \(j\)’s gradient. No Hessians anywhere; checkpoints you were probably saving anyway. The bet is that a tug now is a tug forever, uncarried, undamped.

SOURCE deletes less: it segments training into a few phases and freezes one Hessian per segment, so every transport factor in the segment is the same matrix and the whole chain collapses to a single formula you can evaluate directly (a closed form), the way \(2 \times 2 \times \cdots\) collapses to a power (Bae et al. 2024). The bet is milder: training’s curvature changes slowly enough that a few snapshots of it suffice. And SOURCE’s closed form contains a small revelation we will come back to below: the transport chain acts like damping, with the damping constant set by the training run itself.

MAGIC deletes nothing. It computes the exact unrolled derivative, made affordable by recomputation-friendly checkpointing of the training run, and pays the honest storage bill for near-exact single-run attribution (Ilyas and Engstrom 2025).

That is the whole family, and on the classroom we can afford to grade every method against the sixty true retrainings from part 1:

FIG. 2 · ONE FORMULA, THREE WAYS TO CROSS PIECES OUT

viz.unrollLadder(d3, unrollData)

The ladder, graded. Select a method and watch which pieces of the exact formula it crosses out, and what that costs on the classroom: sixty estimates against part 1’s sixty true retrainings. Exact unrolling differentiates the actual finite training run, so it does not even assume the convergence part 2 needed. TracIn’s cheapness and its price are both visible in one click.

Three honest annotations to the ladder. First, cheap does not mean useless: TracIn’s checkpoint sums scale past anything that has to carry a Hessian, and “which examples pulled hardest, ever” is often the right debugging question even uncarried.

Second, cheap does not mean safe: part 3’s opening exhibit, the CIFAR-trained model attributing an MNIST digit to photographs, failed for TracIn and its checkpoint variant too (Hammoudeh and Lowd 2022). The ladder buys you compute; it does not buy you out of checking your answers.

Third, the classroom flatters SOURCE: on this small, fully converged problem the segmented estimate lands on the exact unrolled value to machine precision, because the early steps’ differences contract away entirely. SOURCE’s savings, and its gap from exactness, only show at scales where per-step Hessians are unaffordable (Bae et al. 2024). One more honesty: even exact unrolling grades at 0.9992 against the true retrainings, not 1.000. The derivative is exact; removal is a finite step (a weight dialed from 1 to 0), and any derivative predicts a finite step only to first order, part 2’s tangent line again. That finite-step gap, not unrolling error, is why MAGIC’s own authors say near-optimal rather than exact.

The revelation inside SOURCE

SOURCE’s closed form does something profound. \(K\) repeated shrinkages by the same factor \((1-\eta\sigma)\) compound into exponential decay, the way compound interest compounds growth, and summing what survives gives each curvature direction \(\sigma\) (an eigenvalue of the segment’s Hessian: the stiffness of the loss along one axis) a factor \(\frac{1 - e^{-\eta K \sigma}}{\sigma}\), where \(\eta\) is the learning rate and \(K\) is the number of steps taken with that frozen curvature. Compare that to the endpoint influence function’s \(\frac{1}{\sigma}\), the divide-by-zero machine from part 3:

FIG. 3 · THE DAMPING NOBODY HAD TO TUNE

viz.sourceFilter(d3, unrollData)

Two answers to “how much does a flat direction matter?” The endpoint formula’s \(1/\sigma\) explodes as curvature vanishes: part 3’s valley-floor pathology. The unrolled filter agrees with it for stiff directions but levels off at \(\eta K\) for flat ones (both axes are logarithmic, so the flattening is a genuine plateau, not a trick of scale). The ceiling is the training effort: how far \(K\) steps at rate \(\eta\) could actually have carried anything. Here the curve treats the classroom’s whole 1500-step run as a single frozen segment, so the ceiling sits at \(\eta K = 0.5 \times 1500 = 750\); a shorter segment just lowers the ceiling.

Part 3 ended with damping as an embarrassing knob: an arbitrary \(\lambda\) added to every curvature \(\sigma\) before dividing, capping \(1/\sigma\) at \(1/\lambda\), and someone has to pick it, changing the answer as they pick it. The unrolled view says the knob was never arbitrary: training itself damps flat directions, with an effective \(\lambda\) of \(1/(\eta K)\), because a direction training barely moved along is a direction removal barely matters along. Set part 3’s knob to \(\lambda = 1/(\eta K)\) and the endpoint formula’s \(1/\sigma\) caps at the same ceiling \(\eta K\) the plot shows. The formula could not tell us what to divide by in the flat directions because the honest answer lives in the trajectory, not the endpoint.

Where the two roads meet

One loose end from part 2: if unrolling is exact and the influence function is a local approximation, they should agree somewhere. They do, and the somewhere is instructive: run training long enough on a well-behaved (convex) loss, and the unrolled attribution converges to the influence function’s answer.

FIG. 4 · THE DYNAMICS ROAD REJOINS THE ENDPOINT ROAD

viz.convergeIF(d3, unrollData)

Unroll only the last \(k\) steps of the classroom’s training and correlate the result with part 2’s influence-function answer (and with the true retrainings). As \(k\) grows, the dynamics answer converges to the endpoint answer: on a convex problem, run to convergence, the two roads are one road. The at-scale version of this statement, with a pseudoinverse (a version of matrix inversion that skips the flat directions instead of blowing up on them) doing the reconciling, is exactly where the two families meet (Mlodozeniec et al. 2025; Bae et al. 2024).

The theory behind that convergence has recently been made precise, and it runs deeper than a sanity check: influence functions turn out to be the limiting case of unrolled differentiation, no convexity required, with the flat directions handled by a pseudoinverse rather than a divide-by-zero (Mlodozeniec et al. 2025).

The endpoint methods of parts 2 and 3 are not a different theory from the dynamics methods of this post; they are the equilibrium limit of one theory. And everything that went wrong in part 3 went wrong where the limit does not apply: valleys the run never settled into, directions it never explored, stages it was still passing through.

TipIn plain words

The soup-tasting method and the cooking-video method give the same verdict for a soup that simmered so long that history stopped mattering. Every disagreement between them is the video catching something the finished soup cannot show: an ingredient added late, or one whose flavor cooked away.

The bill, again

This family has its own bill to pay: what MAGIC has to keep is the run. Exact unrolling needs the trajectory, checkpointed cleverly (only \(O(\log T)\) checkpoints held at a time, paid for with an \(O(T \log T)\) recompute bill), and needs Hessian-vector products along it (multiplying the curvature matrix against a chosen vector, which can be done without ever writing the matrix down) (Ilyas and Engstrom 2025). TracIn needs only checkpoints and gradients, but Fig. 2 shows what the discount costs. And every step of the ladder that keeps any transport still carries part 2’s other giant: curvature in a parameter space that, for a frontier model, has more Hessian entries than any machine has bytes. Even TracIn, which dodges the matrix, pays for per-example gradients in that same space.

Part 5 goes there: what actually ran on a 52-billion-parameter model, how the Hessian was factored into something storable, and a stranger idea, replacing the inversion with sampling. That last idea lives on the endpoint road of part 3’s fork, but it shares this post’s respect for what training actually did rather than what optimality says it should have done.

Further reading

The family, in order of deletion

  • Pruthi, Liu, Kale, and Sundararajan, “Estimating Training Data Influence by Tracing Gradient Descent” (Pruthi et al. 2020). TracIn: the transport-free end of the ladder.
  • Bae, Lin, Lorraine, and Grosse, “Training Data Attribution via Approximate Unrolling” (Bae et al. 2024). SOURCE: segmented transport, and the training-effort damping made explicit.
  • Ilyas and Engstrom, “MAGIC: Near-Optimal Data Attribution for Deep Learning” (Ilyas and Engstrom 2025). Exact unrolling with a checkpointing budget.
  • Hara, Nitanda, and Maehara, “Data Cleansing for Models Trained with SGD” (Hara, Nitanda, and Maehara 2019). The unrolling idea applied to SGD, before the family had a name.

The reconciliation

  • Mlodozeniec, Reid, Power, Krueger, Erdogdu, Turner, and Grosse, “Distributional Training Data Attribution: What do Influence Functions Sample?” (Mlodozeniec et al. 2025). Influence functions as the limit of unrolling, flat directions and all.
  • Lee, Smith, Adam, and Hoogland, “Influence Dynamics and Stagewise Data Attribution” (Lee et al. 2025). Part 3’s sign-flip result: the trajectory structure this family exists to capture.

The map

  • The ICML 2024 tutorial “Data Attribution at Scale” (Ilyas et al. 2024), whose deletion-based presentation of this family Fig. 2 follows.

References

Bae, Juhan, Wu Lin, Jonathan Lorraine, and Roger Grosse. 2024. “Training Data Attribution via Approximate Unrolling.” In Advances in Neural Information Processing Systems. Vol. 37. https://arxiv.org/abs/2405.12186.
Hammoudeh, Zayd, and Daniel Lowd. 2022. “Identifying a Training-Set Attack’s Target Using Renormalized Influence Estimation.” In Proceedings of the 2022 ACM SIGSAC Conference on Computer and Communications Security (CCS). https://doi.org/10.1145/3548606.3559335.
Hara, Satoshi, Atsushi Nitanda, and Takanori Maehara. 2019. “Data Cleansing for Models Trained with SGD.” In Advances in Neural Information Processing Systems, 32:4215–24. https://arxiv.org/abs/1906.08473.
Ilyas, Andrew, and Logan Engstrom. 2025. “MAGIC: Near-Optimal Data Attribution for Deep Learning.” https://arxiv.org/abs/2504.16430.
Ilyas, Andrew, Sung Min Park, Logan Engstrom, Kristian Georgiev, and Aleksander Mądry. 2024. “Data Attribution at Scale.” Tutorial at the International Conference on Machine Learning (ICML). https://ml-data-tutorial.org/.
Lee, Jin Hwa, Matthew Smith, Maxwell Adam, and Jesse Hoogland. 2025. “Influence Dynamics and Stagewise Data Attribution.” https://arxiv.org/abs/2510.12071.
Mlodozeniec, Bruno, Isaac Reid, Sam Power, David Krueger, Murat Erdogdu, Richard E. Turner, and Roger Grosse. 2025. “Distributional Training Data Attribution: What Do Influence Functions Sample?” In Advances in Neural Information Processing Systems. https://arxiv.org/abs/2506.12965.
Pruthi, Garima, Frederick Liu, Satyen Kale, and Mukund Sundararajan. 2020. “Estimating Training Data Influence by Tracing Gradient Descent.” In Advances in Neural Information Processing Systems. Vol. 33. https://arxiv.org/abs/2002.08484.

Reproducibility. Every number on this page is computed by a seeded script in the site repository (scripts/influence-data/): the exact unrolled derivatives are propagated step-by-step alongside the classroom’s actual 1500-step training run and validated against finite-difference retraining before shipping; TracIn sums over 12 evenly spaced checkpoints of the same run; the segmented (SOURCE-style) estimate reuses the same recorded trajectory with the Hessian frozen at each of 3 segment midpoints. The convergence curve truncates the same recursion. The classroom’s exact leave-one-out values are part 1’s, reasserted at build time.

Acknowledgements. The backprop-through-training analogy that organizes this post, and the reading of SOURCE’s filter as training-effort damping, follow Louis Jaburi’s lecture notes “Data (Attribution) for Alignment” (Iliad Intensive, April 2026).

The Illustrated Guide to Data Attribution
  1. Which training example taught the model that?
  2. The influence function
  3. When influence breaks
  4. Backprop through training
  5. Influence functions at LLM scale
  6. Datamodels, TRAK, and the attribution landscape
  7. What is data attribution actually for?
  8. Shapley without the combinatorics
  9. No method dominates: the bake-off

© 2025-2026 Glenn Matlin