Manuscript Offprint
arXiv:2610.06012Spectral Geometry of Attention: From Information Routing to Uncertainty
Abstract
In this work, we study transformer attention through the lens of spectral geometry and operator theory. We view each attention head as a functional map between Hilbert spaces of functions on the token sequence and derive a Token Difference Operator, whose spectral structure controls how token-space information is routed to the output. We show that standard Euclidean spectra are structurally biased by sinks, conflating mass concentration with genuine routing capacity. By recasting token space in the intrinsic probability geometry induced by attention, the token difference spectrum disentangles sink effects from routing capacity and provides a spectral description of the dimensionality of the head output. This yields a unified framework for analyzing attention maps, explaining sinks, routing collapse, and output dimensionality within a single operator-theoretic framework. In practice, by grounding attention heuristics in spectral geometry, we develop a novel attention-based uncertainty estimator that complements probability-based scores, with the largest gains on long-context inputs.
1 Introduction
Attention maps are increasingly viewed as windows into the internal computation of transformer architectures [37]. Prior works have shown that attention carries useful signals about how transformers process information, studying it as probability distributions [37], graph operators [27, 7], transition matrices [14], or through row-wise statistics [38, 43]. While these perspectives have revealed important insights, they primarily focus on pairwise token interactions, or leveraging models that do not describe the single pass effect of the attention, leaving comparatively unexplored the global structural properties of attention operators as a whole, especially in relation to the hidden representation dimensionality and the final output of the transformer.
In this work, we approach attention from this global operator perspective, framing each attention map A as a linear functional operator that transfers signals between geometric domains defined for the token sequence, and investigating its spectral properties. Inspired by functional maps [28] and shape difference operators [33, 20], we derive a functional operator that characterizes the single-step action induced by an attention head. Its spectrum reveals the multi-scale, global behavior of attention and is, as we demonstrate, strongly correlated with a range of phenomena from attention sinks to model uncertainty.
We introduce the Token Difference Operator (TDO), a framework that departs from standard Euclidean analysis by assigning distinct geometric structures to the input and output domains of the attention map A. We demonstrate that the conventional practice of adopting a uniform Euclidean metric is structurally flawed; specifically, it is biased by the inherent row-stochasticity of attention and the
*Work performed while at Ecole Polytechnique
Preprint.

Figure 1: Teaser: (Left block) Our work studies transformers’ attention as a functional map between Hilbert spaces equipped with an inner product. The properties of the operator change with the standard Euclidean measure (Blue) and with an intrinsic probability geometry measure (Red). (Center Block) Parametrizing row stochastic causal map interpolating ( ) between a copy map and a sink map, we show that the Euclidean spectrum of the matrix is biased towards the sink, while reweighting the input measure relaxes this bias. (Right Block) We leverage our insights to design an uncertainty quantifier, identifying uncertainty as a routing capability collapse in certain selected heads (red box in the uncertain model).
presence of attention sinks. In these biased settings, the mass assigned to initial tokens can saturate the operator spectrum, making it appear that there is significant information flow when no actual token-dependent routing is occurring. To rectify this, we induce an intrinsic probability geometry on the input domain, directly derived from the attention mechanism. With this intrinsic metric, the trivial constant mode corresponds to a transported mean, while the remaining centered modes describe the token-dependent component of the head output. This yields a mean–routing decomposition of AV that cleanly separates phenomena often conflated in the literature, including attention sinks [18, 4, 32], dimensional collapse [11, 35].
Importantly, these structural quantities are not purely conceptual constructions: the TDO can be computed from attention maps, and its spectrum provides a strong signal in a range of probing tasks. We show that intrinsic spectral diagnostics are less dominated by sink score than raw attention or Euclidean spectral analysis, while aligning more closely with the dimensionality of the head output. Building on this, we introduce Spectral Attention Uncertainty Quantification (SAUQ), an unsupervised single-pass uncertainty estimator. Unlike probability-based estimators [44, 22, 13], which can fail when task-relevant distinctions are compressed before reaching the logits [3, 29, 39], SAUQ looks upstream at routing capacity and improves over closely related attention-based methods, especially on long-form summarization tasks.
We formalize these insights through the following theoretical and practical contributions, also summarized in Figure 1:
• A global operator-theoretic view of attention. We model attention maps as linear functional operators on token-space signals, shifting focus from token-level summaries to the spectral structure of the TDO.
• A theoretical separation between sinks and dimensional collapse. We prove that Euclidean spectra can be biased by sink tokens, and derive an intrinsic probability geometry in which the information dynamic is decomposed into a mean mode and a token-dependent routing subspace, proving that the nontrivial spectrum controls the dimensionality of the head output.
• A link to uncertainty: We empirically show that the spectral signal of high routing heads can be leveraged to predict uncertainty of LLMs.
This contribution is more relevant in the presence of attention sinks and representation collapse. Attention sinks have been studied through embedding spectra [8], information propagation [4], and geometric analyses [32], and related phenomena have also been observed in vision transformers [10]. In parallel, hidden-state collapse and compression effects have been linked to oversquashing and attention sinks [3, 11], as well as to spiking behavior in feed-forward layers [35, 12]. We build on this line of work by showing that standard Euclidean spectral diagnostics can confuse sink concentration with routing capacity, and by introducing an intrinsic spectrum that separates these effects.
Uncertainty quantification in LLMs. Uncertainty estimation and hallucination detection for LLMs are often based on output probabilities, using quantities such as entropy, perplexity, likelihood, or sampling-based semantic consistency [44, 22, 13], and also spectral signals computed on the output logits [25, 40]. However, probability-based signals can be unreliable when task-relevant distinctions are compressed before reaching the logits [3, 29, 39]. This motivates uncertainty signals derived from internal model dynamics.
For this reason, recent methods leverage hidden representations of LLMs to quantify uncertainty [23, 9]. In particular, some works focus on attention heads, looking at attention values [34], previous-token relations [38], Laplacian eigenvalues of attention graphs [7], and topological divergence measures on attention graphs [5]. While closely related to these attention-based methods, our approach replaces scalar or graph-based summaries with the intrinsic spectrum of the TDO. Our solution grounds uncertainty estimation in the same geometry that controls routing capacity, yielding a single-pass estimator that captures spectral collapse in token-level information flow.
3 Theoretical Framework
We consider a decoder-only transformer with L layers and H attention heads per layer. The attention head h at layer l is computed as
and acts on the value matrix as , where is the causal mask, . For each layer , the full multi-head attention output is obtained by concatenating the heads and projecting the output . The complete transformer block notation is provided in the Supplementary material. Our study focuses on the matrix acting on the token space as a token-routing operator. We analyze one head at a time and omit the layer and head indices when no confusion arises. For a fixed input, each attention map , as an operator acting on , is row-stochastic, causal, and linear in the columns of its input . These properties correspond to:
3.1 Attention as a functional mapping and Token Difference Operator
Let denote the space of tokens described by their position. We define the weighted Hilbert space , as the space equipped with the inner product:
(3) where is a positive measure on , which can be encoded as a vector of length and . Given another positive measure on , we can interpret the attention matrix as a linear map
Assuming for all , the operator admits an adjoint defined by , which can be computed with the following formula:
Having established these two operators and inspired by spectral geometry [20], we define the Token Difference Operator (TDO) as
This operator is self-adjoint and positive semidefinite in , and is strictly related to the Rayleigh quotient , which measures how much the attention operator stretches an input signal by acting on it and transferring it between the two geometries. The properties of the TDO strongly depend on the measures , which we refer to as the geometry, and we will discuss this relation in the next sections.
We note that all spaces considered here are finite-dimensional: is equipped with a weighted inner product, and every result below can be written in matrix form. We adopt the operator language because it makes the construction discretization-agnostic, as for functional maps [28] and shape difference operators [33]; concurrent work [41] similarly treats attention as a map between function spaces.
3.1.1 Euclidean scenario: structural sink bias
Taking both and as counting measures (i.e. ) gives , the standard Euclidean Gram matrix from which the standard singular values are computed. In this geometry, row-stochastic attention is generally not a contraction.
Proposition 1 (Euclidean Non-contractivity). For row-stochastic, , with equality if and only if is doubly stochastic.
The constraint fixes the constant function as a unit-gain direction for , but in counting geometry the TDO acts on this mode as , . Thus, the Euclidean Gram operator converts the constant mode into the column-sum profile. Under causal masking , hence and ; early keys are also visible to more query positions than late keys. The leading Euclidean spectrum is therefore sensitive to accumulated sink mass. In the extreme causal sink , this becomes , so and all spectral energy lies in the sink coordinate. The bias is not only a rank error, but a quadratic amplification of column-mass concentration. The proof of Proposition 1 and a Frobenius budget refining this picture appear in Supplementary materials A.3.
3.1.2 Probability geometry scenario: intrinsic non-expansion
The non-contractivity above reflects a mismatch between row-stochasticity and an unweighted geometry: the counting measure ignores the nonuniform column mass induced by causal attention. We resolve this by taking the output measure to be probabilistic and pulling it back to obtain the input measure:
Both are probability measures; is the average attention row over keys. This choice also restores the correct stationary geometry of the TDO. Since , we have . Thus, the pulled-back column-mass profile is not amplified as an unweighted Euclidean direction; it becomes the invariant measure with respect to which constants and centered fluctuations are defined.
Proposition 2 (Intrinsic non-expansion). With the measures (7), satisfies for all , with operator norm 1 and attained by constant 1.
Sketch of proof. The bound follows from Jensen’s inequality averaged with uniform ; equality on 1 is trivial. Full proof in Supplementary materials A.4.
Corollary 0.1 (Centered contraction). Let and order . Then
The trivial unit-gain mode is the constant function. All non-trivial routing happens on its -orthogonal complement, where the contraction factor is governed by . We report the complete proof in the Supplementary materials A.5.
The unit singular mode is still present, but it now has a fixed interpretation: it is a constant function. This mode carries no token-dependent information, since it assigns the same value to every position and is preserved by any row-stochastic attention map. Therefore, the relevant question is not whether A preserves constants, but how much variation around the attention-weighted mean can survive one attention step.
3.2 From functions to representations
The preceding analysis concerns scalar functions . The value matrix can be viewed columnwise as such functions, hence, the intrinsic contraction result directly describes how an attention head routes hidden representations across token positions. We decompose into its -mean and its centered component:
Here, m is the attention-weighted mean value vector, while contains the token-dependent deviations around this mean.
Proposition 3 (Mean-routing decomposition). Under the intrinsic measures (7), the head output decomposes as
with and the routed component bounded by
where we define as the weighted Frobenius norm.
Sketch of proof. and gives the split; orthogonality is trivial, and the norm bound applies Corollary 0.1 columnwise. Full proof in Supplementary materials A.6.
The choice of intrinsic measures aligns the barycenters of the input and output representations. Since , we have
Thus, attention maps the -weighted input mean to the -weighted output mean. Thus, captures the position-independent transported mean, while captures token-dependent routing. The factor controls how much centered variation survives one attention step, and therefore governs the routed dimensionality, as shown in the following Corollary.
Corollary 0.2 (Spectral entropy bound). Let , , and . Define the spectral entropy with . Then, with the binary entropy,
The spectrum of thus controls the dimensionality of the routed component in two complementary senses: as a norm constraint and as the spectral entropy of entering the mixture bound on . Proof in Supplementary materials A.7.
Representative attention heads in LLaMA-3.1-8B

