Introduction
Looped (or weight-tied) transformers are an emerging architecture that performs "latent reasoning" by recursively applying a single transformer block to hidden states. This mechanism allows the model to "think longer" on complex problems without increasing its parameter count. However, understanding the internal dynamics of this iterative process remains a significant challenge.
Existing data attribution methods, such as TracIn, provide a single scalar score to quantify a training example's influence (e.g., "Example A helped the model learn Task B"). In a looped model, this aggregated score is insufficient. It masks crucial temporal dynamics, such as whether an example aided the start of the reasoning process (parsing) or the end (iterative refinement). Furthermore, scalar aggregation can hide "signal cancellation," where an example positively influences early steps but negatively impacts later ones. To address this, researchers introduce Step-Decomposed Influence (SDI), a framework that breaks down data attribution into a step-by-step trajectory.
Methodology: Step-Decomposed Influence and TensorSketch
The core innovation of SDI is mathematically decomposing the total gradient of a looped transformer into a sum of per-step terms. Instead of a single scalar influence score, SDI generates a vector trajectory of length $\tau$, where $\tau$ represents the number of loop iterations.
Calculating per-example gradients for every step of a transformer is notoriously memory-intensive. To make SDI practical at scale, the authors developed a "sketch-during-backprop" pipeline using Streaming TensorSketch. This randomized dimensionality reduction technique compresses gradients on-the-fly, entirely avoiding the materialization of massive full-rank matrices. The researchers also derived tighter variance bounds for TensorSketch, ensuring the approximation remains highly accurate even for models with hundreds of millions of parameters.
The framework was evaluated across three distinct regimes:
- Parity Tasks: Synthetic bit-string sequences used to probe mechanistic circuits.
- Sudoku (SATNet): 10,000 puzzles of varying difficulty to study the relationship between compute scaling and data influence.
- Recursive Nanochat: A 328.3M parameter GPT-style chat model trained on a mixture of reasoning and language datasets (e.g., GSM8K, ARC, and SmolTalk).
Key Findings and Insights
Efficiency and Fidelity
The TensorSketch implementation proved to be roughly 1,000x less memory-intensive than storing full per-example gradients. On an NVIDIA A6000 GPU, this efficiency allowed the feasible batch size for attribution to jump from 4 to 40. Furthermore, the sketched SDI estimates matched full-gradient baselines with a remarkably low relative error (~0.038 at a sketch dimension of 2048).
The "Influence Horizon" and Targeted Data Removal
In the Sudoku tasks, harder puzzles maintained high "SDI energy" much deeper into the loop iterations compared to easy puzzles. This confirms that additional test-time compute is specifically useful because it allows late-stage training influence to manifest. To validate this, the authors conducted a counterfactual experiment: they removed the top 30% of training data identified by SDI as highly influential in late steps. This targeted removal specifically crashed the model's performance on hard Sudoku puzzles while leaving easy puzzles relatively unaffected.
Uncovering Hidden Dynamics
SDI successfully revealed complex functional roles of training data that traditional methods miss:
- Signal Cancellation: The authors identified examples with near-zero total influence that actually had massive positive effects in early steps and massive negative effects in later steps.
- Implicit Step Counters: In the Nanochat LLM, influence grew almost exponentially, concentrating in the final loop iterations regardless of the total allowed loops. This suggests looped transformers spontaneously learn to represent their own progress through the recurrence, effectively "knowing" when they are nearing the end of their thought process.
- Mechanistic Discovery: SDI trajectories on parity tasks exhibited periodic "sawtooth" oscillations. This observation led to the discovery that the model was cycling through a discrete four-state finite-state automaton to solve the problem.
Limitations and Future Directions
While SDI offers a powerful new lens for interpretability, the authors note several limitations. First, SDI (like TracIn) is most theoretically sound under standard SGD. Although an AdamW-preconditioned version yielded similar rankings, further work is needed to perfectly align attribution with modern adaptive optimizers. Second, computing dense influence matrices for millions of training examples remains computationally expensive; the authors suggest using sketched vectors as "indexable embeddings" for fast nearest-neighbor retrieval. Finally, models trained with truncated Backpropagation Through Time (BPTT) can systematically zero out early-step influence by construction, requiring careful handling during post-hoc analysis.
Summary updated