Tracing Computation Density in LLMs

Corentin Kervadec, Iuliia Lysova, Iuri Macocco, Marco Baroni, Gemma BoledaarXiv 2026

TL;DR

Do Large Language Models (LLMs) use their entire multi-billion-parameter capacity for every single token they predict? This paper introduces s-Trace, a training-free method that extracts the minimal computational subgraph required to reconstruct an LLM's output distribution. The authors discover that LLM computation is split into two distinct phases: a highly stable, early-layer "minimal core" that handles basic token prediction, followed by a late-layer "refinement phase" that dynamically activates to handle complex or uncertain contexts.

What Problem Does This Paper Address?

During standard inference, an LLM executes its entire computational graph—billions of operations across dozens of layers—regardless of whether it is predicting a highly predictable punctuation mark or a complex, context-dependent word. This uniform execution hides a deeper question: What is the true computational footprint required for a given input?

While the field of mechanistic interpretability attempts to isolate small, human-interpretable "circuits" for specific tasks (like subject-verb agreement), scaling these techniques to general next-token prediction across large models has been computationally intractable. This paper bridges the gap by providing a scalable framework to map out the "computation density" of LLMs across diverse inputs, shedding light on how models dynamically allocate their capacity.

Methods

The authors represent an LLM as a fine-grained, token-wise directed acyclic graph $\mathcal{G} = (\mathcal{V}, \mathcal{E})$, where nodes represent intermediate token states and edges represent specific operations (Residual connections, MLP layers, and individual Attention heads).

To find the most efficient subgraph of a target size $s$, they introduce s-Trace. Because brute-force search or causal patching is too expensive at the scale of 7B–14B parameter models, s-Trace uses a scalable, activation-based proxy:

  1. Importance Scoring: Edges are scored based on the $L_1$-norm of their update vectors, normalized node-wise. The intuition is that operations producing larger vector updates have a greater impact on the final prediction.
  2. Graph Traversal: A Greedy Best-First Search algorithm starts at the final output node and traverses backward, iteratively adding the most important available edges until the budget $s$ is reached.

Faithfulness is evaluated by measuring the Total Variation (TV) distance between the output distribution of the pruned subgraph and the full model.

Datasets & Models

  • Dataset: 5,000 text sequences sampled from Wikitext, cleaned to ensure they contain complete sentences (averaging 40 words per sequence).
  • Model Zoo: The authors evaluate 10 different open-source LLMs spanning 7 distinct architecture families, ranging from 7B to 14B parameters (including Llama-3.1-8B, Mistral-7B-v0.1, OLMo-2, Qwen2.5, Qwen3, DeepSeek-LLM, and Phi-4).

Key Insights and Ideas

  • The Two-Phase Hypothesis: LLM computation isn't uniform. It consists of a Construction Phase (where a tiny fraction of the graph rapidly builds the core prediction) and a Refinement Phase (where additional parameters slowly polish the distribution).
  • The Stable "Minimal Core": At a tiny relative graph size ($s \approx 10^{-3}$, or 0.1% of the model), a highly stable, architecture-invariant subgraph emerges. This core is heavily concentrated in early layers and is sufficient to correctly guess the top-1% most likely tokens.
  • Extreme Sparsity in Attention: Attention heads make up over 99% of an LLM's total possible edges. However, within the minimal core, the distribution is surprisingly balanced (50% attention, 30% residual, 20% MLP). This implies that early-stage attention operates under extreme, input-independent sparsity.
  • Linguistic Complexity Maps to Graph Density: Sparser subgraphs are sufficient for encoding shallow statistics like unigram frequency. When the model encounters rare words or high-uncertainty contexts, it recruits a significantly larger, denser network of later-layer attention heads to refine its predictions.

Key Results

The authors show a striking drop in reconstruction error during the initial construction phase across all 10 models:

Figure 1: Relation between reconstruction error (measured with Total Variation distance) and trace size for various LLMs. The trace undergoes two distinct phases: a construction phase, and a refinement phase.

As shown in the figure below, a graph budget of just $10^{-3}$ (0.1%) is enough to reconstruct the top-1% of the probability mass (greedy decoding). However, to capture 40% to 60% of the full distribution mass (necessary for high-quality nucleus sampling), the model must transition into the refinement phase, requiring an order-of-magnitude more graph edges ($s \approx 10^{-2}$).

Figure 2: The minimal size s required to reconstruct the top-k% (nucleus target) of the full model’s probability mass. A very small trace (s ≈10−3, the minimal core) suffices to reconstruct the top 1% prediction, but only at the end of the construction phase (s = 10−2) do we recover 40% to 60% of the probability mass.

To quantify this, the authors define Computational Density ($C$) as the area under the error-vs-log-size curve. They find that $C$ consistently and significantly:

  • Correlates positively with output entropy ($\mu = 0.22$): Higher model uncertainty means more computation is recruited.
  • Correlates negatively with token frequency (ranging from $-0.45$ to $-0.22$): Common words require less graph density than rare words.

Limitations and Future Work

While s-Trace offers an unprecedented look at LLM computation density, the authors note a few key limitations:

  • Heuristic vs. Causal: The $L_1$-norm magnitude heuristic is an empirical proxy and lacks strict causal guarantees, though it vastly outperforms random baselines and alignment-based metrics.
  • Ablation Artifacts: The subgraphs are evaluated using zero-ablation, which can occasionally push internal activations off the model's natural data manifold.
  • Scope: The current study is restricted to English text and decoder-only Transformer architectures.

Future work includes extending this framework to other languages and non-Transformer architectures, as well as exploring how computational density can be used as a practical metric for human linguistic complexity.

Summary updated

BibTeX
@misc{kervadec2026tracing,
  author = {Corentin Kervadec and Iuliia Lysova and Iuri Macocco and Marco Baroni and Gemma Boleda},
  title = {{Tracing Computation Density in LLMs}},
  year = {2026},
  eprint = {2605.27033},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2605.27033},
}
Figure