Figure 2: Representative attention heads and how different metrics classify their routing behavior. The intrinsic TDO score separates sink collapse from sink-biased routing, assigning high routing scores to copying, shifting, and sink-biased heads while distinguishing them from pure sink heads.
3.3 Spectral metrics
The TDO spectrum describes how centered token-dependent information survives an attention step. We summarize it using the normalized participation ratio
It ranges from 1/n for a single active mode to , for a uniform nonzero spectrum, and is invariant to global rescaling. In practice, we compute it from the symmetric matrix. , which is symmetric and similar to . Large indicates that centered variation is routed through several active directions; small values indicate compression of before the residual stream (Corollary 0.2). This statistic is used in the uncertainty estimator of Section 5.
We also consider the centered normalized participation ratio .
4 Sinks, Routing, and Output Dimensionality
We test two predictions of the theory: that the intrinsic TDO reduces sink bias, and that its centered spectrum tracks output dimensionality. We compare intrinsic spectral diagnostics (PR( ) and its centered restriction) against (i) raw attention statistics, sink score, previous-token score [38], attention entropy [43]; and (ii) counting-geometry spectral diagnostics, log-determinant score [34], Laplacian diagonal entropy [7], and PR( ). All metrics are evaluated against both sink score and the output spectral entropy [3] across the full head population.
Representative heads Figure 2 compares four heads with clear routing properties that metrics should distinguish: a copying head, a sink head, a sink-biased head, and a shifting head. In the sink-biased head, substantial sink mass coexists with nontrivial routing, so counting-geometry and graph-based diagnostics confuse column-mass concentration with routing collapse, scoring it comparably to the sink head. The shifting head exposes the complementary failure: previous-token score [38] is tailored to this specific pattern and correctly flags it, but for the same reason misses the copying head, which routes information through a different position. In contrast, assigns high routing scores to both copying, shifting heads, and sink bias, while separating them from sink collapse, matching the routed output dimensionality across all four cases. We note that the copying head itself has low output dimensionality, highlighting that the output also depends on properties of V.
Sink dependence and output dimensionality We first refine the relation between sink concentration and routing collapse. Under causal row-stochasticity, rank deficiency of A forces both phenomena jointly: a low-rank A must concentrate column mass on early tokens, in the rank-one limit, ,

Figure 3: Scatterplots showing the relationships between attention diagnostics, sink score, and output dimensionality. Top: relation between each diagnostic and sink score. Bottom: relation between each diagnostic and the spectral entropy of the head output . Points correspond to the attention heads of LLaMA-3.1-8B on 200 inputs, shown both per input and averaged across inputs (bold points). We report the Spearman correlation between the metrics.
Perturbation Analysis Across Metrics

