Entropy-Lens: The Information Signature of Transformer Computations

Riccardo Ali, Francesco Caso, Christopher Irwin, Pietro Lio · Submission to ICLR 2026 · Rejected

TL;DR

Entropy-Lens is a lightweight, gradient-free interpretability framework that tracks the Shannon entropy of intermediate token predictions as representations pass through a transformer's layers. The resulting 1D "entropy profiles" act as distinct computational signatures—identifying model families, classifying task formats, and even predicting whether a model's final answer is correct.

What Problem Does This Paper Address?

Most mechanistic interpretability methods focus on internal latent activations (e.g., attention maps, residual stream vectors) or require training separate linear probes like the tuned-lens. An alternative approach, the logit-lens, decodes intermediate layer representations directly into vocabulary space using the model’s pretrained unembedding matrix.

However, intermediate token distributions are high-dimensional and defined over an unordered categorical support (the vocabulary). Standard statistical descriptors like variance or higher-order cumulants are ill-defined because permuting token IDs drastically changes their values. The authors tackle this by asking: Can we compress layer-by-layer intermediate vocabulary distributions into a principled, permutation-invariant scalar signal that characterizes the model’s internal computation without any retraining or gradients?

Methods

Entropy-Lens uses the model's existing unembedding head and final layer norm to map the hidden state $x_j^i$ of token $j$ at layer $i$ into a vocabulary probability distribution $y_j^i = \text{softmax}(D(x_j^i))$.

  1. Entropy Profile Extraction: For each layer $i \in \{1, \dots, L\}$, it computes the Shannon entropy $h_j^i = H(y_j^i) = -\sum_k p(x_k) \log p(x_k)$, producing an $L$-dimensional vector per token.
  2. Profile Aggregation: Concatenates entropy profiles across $T$ generated tokens into an aggregated matrix $h_{[N:T]}$.
  3. Downstream Classification & Probing: Feeds the profiles into simple, non-parametric classifiers ($k$-NN) or dimensionality reduction tools (t-SNE, PCA).
  4. Rényi Entropy Generalization: Evaluates Rényi entropy $H_\alpha$ across varied $\alpha$ orders to investigate how distribution tails affect profile expressiveness.

The technique requires only standard forward passes and hidden-state extraction—no fine-tuning, probes, or backpropagation.

Datasets

The authors evaluated Entropy-Lens on off-the-shelf LLMs (GPT-2, Gemma, LLaMA, Qwen, and Phi-3, up to 9B parameters) and Vision Transformers (ViT, DeiT) across several benchmarks:

  • TinyStories: Used to evaluate task-type identification across three distinct tasks (generative text continuation, syntactic word counting, and semantic theme extraction) presented under Base, Reversed, and Scrambled prompt templates.
  • MMLU (Massive Multitask Language Understanding): Multiple-choice questions spanning 57 subjects, formatted with three prompt variations (Base, Instruct, and Humble—the latter instructing the model to guess randomly if uncertain).
  • Topic-Format Dataset (Newly Introduced): 450 prompts pairing 150 diverse topics with three distinct style constraints (poem, scientific piece, chat log) to isolate stylistic formatting signals from semantic topics.
  • ImageNet-1K (Vision): A 20-class subset used to inspect intermediate entropy trajectories in Vision Transformers.

Key Insights and Ideas

  • Architectural Fingerprints: Entropy profiles form recognizable signatures unique to model families, largely invariant under depth rescaling ($x$-axis normalized to $[0, 1]$):
  • GPT: Entropy steadily decreases layer-by-layer.
  • LLaMA: Jumps rapidly from low entropy to an elevated plateau across intermediate layers before cooling down.
  • Gemma: Starts high, dips sharply, rebounds in intermediate layers, and drops again near the exit.
  • Connection to Depthwise Memorization: The authors link layerwise entropy to conditional entropy $H(X|\hat{\Theta}_i)$, viewing each layer as an early-exit truncated sub-model. Rather than memorizing training data monotonically across depth, transformers exhibit non-monotonic, context-dependent phases of entropy expansion (exploration) and contraction (selection).
  • The Informative Rényi Regime: Across $\alpha \in [0.01, 1500]$, very low $\alpha < 0.2$ causes profiles to collapse toward maximum entropy, while high $\alpha > 20$ causes collapse toward the top-1 prediction. The intermediate interval ($0.5 \le \alpha \le 20$) yields maximum contrast, validating standard Shannon entropy ($\alpha = 1$) as a robust, parameter-free choice.

Key Results

  • Model & Size Identification: A $k$-NN classifier distinguished model families with a 97.99% Macro F1 and classified model parameter bins (<1B, 1–3B, 3–5B, >5B) with a 96.31% Macro F1.
  • Task Identification: Entropy profiles predicted whether a model was performing generative, syntactic, or semantic tasks on TinyStories with 94.77% to 98.38% ROC-AUC across architectures. Complete layer profiles strongly outperformed single-layer baselines (e.g., 90.49% AUC vs. 68.34% for first-layer only on Gemma-2-2B-it).
  • Task Correctness: On MMLU, entropy profiles predicted whether the model's answer was correct or incorrect with 67.23% to 73.61% ROC-AUC, significantly outperforming class-balanced dummy baselines ($p < 0.05$).
  • Format vs. Content: On the topic-format dataset, PCA on entropy profiles showed clear linear separation by output format (poems vs. chat logs vs. scientific text), achieving up to 98.7% ROC-AUC.
  • Cross-Modality: ViTs and DeiTs displayed high-to-low entropy profiles resembling language models, showing the approach transfers naturally to vision architectures.

Limitations and Future Work

  • Lack of Formal Task Definitions: Concepts like "task type" and "format" were empirically demonstrated using specific prompt designs rather than formal definitions.
  • Unexplained Family Dynamics: The precise training dynamics or architectural nuances causing distinct family curves (e.g., Gemma’s mid-depth rebound vs. LLaMA’s plateau) remain speculative.
  • Aggregated vs. Fine-Grained Signals: Summarizing an entire vocabulary distribution into a single scalar inevitably discards fine-grained semantic shifts.
  • Future Directions: The authors suggest applying Entropy-Lens to determine whether LLMs genuinely reason (by comparing profiles of reasoning tasks vs. pure information retrieval) and optimizing private inference (PI) applications.

Summary updated

BibTeX
@inproceedings{ali2026entropy,
  author = {Riccardo Ali and Francesco Caso and Christopher Irwin and Pietro Lio},
  title = {{Entropy-Lens: The Information Signature of Transformer Computations}},
  booktitle = {Sci4DL @ ICLR},
  year = {2026},
  url = {https://openreview.net/forum?id=hXW07n7v0d},
}

Loading related content...

Figure