Figure 4: Perturbation sensitivity in a controlled copy task inspired by [39, 29]. The model receives copy: and must reproduce the bit string; we contrast the all-zero input ( , easy) with a perturbation carrying a single one at position ( , hard). As grows, perplexity and mean token entropy become nearly indistinguishable across the two families, while RAUQ [38] and Ours, computed from hidden-layer routing geometry, remain sensitive to the perturbation.
and the TDO spectrum loses centered modes accordingly. The converse fails: a head with imbalanced column sums can still maintain a rich centered spectrum, so sink behavior does not imply representational collapse. Disentangling the two regimes, therefore, requires a diagnostic that does not amplify column mass as a Euclidean direction. The intrinsic TDO satisfies this: its leading mode is fixed at the constant function and routing is measured on the centered subspace . Figure 3 confirms this empirically across heads. Top: column-sum entropy, attention entropy, previous-token score, log-determinant score, and all show visible dependence on sink score, with a correlation score between 0.5 and 1, while diagnostics derived from are substantially less sink-dependent; Laplacian diagonal entropy [7] shows the weakest sink dependence, plausibly because its degree normalization plays a role analogous to the pullback measure . Bottom: , especially its centered variant, aligns more closely with than raw attention statistics or counting-geometry ranks, supporting Corollary 0.2. The baselines fail in complementary ways: raw entropies are dominated by sink structure, while log-determinant and Laplacian-based scores identify collapsed outputs but miss the full range of output entropies. The intrinsic TDO spectrum thus best captures the non-collapsed, token-dependent routing signal needed for the uncertainty estimator developed next.
5 Spectral Attention Uncertainty Quantification
Probability-based uncertainty estimators, such as perplexity, sequence likelihood, and token entropy, are computed at the unembedding output, after the residual stream has been mapped to logits. When task-relevant distinctions are compressed during representation propagation, two inputs that differ in important ways induce nearly indistinguishable logits, and any output-probability estimator inherits this collapse [3, 29, 39], especially in long-range or non-local tasks. Figure 4 makes this concrete: on a controlled copy task, perplexity and token entropy become indistinguishable across two input families that still differ in a task-relevant position, while attention-based signals derived from hidden-layer routing geometry remain sensitive. The framework of Section 3 defines what the signal measures: the TDO spectrum quantifies the effective dimensionality of the centered, token-dependent component routed by an attention head. We hypothesize that spectral collapse during generation signals a loss of routing capacity that is not yet visible in output probabilities, and we test this hypothesis empirically. To this end, we define Spectral Attention Uncertainty Quantification (SAUQ), a single-pass estimator that turns intrinsic attention spectra into a confidence score for selective prediction.
5.1 Method
Let be the prompt and the generated continuation. At the decoding step , the model attends over the prefix of length , with attention map for layer and head . We denote the generation-only submatrix of as , with the set of generated tokens.
Head selection. We focus on the middle third of transformer layers, , as in RAUQ [38] (layers 10-22 for LLaMA-3.1-8B). Within each such layer, we first select a routing head using a lightweight spectral proxy computed only on the generated-token attention block. Let be the generated-token square block at the final decoding step. We select
This proxy is a cheap empirical spectral screen: it scores all H heads of a layer with a single batched product on blocks, whereas the intrinsic signal below is computed only for the selected head.
Spectral signal. For each selected head and at each generation step, we equip the full prefix with the intrinsic measures of (7), and , and compute the normalized participation ratio of the TDO
The signal only requires and , so no eigendecomposition is needed.
Confidence recurrence. Then, we integrate our signal into the recurrence structure of RAUQ [38]. Let be the model probability assigned to the generated token at step . SAUQ defines a layer-wise confidence recursively by
where trades off local token probability against confidence propagated through the spectral routing structure; in the following experiments, we select following [38]. The recurrence, , and the layer range are taken unchanged from RAUQ: they are not dictated by our theory, and keeping them fixed isolates the effect of the routing signal.
Under this recurrence, high spectral participation preserves prior confidence, reflecting the presence of multiple active routing directions. By contrast, spectral collapse attenuates propagated confidence, since the head routes information through fewer effective degrees of freedom. For each selected layer, we convert the confidence trajectory into an uncertainty score by averaging log-confidence over the generated sequence, . The final sequence-level score is the maximum uncertainty over the middle-third layers, . We use the maximum because SAUQ is a rejection score: a routing collapse in any monitored head should raise uncertainty rather than be averaged away. Since our analysis is per head and precedes residual mixing and MLP updates, such a collapse need not imply information loss for the whole model. Thus, SAUQ preserves the recurrent structure of RAUQ, but replaces its scalar previous-token score with the effective spectral dimension of routing heads from Section 3.
Generation-only variant. The full mixes prompt and generated tokens. To isolate the uncertainty accumulated during the generation, we also consider a variant in which the signal is the same Euclidean proxy used for head selection, evaluated at each step on the generated block,
| Estimator | Category | QA | Summarization | ||||||
|---|---|---|---|---|---|---|---|---|---|
| TriviaQA | TruthfulQA | MMLU | COQA | Mean | SAMSUM | XSUM | Mean | ||
| AttentionScore [34] | Single pass | 0.0796 | -0.0505 | 0.2078 | 0.0933 | 0.0826 | -0.3727 | -0.9983 | -0.6855 |
| MaximumSequenceProbability | Single pass | 0.2518 | 0.3211 | 0.5501 | 0.2878 | 0.3527 | -0.1363 | -0.386 | -0.2612 |
| MeanTokenEntropy | Single pass | 0.5661 | 0.4199 | 0.2437 | 0.2568 | 0.3716 | 0.4999 | 0.3928 | 0.4464 |
| Perplexity | Single Pass | 0.1088 | 0.2863 | 0.5158 | 0.2737 | 0.2962 | 0.5071 | 0.4053 | 0.4562 |
| CCP[15] | Single pass | 0.1029 | 0.159 | 0.5567 | 0.2602 | 0.2697 | -0.1458 | -0.3018 | -0.2238 |
| NLI-DegMat [25] | Sample-based | 0.5789 | 0.2061 | 0.4381 | 0.3959 | 0.4048 | 0.3888 | 0.3236 | 0.3562 |
| NLI-Eccentricity [25] | Sample-based | 0.5641 | 0.2007 | 0.4469 | 0.3805 | 0.3981 | 0.344 | 0.0351 | 0.1896 |
| NLI-EigValLaplacian [25] | Sample-based | 0.6034 | 0.1962 | 0.4681 | 0.4147 | 0.4206 | 0.3864 | 0.3845 | 0.3855 |
| EigenScore [9] | Sample-based | 0.3611 | 0.0524 | 0.4118 | 0.3467 | 0.293 | 0.0719 | -0.2122 | -0.0702 |
| LUQ [44] | Sample-based | 0.5878 | 0.182 | 0.4392 | 0.3588 | 0.392 | 0.29 | 0.3585 | 0.3243 |
| LexicalSimilarity_rougeL [16] | Sample-based | 0.4788 | 0.1599 | 0.4127 | 0.3636 | 0.3538 | 0.2483 | 0.1981 | 0.2232 |
| SAR [13] | Sample-based | 0.5733 | 0.1786 | 0.4103 | 0.3275 | 0.3724 | 0.2936 | 0.3069 | 0.3003 |
| SemanticDensity[30] | Sample-based | 0.5592 | 0.0755 | 0.1582 | 0.1102 | 0.2258 | 0.0752 | 0.1138 | 0.0945 |
| SemanticEntropy[22] | Sample-based | 0.2005 | 0.2113 | 0.4701 | 0.3662 | 0.312 | 0.2525 | -0.1886 | 0.032 |
| RAUQ [38] | Single pass | 0.2631 | 0.3369 | 0.5596 | 0.311 | 0.3677 | 0.5269 | 0.3008 | 0.4139 |
| LapEigValRAUQ [7] | Single pass | 0.1190 | 0.3296 | 0.5578 | 0.3064 | 0.3282 | 0.5285 | 0.2907 | 0.4096 |
| LogDetRAUQ [34] | Single pass | 0.1140 | 0.3313 | 0.5596 | 0.3087 | 0.328 | 0.5288 | 0.3048 | 0.4168 |
| SAUQ (gen. only) | Single pass | 0.5013 | 0.3056 | 0.5375 | 0.311 | 0.4139 | 0.4948 | 0.2578 | 0.3763 |
| SAUQ (Ours) | Single pass | 0.2914 | 0.3767 | 0.5588 | 0.3055 | 0.3831 | 0.5924 | 0.4214 | 0.5069 |
Table 1: Comparison against unsupervised methods. The best result in each column is shown in bold, and the second best in blue.
, with selection, recurrence and aggregation unchanged. Since the prompt columns are removed and is not renormalized, is sub-stochastic: the intrinsic geometry of Section 3 does not apply. In B.6, we analyze the effect of having different selection-signal relations in SAUQ.
5.2 Evaluation
We evaluate SAUQ using Llama-3.1-8b[1] and Qwen2.5-7B [42] (Appendix B.3). We use the LM Polygraph benchmark [15] to ensure easy reproducibility, following the details provided in the experimental setting of [38]. We report the Normalized Prediction Rejection Ratio (PRR; higher is better). We evaluate our method on question-answering task on TriviaQA [21], TruthfulQA [24], MMLU [19], CoQA [31], and on the summarization task on SAMSum [17], and XSum [26]. Table 1 compares SAUQ performances against single-step probability-based methods (Perplexity, MaxSequenceProbability, MeanTokenEntropy, CCP), sample-based (10 samples) methods (NLI-based spectral measures, EigenScore, LUQ, LexicalSimilarity, SAR, Semantic Density, SemanticEntropy), and attention-based baselines (AttentionScore, RAUQ, LapEigvalRAUQ, LogDetRAUQ). The last two are variants of SAUQ in which the attention signal has been extracted based on LapEigval[7] and AttentionScore[34].
In Table 1, we report the mean PRR values for Llama-3.1-8b; We refer to the Appendix for additional results. The table shows a regime-dependent picture rather than uniform dominance. On QA datasets, SAUQ is competitive with strong unsupervised estimators, but it is not the best method on average; several sample-based baselines obtain stronger mean QA performance. In contrast, the gains are clearest on summarization, where SAUQ achieves the best performance on both SAMSum and XSum, and the strongest summarization mean among all methods considered. This is consistent with our motivation: when uncertainty depends on preserving distinctions across long contexts, the upstream routing spectrum carries information that probability-based estimators have already lost. We therefore view SAUQ as a complementary single-pass signal rather than a universal replacement.
Because SAUQ, RAUQ, LapEigvalRAUQ, and LogDetRAUQ share the same recurrence and protocol, their comparison primarily reflects the effect of replacing the scalar attention signal used. The comparison among them isolates the effect of the routing metric inside the estimator. The ranking mirrors the metric-quality findings of Section 4: LapEigval and LogDet spectral signals carry less of the routing signal than the intrinsic TDO, and this gap translates into stronger single-pass uncertainty.
Choice of measure The framework treats the input measures as an explicit modeling axis rather than a fixed convention. In the context of uncertainty, we tested alternative approaches to uniform and intrinsic measures, including masses based on token positions, frequency of tokens (Zipf's Law), and unembedding matrix decomposition. Definitions of all measures and an example of their distribution are given in Appendix B.8.
Only the intrinsic choice satisfies Proposition 2; for the others the constant function is not an eigenvector of . On short-range QA, several measures perform comparably, with positional weighting marginally best. On summarization, where uncertainty depends more strongly on long-range routing, the attention-induced measure outperforms the alternatives, while counting geometry lags. Interestingly, the performances of frequency- and unembedding-based estimators suggest that the 'semantic' of the tokens is less relevant in this scenario with respect to positional bias. Extending such analysis forward offers an intriguing future direction in which our approach can be exploited for a broader understanding of LLMs' computations.
| Measure | QA | Summ. |
|---|---|---|
| Uniform | 0.3660 | 0.4204 |
| Positional | 0.4027 | 0.4771 |
| Zipf-Law | 0.3718 | 0.4223 |
| Unembedding | 0.3755 | 0.4202 |
| Intrinsic | 0.3831 | 0.5069 |
Table 2: Mean PRR of SAUQ under different measures (LLaMA-3.1-8B).
6 Conclusion
We introduced a new spectral-geometric framework for attention. Euclidean spectral diagnostics can be biased by sink behavior, conflating column-mass concentration with genuine routing; the intrinsic probability geometry instead yields a token-difference spectrum that separates the trivial constant mode from the centered modes controlling routing capacity. Empirically, TDO operator better disentangle relations between sink score and head-output dimensionality, and supports uncertainty estimation. Building on it, SAUQ replaces scalar attention probes with a spectral measure of routing capacity and improves over closely related attention-based baselines on long-range tasks.
Limitations. Our analysis is per-head, per-input, and single-step, characterizing the routing map before residual mixing, MLP updates, and cross-head output projection; extending it to the full dynamics of representation evolution is a natural next step. Practically, computing the full spectrum is more expensive than scalar attention statistics or the participation-ratio statistic used in our variant, requiring additional care to apply at scale.
Broader Impact. More faithful diagnostics of attention routing may improve interpretability, uncertainty estimation, and reliability assessment in transformer models, especially for deployment of safe and reliable AI systems.
Acknowledgments and Disclosure of Funding
This work was supported by the ERC Consolidator Grant 101087347 (VEGA), the ANR AI Chair AIGRETTE, and by gifts from Ansys and Adobe Research. The MUR supported this work with the grant "Dipartimenti di Eccellenza 2023-2027" REGAINS of the Department of Informatics, Systems and Communication of the University of Milano-Bicocca.
References
[1] AI@Meta. Llama 3 model card. 2024.
[2] Han Bao, Ryuichiro Hataya, and Ryo Karakida. Self-attention networks localize when qk-eigenspectrum concentrates, 2024.
[3] Federico Barbero, Andrea Banino, Steven Kapturowski, Dharshan Kumaran, João G.M. Araújo, Alex Vitvitskyi, Razvan Pascanu, and Petar Veličković. Transformers need glasses! information over-squashing in language tasks. In Proceedings of the 38th International Conference on Neural Information Processing Systems, NIPS '24, Red Hook, NY, USA, 2024. Curran Associates Inc.
[4] Federico Barbero, Álvaro Arroyo, Xiangming Gu, Christos Perivolaropoulos, Michael Bronstein, Petar Veličković, and Razvan Pascanu. Why do llms attend to the first token?, 2025.
[5] Alexandra Bazarova, Aleksandr Yugay, Andrey Shulga, Alina Ermilova, Andrei Volodichev, Konstantin Polev, Julia Belikova, Rauf Parchiev, Dmitry Simakov, Maxim Savchenko, Andrey Savchenko, Serguei Barannikov, and Alexey Zaytsev. Hallucination detection in llms with topological divergence on attention graphs, 2025.
[6] Stella Biderman, Hailey Schoelkopf, Quentin Anthony, Herbie Bradley, Kyle O'Brien, Eric Hallahan, Mohammad Aflah Khan, Shivanshu Purohit, USVSN Sai Prashanth, Edward Raff, Aviya Skowron, Lintang Sutawika, and Oskar van der Wal. Pythia: A suite for analyzing large language models across training and scaling, 2023.
[7] Jakub Binkowski, Denis Janiak, Albert Sawczyn, Bogdan Gabrys, and Tomasz Jan Kajdanowicz. Hallucination detection in LLMs using spectral features of attention maps. In Christos Christodoulopoulos, Tannoy Chakraborty, Carolyn Rose, and Violet Peng, editors, Proceedings of the 2025 Conference on Empirical Methods in Natural Language Processing, pages 24354–24385, Suzhou, China, November 2025. Association for Computational Linguistics.
[8] Nicola Cancedda. Spectral filters, dark signals, and attention sinks. In Lun-Wei Ku, Andre Martins, and Vivek Srikumar, editors, Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 4792–4808, Bangkok, Thailand, August 2024. Association for Computational Linguistics.
[9] Chao Chen, Kai Liu, Ze Chen, Yi Gu, Yue Wu, Mingyuan Tao, Zhihang Fu, and Jieping Ye. Inside: Llms' internal states retain the power of hallucination detection, 2024.
[10] Timothée Darcet, Maxime Oquab, Julien Mairal, and Piotr Bojanowski. Vision transformers need registers, 2024.
[11] Enrique Queipo de Llano, Álvaro Arroyo, Federico Barbero, Xiaowen Dong, Michael Bronstein, Yann LeCun, and Ravid Shwartz-Ziv. Attention sinks and compression valleys in llms are two sides of the same coin, 2026.
[12] Yihe Dong, Jean-Baptiste Cordonnier, and Andreas Loukas. Attention is not all you need: Pure attention loses rank doubly exponentially with depth, 2023.
[13] Jinhao Duan, Hao Cheng, Shiqi Wang, Alex Zavalny, Chenan Wang, Renjing Xu, Bhavya Kailkhura, and Kaidi Xu. Shifting attention to relevance: Towards the predictive uncertainty quantification of free-form large language models, 2024.
[14] Yotam Erel, Olaf Dünkel, Rishabh Dabral, Vladislav Golyanik, Christian Theobalt, and Amit H. Bermano. Attention (as discrete-time markov) chains, 2025.
[15] Ekaterina Fadeeva, Roman Vashurin, Akim Tsvigun, Artem Vazhentsev, Sergey Petrakov, Kirill Fedyanin, Daniil Vasilev, Elizaveta Goncharova, Alexander Panchenko, Maxim Panov, Timothy Baldwin, and Artem Shelmanov. LM-polygraph: Uncertainty estimation for language models. In Yansong Feng and Els Lefever, editors, Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing: System Demonstrations, pages 446–461, Singapore, December 2023. Association for Computational Linguistics.
[16] Marina Fomicheva, Shuo Sun, Lisa Yankovskaya, Frédéric Blain, Francisco Guzmán, Mark Fishel, Nikolaos Aletras, Vishrav Chaudhary, and Lucia Specia. Unsupervised quality estimation for neural machine translation. Transactions of the Association for Computational Linguistics, 8:539–555, 2020.
[17] Bogdan Gliwa, Iwona Mochol, Maciej Biesek, and Aleksander Wawer. Samsum corpus: A human-annotated dialogue dataset for abstractive summarization. In Proceedings of the 2nd Workshop on New Frontiers in Summarization, page 70–79. Association for Computational Linguistics, 2019.
[18] Xiangming Gu, Tianyu Pang, Chao Du, Qian Liu, Fengzhuo Zhang, Cunxiao Du, Ye Wang, and Min Lin. When attention sink emerges in language models: An empirical view, 2025.
[19] Dan Hendrycks, Collin Burns, Steven Basart, Andy Zou, Mantas Mazeika, Dawn Song, and Jacob Steinhardt. Measuring massive multitask language understanding, 2021.
[20] R. Huang, F. Chazal, and M. Ovsjanikov. On the stability of functional maps and shape difference operators. Computer Graphics Forum, 37(1):145–158, 2018.
[21] Mandar Joshi, Eunsol Choi, Daniel S. Weld, and Luke Zettlemoyer. Triviaqa: A large scale distantly supervised challenge dataset for reading comprehension, 2017.
[22] Lorenz Kuhn, Yarin Gal, and Sebastian Farquhar. Semantic uncertainty: Linguistic invariances for uncertainty estimation in natural language generation, 2023.
[23] Dharshan Kumaran, Arthur Conmy, Federico Barbero, Simon Osindero, Viorica Patraucean, and Petar Velickovic. How do llms compute verbal confidence, 2026.
[24] Stephanie Lin, Jacob Hilton, and Owain Evans. Truthfulqa: Measuring how models mimic human falsehoods, 2022.
[25] Zhen Lin, Shubhendu Trivedi, and Jimeng Sun. Generating with confidence: Uncertainty quantification for black-box large language models, 2024.
[26] Shashi Narayan, Shay B. Cohen, and Mirella Lapata. Don’t give me the details, just the summary! topic-aware convolutional neural networks for extreme summarization, 2018.
[27] Valentin Noël. A graph signal processing framework for hallucination detection in large language models, 2025.
[28] Maks Ovsjanikov, Mirela Ben-Chen, Justin Solomon, Adrian Butscher, and Leonidas Guibas. Functional maps: a flexible representation of maps between shapes. ACM Trans. Graph., 31(4), July 2012.
[29] Hector Pasten, Felipe Urrutia, Hector Jimenez, Cristian B. Calderon, Cristóbal Rojas, and Alexander Kozachinskiy. Continuity and isolation lead to doubts or dilemmas in large language models, 2025.
[30] Xin Qiu and Risto Miikkulainen. Semantic density: Uncertainty quantification for large language models through confidence measurement in semantic space, 2024.
[31] Siva Reddy, Danqi Chen, and Christopher D. Manning. Coqa: A conversational question answering challenge, 2019.
[32] Valeria Ruscio, Umberto Nanni, and Fabrizio Silvestri. What are you sinking? a geometric approach on attention sink, 2025.
[33] Raif M. Rustamov, Maks Ovsjanikov, Omri Azencot, Mirela Ben-Chen, Frédéric Chazal, and Leonidas Guibas. Map-based exploration of intrinsic shape differences and variability. ACM Trans. Graph., 32(4), July 2013.
[34] Gaurang Sriramanan, Siddhant Bharti, Vinu Sankar Sadasivan, Shoumik Saha, Priyatham Kattakinda, and Soheil Feizi. Llm-check: Investigating detection of hallucinations in large language models. In A. Globerson, L. Mackey, D. Belgrave, A. Fan, U. Paquet, J. Tomczak, and C. Zhang, editors, Advances in Neural Information Processing Systems, volume 37, pages 34188–34216. Curran Associates, Inc., 2024.
[35] Shangwen Sun, Alfredo Canziani, Yann LeCun, and Jiachen Zhu. The spike, the sparse and the sink: Anatomy of massive activations and attention sinks, 2026.
[36] Huiyuan Tian, Bonan Xu, Shijian Li, and Gang Pan. Spectralkd: A unified framework for interpreting and distilling vision transformers via spectral analysis, 2025.
[37] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. In I. Guyon, U. Von Luxburg, S. Bengio, H. Wallach, R. Fergus, S. Vishwanathan, and R. Garnett, editors, Advances in Neural Information Processing Systems, volume 30. Curran Associates, Inc., 2017.
[38] Artem Vazhentsev, Lyudmila Rvanova, Gleb Kuzmin, Ekaterina Fadeeva, Ivan Lazichny, Alexander Panchenko, Maxim Panov, Timothy Baldwin, Mrinmaya Sachan, Preslav Nakov, and Artem Shelmanov. Uncertainty-aware attention heads: Efficient unsupervised uncertainty quantification for llms, 2025.
[39] Petar Veličković, Federico Barbero, Christos Perivolaropoulos, Simon Osindero, and Razvan Pascanu. Perplexity cannot always tell right from wrong, 2026.
[40] Pragatheeswaran Vipulanandan, Kamal Premaratne, and Dilip Sarkar. Semantic uncertainty quantification of hallucinations in llms: A quantum tensor network based method, 2026.
[41] Jiefang Xiao, Maolin Gao, Simon Weber, Guandao Yang, and Daniel Cremers. Functional attention: From pairwise affinities to functional correspondences, 2026.
[42] An Yang, Baosong Yang, Binyuan Hui, Bo Zheng, Bowen Yu, Chang Zhou, Chengpeng Li, Chengyuan Li, Dayiheng Liu, Fei Huang, Guanting Dong, Haoran Wei, Huan Lin, Jialong Tang, Jialin Wang, Jian Yang, Jianhong Tu, Jianwei Zhang, Jianxin Ma, Jianxin Yang, Jin Xu, Jingren Zhou, Jinze Bai, Jinzheng He, Junyang Lin, Kai Dang, Keming Lu, Keqin Chen, Kexin Yang, Mei Li, Mingfeng Xue, Na Ni, Pei Zhang, Peng Wang, Ru Peng, Rui Men, Ruize Gao, Runji Lin, Shijie Wang, Shuai Bai, Sinan Tan, Tianhang Zhu, Tianhao Li, Tianyu Liu, Wenbin Ge, Xiaodong Deng, Xiaohuan Zhou, Xingzhang Ren, Xinyu Zhang, Xipin Wei, Xuancheng Ren, Xuejing Liu, Yang Fan, Yang Yao, Yichang Zhang, Yu Wan, Yunfei Chu, Yuqiong Liu, Zeyu Cui, Zhenru Zhang, Zhifang Guo, and Zhihao Fan. Qwen2 technical report, 2024.
[43] Shuangfei Zhai, Tatiana Likhomanenko, Etai Littwin, Dan Busbridge, Jason Ramapuram, Yizhe Zhang, Jiatao Gu, and Josh Susskind. Stabilizing transformer training by preventing attention entropy collapse, 2023.
[44] Caiqi Zhang, Fangyu Liu, Marco Basaldella, and Nigel Collier. Luq: Long-text uncertainty quantification for llms, 2024.
Supplementary Material/appendix for "Spectral Geometry of Attention: From Information Routing to Uncertainty".
A Proofs for the Theoretical Section
A.1 Full Notation
We consider a decoder-only transformer with layers and attention heads per layer, processing a sequence of tokens. At layer , the input is , whose -th row is the hidden representation of token . We adopt the pre-norm convention as in [3]:
For each head , queries, keys, and values are , , . The attention matrix is
where is the causal mask, with for and otherwise. The full multi-head attention output is obtained by concatenating the head and projecting outputs .
In this section we provide the technical details for the results stated in Section 3.
A.2 TDO is self-adjoint
We recall , . Its adjoint is defined as the operator such that . We compute it explicitly
Hence, . The token-difference operator . is self-adjoint in . Indeed, for any ,
It is also positive semidefinite:
The associated Rayleigh quotient is
Thus the eigenvalues of describe the squared gains of attention under the input geometry and the output geometry .
Although is not generally symmetric in the Euclidean inner product, it is similar to the symmetric positive semidefinite matrix
Indeed,
Therefore and have the same eigenvalues. In practice, we can compute spectral quantities using .
A.3 Euclidean case: proof of Proposition 1
When both and are counting measures, and . Thus, the eigenvalues of are the squared singular values of A.
Proof of Proposition 1. Because is row-stochastic, . Therefore . By the definition of the spectral norm,
Now suppose that . Then , and the vector 1 attains the operator norm. Equivalently, the Rayleigh quotient of at 1 equals its largest eigenvalue:
Since is symmetric positive semidefinite, equality in the Rayleigh principle implies that 1 is an eigenvector of with eigenvalue 1: . Using , this becomes . Hence every column of A also sums to one, so A is doubly stochastic.
Conversely, suppose that A is doubly stochastic. Since A is nonnegative and has row sums and column sums equal to one,
The standard norm interpolation bound gives
Together with the lower bound , this gives .
Frobenius budget. The total squared singular mass is
Since each row of A is a probability vector, , and therefore . Hence
Consequently,
Thus, when the leading singular value is large, a large fraction of the available Frobenius budget is concentrated in the leading mode.
There is also a lower bound. For any probability vector supported on coordinates, , by Cauchy's inequality. Without causal constraints, every row may use all positions, so , with equality at the fully uniform matrix. Under causal masking, row is supported on at most positions. Therefore , and hence .
A.4 Intrinsic probability geometry: proof of Proposition 2
We now use the intrinsic measures
Proof of Proposition 2. For each query position , the row : is a probability vector. Therefore, by Jensen's inequality applied to the convex function ,
Averaging this inequality over with the uniform measure gives
Hence . Since is row-stochastic . Because both and are probability measures their respective norm is 1. Therefore . So the operator norm is exactly one.
Finally, the eigenvalues of are squared singular gains of . The previous inequality shows that all eigenvalues are at most one, and the constant function attains gain one. Hence , .
The last identity can also be checked directly:
Moreover,
Thus 1 is a right eigenvector and is the corresponding invariant left measure.
A.5 Proof of Corollary 0.1
Define the -centered subspace
The identity implies that attention maps centered functions to centered functions. Indeed, if , then
Thus Af is -centered.
Next, since is self-adjoint in and , the orthogonal complement is invariant under . To see this directly, take any . Then
Hence .
For , the squared gain of attention is
By the Rayleigh-Ritz variational principle applied to the restriction of to ,
With the eigenvalues ordered as
and with one copy of the eigenvalue corresponding to the constant function, this restricted maximum is . Therefore
If the unit eigenvalue has multiplicity larger than one, then there exist nonconstant centered modes with unit gain, and the same formula gives .
A.6 Proof of Proposition 3
For matrix-valued token signals , define
The analogous -weighted quantities are defined by replacing with .
Given a value matrix , define its -mean and centered component by
Then
because is a probability measure. Thus every feature column of lies in .
Using and , we obtain
This proves the additive decomposition.
We now prove the orthogonality of the two terms in . Since and ,
Finally, write , where each . Applying Corollary 0.1 to each feature column gives
Summing over feature coordinates,
Taking square roots gives
A.7 Proof of Corollary 0.2
Let
By Proposition 3,
Multiplying by gives
Define
Since is a probability measure,
Moreover, the cross term vanishes as a matrix:
Therefore
and
Assume first that both and . Define the normalized spectral densities
Let
Then
The matrix has rank one, so its entropy is zero:
Using concavity of entropy,
Since and , this gives
For the upper bound, we use the standard entropy bound for a two-component mixture:
where
Since , this yields
The cases or follow by continuity, with the convention when . Finally,
The routed contraction bound from Proposition 3 therefore gives
A.8 Centered participation ratio
To isolate the nontrivial routed directions, we may also define the centered participation ratio
whenever . If all centered eigenvalues vanish, we set .
B Additional Results
B.1 Correlation on other models
We report the version of Figure 3 but using three different models, GPT-2, Pythia-410m [6] and Qwen2-7b [42]. The correlation plots are provided in Figure 5. We note that the relation between the metrics seems independent of the model, being based on structural properties common to all attention maps.
GPT-2

Pythia-410m

Qwen2-7b
Figure 5: Scatterplot between attention diagnostics, sink score, and output dimensionality on GPT-2, Pythia-410m and Qwen2-7b
Table 3: Supervised hallucination-detection performance (ROC-AUC). We compare attention-matrix baselines, Laplacian eigenvalues, and features derived from the weighted token-difference operator. We follow the experimental protocol of [7] using Llama-3.1-8b [1], DeepSeek-4 as a judge.
| Dataset | AttnEigvals | AttnLogDet | LapEigvals | TokenDiffEigvals |
|---|---|---|---|---|
| COQA | 0.7995 | 0.7779 | 0.8519 | 0.8241 |
| GSM8K | 0.8598 | 0.8586 | 0.8660 | 0.8663 |
| TriviaQA | 0.8385 | 0.8346 | 0.8923 | 0.8731 |
| TruthfulQA | 0.7997 | 0.8362 | 0.8095 | 0.8445 |
B.2 Supervised hallucination detection with spectral probes
Beyond unsupervised SAUQ, we probe the token-difference spectrum in the supervised hallucination-detection protocol of LapEigval [7], which trains a classifier on eigenvalue features of the attention-induced graph Laplacian. We replace those features with the leading eigenvalues of for each selected head. Truncation is necessary because, unlike the Laplacian, whose diagonal already supplies cheap summaries, is dense and weighted, so its full spectrum is comparatively expensive to estimate.
| Estimator | Category | QA | Summarization | ||||||
|---|---|---|---|---|---|---|---|---|---|
| TriviaQA | TruthfulQA | MMLU | CoQA | Mean | SAMSum | XSum | Mean | ||
| AttentionScore [34] | Single pass | 0.0429 | 0.0466 | 0.1114 | 0.0022 | 0.0508 | 0.2924 | -0.0540 | 0.1192 |
| AttentionScore (gen. only) [34] | Single pass | 0.1529 | -0.1053 | 0.6741 | 0.0892 | 0.2027 | -0.0726 | -0.5038 | -0.2882 |
| MaximumSequenceProbability | Single pass | 0.2328 | 0.0436 | 0.6644 | 0.3016 | 0.3106 | 0.1220 | -0.0610 | 0.0305 |
| MeanTokenEntropy | Single pass | 0.6173 | 0.2474 | 0.2491 | 0.2533 | 0.3418 | 0.4265 | 0.3363 | 0.3814 |
| Perplexity | Single pass | -0.0126 | 0.2093 | 0.4042 | 0.2620 | 0.2157 | 0.4303 | 0.3309 | 0.3806 |
| CCP [15] | Single pass | 0.0636 | -0.0244 | 0.4957 | 0.2334 | 0.1921 | 0.0975 | 0.1419 | 0.1197 |
| NLI-DegMat [25] | Sample-based | 0.6393 | 0.3117 | 0.3758 | 0.4073 | 0.4335 | 0.2956 | 0.3367 | 0.3162 |
| NLI-Eccentricity [25] | Sample-based | 0.6149 | 0.2472 | 0.3318 | 0.3476 | 0.3854 | 0.2883 | 0.2600 | 0.2742 |
| NLI-EigValLaplacian [25] | Sample-based | 0.6201 | 0.3147 | 0.3213 | 0.3855 | 0.4104 | 0.2934 | 0.3535 | 0.3235 |
| EigenScore [9] | Sample-based | 0.4990 | -0.0506 | 0.3184 | 0.3282 | 0.2738 | 0.1783 | 0.0123 | 0.0953 |
| LUQ [44] | Sample-based | 0.6334 | 0.3777 | 0.3576 | 0.3900 | 0.4397 | 0.2697 | 0.4477 | 0.3587 |
| LexicalSimilarity_rougeL [16] | Sample-based | 0.6001 | 0.1317 | 0.3628 | 0.3697 | 0.3661 | 0.3237 | 0.2437 | 0.2837 |
| SAR [13] | Sample-based | 0.6116 | 0.2120 | 0.4401 | 0.3446 | 0.4021 | 0.2869 | 0.3027 | 0.2948 |
| SemanticDensity [30] | Sample-based | 0.4903 | 0.1312 | 0.1323 | 0.0731 | 0.2067 | 0.1083 | 0.1898 | 0.1491 |
| SemanticEntropy [22] | Sample-based | 0.3098 | 0.1179 | 0.3018 | 0.3066 | 0.2590 | 0.2640 | 0.0225 | 0.1433 |
| RAUQ [38] | Single pass | 0.5226 | 0.1970 | 0.5939 | 0.2639 | 0.3944 | 0.3898 | 0.2750 | 0.3324 |
| SAUQ (gen. only) | Single pass | 0.5906 | 0.1290 | 0.5182 | 0.2953 | 0.3833 | 0.3824 | 0.3484 | 0.3654 |
| SAUQ (Ours) | Single pass | 0.3780 | 0.1804 | 0.7204 | 0.2107 | 0.3724 | 0.3988 | 0.3165 | 0.3577 |
Table 4: Normalized PRR (higher is better) of unsupervised uncertainty estimators on Qwen2.5-7B. Sample-based methods use 10 samples. The best result in each column is shown in bold, and the second best in blue.
Table 3 shows that TDO eigenvalues are competitive with Laplacian features. In the low- regime, the leading eigenvalues of often match or exceed the Laplacian features, suggesting that the dominant routing modes carry hallucination-relevant information. We do not claim uniform dominance: with richer or cheaper Laplacian features, the baseline can match or surpass the probe. Together with the unsupervised SAUQ results, this suggests that the spectrum carries uncertainty information not reducible to scalar attention statistics.
B.3 Uncertainty quantification on Qwen2.5-7B
Table 4 replicates the evaluation of Section 5 on Qwen2.5-7B [42], using the same protocol, the same and the middle third of layers.
The results confirm the regime dependence of Section 5, but they also show that the gains are model dependent. SAUQ improves over RAUQ on summarization (0.3577 vs. 0.3324) and obtains the best MMLU score (0.7204), but it is below RAUQ on the QA mean (0.3724 vs. 0.3944). Unlike on LLaMA-3.1-8B, probability-based estimators (MeanTokenEntropy, Perplexity) are the strongest on summarization, and the generated-only variant outperforms the full-context one (0.3654 vs. 0.3577). We interpret the smaller advantage of the full-context signal as consistent with weaker sink behavior in this model, since the intrinsic measure primarily corrects sink-induced bias; we list the dependence on architecture as a limitation in Section 6.
B.4 Confidence intervals
We quantify the variability of PRR with a nonparametric bootstrap over evaluation instances: for each dataset, we resample instances with replacement 5000 times, recompute PRR for every estimator on the same resample, and report the standard errors. Differences between estimators are computed on paired resamples. Generation is greedy, so there is no decoding randomness in single-pass estimators; sample-based baselines use the 10 samples provided by LM-Polygraph. Table 5 reports the intervals for the attention-based estimators and the strongest baselines.
B.5 Calibration
PRR measures the quality of the ranking induced by an uncertainty score, not its calibration; for this reason, we do not expect it to be calibrated. For completeness, Table 6 reports the expected calibration error of single-pass estimators.
| Estimator | Category | QA | Summarization | ||||
|---|---|---|---|---|---|---|---|
| TriviaQA | TruthfulQA | MMLU | CoQA | SAMSum | XSum | ||
| MaximumSequenceProbability | Single pass | 0.25 ± .02 | 0.32 ± .06 | 0.55 ± .02 | 0.29 ± .02 | -0.14 ± .07 | -0.39 ± .11 |
| MeanTokenEntropy | Single pass | 0.57 ± .02 | 0.42 ± .05 | 0.24 ± .03 | 0.26 ± .02 | 0.50 ± .05 | 0.39 ± .08 |
| Perplexity | Single pass | 0.11 ± .02 | 0.29 ± .05 | 0.52 ± .02 | 0.27 ± .02 | 0.51 ± .04 | 0.41 ± .08 |
| CCP [15] | Single pass | 0.10 ± .02 | 0.16 ± .06 | 0.56 ± .02 | 0.26 ± .02 | -0.15 ± .07 | -0.30 ± .11 |
| NLI-DegMat [25] | Sample-based | 0.58 ± .02 | 0.21 ± .06 | 0.44 ± .02 | 0.40 ± .02 | 0.39 ± .05 | 0.32 ± .09 |
| NLI-Eccentricity [25] | Sample-based | 0.56 ± .02 | 0.20 ± .06 | 0.45 ± .02 | 0.38 ± .02 | 0.34 ± .05 | 0.04 ± .10 |
| NLI-EigValLaplacian [25] | Sample-based | 0.60 ± .02 | 0.20 ± .06 | 0.47 ± .02 | 0.41 ± .02 | 0.39 ± .05 | 0.38 ± .09 |
| EigenScore [9] | Sample-based | 0.36 ± .02 | 0.05 ± .06 | 0.41 ± .03 | 0.35 ± .02 | 0.07 ± .06 | -0.21 ± .10 |
| LUQ [44] | Sample-based | 0.59 ± .02 | 0.18 ± .06 | 0.44 ± .02 | 0.36 ± .02 | 0.29 ± .05 | 0.36 ± .08 |
| LexicalSimilarity (ROUGE-L) [16] | Sample-based | 0.48 ± .02 | 0.16 ± .06 | 0.41 ± .03 | 0.36 ± .02 | 0.25 ± .06 | 0.20 ± .09 |
| SAR [13] | Sample-based | 0.57 ± .02 | 0.18 ± .06 | 0.41 ± .03 | 0.33 ± .02 | 0.29 ± .06 | 0.31 ± .09 |
| SemanticDensity [30] | Sample-based | 0.56 ± .02 | 0.08 ± .06 | 0.16 ± .03 | 0.11 ± .02 | 0.08 ± .06 | 0.11 ± .10 |
| SemanticEntropy [22] | Sample-based | 0.20 ± .03 | 0.21 ± .06 | 0.47 ± .02 | 0.37 ± .02 | 0.25 ± .06 | -0.19 ± .11 |
| AttentionScore [34] | Single pass | 0.08 ± .02 | -0.05 ± .06 | 0.21 ± .03 | 0.09 ± .02 | -0.37 ± .07 | -1.00 ± .11 |
| RAUQ [38] | Single pass | 0.26 ± .02 | 0.34 ± .05 | 0.56 ± .02 | 0.31 ± .02 | 0.52 ± .05 | 0.30 ± .08 |
| LapEigvalRAUQ [7] | Single pass | 0.12 ± .02 | 0.33 ± .06 | 0.56 ± .02 | 0.31 ± .02 | 0.53 ± .04 | 0.29 ± .08 |
| LogDetRAUQ [34] | Single pass | 0.11 ± .02 | 0.33 ± .05 | 0.56 ± .02 | 0.31 ± .02 | 0.53 ± .04 | 0.30 ± .08 |
| SAUQ (gen. only) | Single pass | 0.50 ± .02 | 0.30 ± .05 | 0.54 ± .02 | 0.31 ± .02 | 0.41 ± .05 | 0.25 ± .09 |
| SAUQ (Ours) | Single pass | 0.29 ± .02 | 0.38 ± .05 | 0.56 ± .02 | 0.31 ± .02 | 0.59 ± .04 | 0.42 ± .07 |
Table 5: Normalized PRR (higher is better) of unsupervised uncertainty estimators on LLaMA-3.1-8B, mean ± standard error (stratified bootstrap over evaluation instances, 5000 resamples; one greedy decode per instance, 10 samples for sample-based methods). Bold: not significantly worse than the best result in the column.
| Estimator | QA (mean ECE) | Summ. (mean ECE) |
|---|---|---|
| Perplexity | 0.237 | 0.558 |
| AttentionScore | 0.266 | 0.551 |
| MaxSeqProbability | 0.265 | 0.685 |
| MeanTokenEntropy | 0.162 | 0.505 |
| RAUQ | 0.187 | 0.522 |
| SAUQ (Ours) | 0.194 | 0.490 |
Table 6: Expected calibration error (lower is better) of single-pass estimators on LLaMA-3.1-8B, averaged over the QA and summarization datasets.
B.6 Head selection and routing signal
SAUQ enters the estimator at two places: the rule that selects one head per layer, and the signal computed on that head inside the recurrence. To separate the two, we vary them independently on TruthfulQA and SAMSum (Table 7). Rows are selection rules, columns are signals; (Gen) denotes the generated-token block, (Full) the full prefix, and (Eucl) and (Intrinsic) the counting and intrinsic geometries. Our configuration is generated-Euclidean selection with the full-intrinsic signal.
| TruthfulQA | ||||
|---|---|---|---|---|
| Selection ↓ / Signal → | gen-Eucl | full-Eucl | full-intr. | full-intr.-cent. |
| gen-Euclidean | 0.3056 | 0.3494 | 0.3767 | 0.3876 |
| full-Euclidean | 0.3203 | 0.3507 | 0.3761 | 0.3759 |
| full-intrinsic | 0.3078 | 0.3508 | 0.3482 | 0.3429 |
| full-intr.-cent. | 0.3093 | 0.3508 | 0.3482 | 0.3429 |
| SAMSum | ||||
| gen-Euclidean | 0.4948 | 0.5384 | 0.5924 | 0.6028 |
| full-Euclidean | 0.4398 | 0.5375 | 0.5358 | 0.5371 |
| full-intrinsic | 0.4916 | 0.5371 | 0.5144 | 0.5339 |
| full-intr.-cent. | 0.5021 | 0.5373 | 0.5054 | 0.5335 |
Table 7: PRR for every combination of head-selection rule (rows) and routing signal (columns). Underlined: the configuration reported in the submitted version; bold: best per dataset.
Three observations follow. First, the intrinsic geometry helps on the signal axis: with the selection rule fixed, replacing the full-Euclidean signal with the full-intrinsic one improves PRR. Second, the centered PR is marginally better than the full PR on both datasets, consistent with Section 4. Third, the intrinsic geometry does not help on the selection axis.
Cost of intrinsic selection. Selection screens all heads in every monitored layer, whereas the signal is computed only for the selected head. Intrinsic selection would require the TDO of the full matrix for every head, i.e. times the cost of the signal, while the Euclidean proxy only uses the generated block.
B.7 Length-controlled analysis
Summarization and QA differ in task, input length, and output length, so the summarization gains of Section 5 could reflect any of these. We stratify the difference by input and output length on LLaMA-3.1-8B, using a stratified bootstrap with 5,000 resamples. Table 8 reports the pooled difference and the difference after controlling for output length, and for input and output length jointly.
| Dataset | Task | Δ pooled | 95% CI | ctrl. output | ctrl. input×output |
|---|---|---|---|---|---|
| XSum | Summ. | +0.121 | [+0.037, +0.212] | +0.078 | +0.060 |
| SAMSum | Summ. | +0.066 | [+0.010, +0.121] | +0.013 | +0.020 |
| TruthfulQA | QA | +0.040 | [-0.004, +0.084] | +0.023 | +0.014 |
| TriviaQA | QA | +0.028 | [-0.001, +0.058] | +0.047 | +0.056 |
| CoQA | QA | -0.006 | [-0.015, +0.004] | -0.013 | -0.012 |
| MMLU | QA | -0.001 | [-0.005, +0.004] | -0.016 | -0.022 |
Table 8: Difference in PRR between SAUQ and RAUQ on LLaMA-3.1-8B, pooled and after stratifying by output length and by input × output length.
Roughly half of the summarization gain is explained by generation length: the summarization mean of drops from 0.093 to 0.046 under the output-length control, while the input-length control leaves it unchanged (0.093). The residual is carried by XSum, where it survives both controls and grows with context: across input-length quartiles it is , , and . On SAMSum, whose inputs span a narrower range of lengths, the advantage does not survive the output-length control (). We therefore attribute to long-range routing only the residual XSum effect.
B.8 Choice of measure
All measures below are normalized to sum to one over the tokens of the prefix. In all cases . In Figure 6, we show an example on how the mass are distributed.
-
Uniform: .
-
Positional: with . Early positions, including the sink, receive large mass; since keys enter through , their columns are down-weighted.
-
Zipf-Law (in-context frequency): , the number of occurrences of token in the sequence. Tokens that occur once receive the same mass, so on short inputs this measure is close to uniform.
-
Unembedding: with , where , is the mean row of , the top right singular vector of the centered , and is chosen so that is negatively correlated with the token id.
-
Intrinsic: , the average attention row of the head.
B.9 Resource details.
All experiments were run on a single NVIDIA L40S GPU with 48 GB of memory, sufficient to hold 8-billion-parameter models. Running the full SAUQ evaluation on the unsupervised benchmark takes
A. Uniform

D. Unembedding

B. Positional
E. Intrinsic
C. Zipf-Law
0.0000.00230.0050.00750.0100.01250.01500.01750.0200
| Measure | QA | Summ. |
|---|---|---|
| Uniform | 0.3660 | 0.4204 |
| Positional | 0.4027 | 0.4771 |
| Zipf-Law | 0.3718 | 0.4223 |
| Unembedding | 0.3755 | 0.4202 |
| Intrinsic | 0.3831 | 0.5069 |
Figure 6: Top tokens receiving the largest probability mass under each measure, and mean PRR for QA and summarization of SAUQ with these masses. Input (first 100 chars): Port-au-Prince, Haiti (CNN) – Earthquake victims, writhing in pain and grasping at life, watched doctors and nurses....
approximately 8 hours per model. The routing signal requires only and of the symmetric matrix , so no eigendecomposition is needed; forming costs per selected head and step with dense products.