Length Confounds in Attention-Based Diagnostics: Entropy and Mass Measures Are Biased in Opposite Directions
Attention statistics are increasingly used to diagnose generation failure in transformer language models. Two families are in common use: entropy measures, which summarise how diffuse a query's attention is, and mass measures, which report the attention placed on a designated subset of tokens such as constraint tokens or supplied context. Where these are compared across prompts of differing length -- ablation studies, prompt-compression evaluations, context manipulations -- both families are confounded, and in opposite directions. That softmax attention disperses as sequence length grows is established: Velickovic et al. (2025) prove that attention coefficients decay as Theta(1/n) for bounded logits. This preprint does not claim that observation. It shows that the consequence for comparative measurement has been overlooked, and that it is large enough to invert reported conclusions. Under a generative model of attention logits in which anchor tokens are held fixed and only filler is removed, so that every observed change is artefact, eightfold compression lowers Shannon entropy by 1.913 nats while raising anchor mass by 0.363. A study reporting that compression concentrates attention, and one reporting that compression increases attention to constraint tokens, would both be measuring the same artefact. Main results: 1. The entropy artefact is comparable in magnitude to a plausible conditioning effect and opposite in sign. Anchor removal at fixed length raises entropy by 1.400 nats, while threefold compression lowers it by 1.016 nats. 2. The raw entropy contrast inverts at a locatable compression ratio, r = exp(dH_anchor), predicted analytically at 4.055 and confirmed by bisection at 4.085, an agreement of 0.74 per cent. Across a parameter grid the inversion point ranges from 1.06 to 22.21. 3. Normalising by log n reduces the entropy artefact twentyfold but leaves a non-monotone residual of 0.094. Query position must enter analyses as a covariate rather than merely as a divisor: at constant conditioning quality, raw entropy varies by 3.732 nats across query positions 16 to 1024. 4. For mass measures the obvious normalisation, lift over the uniform null, is worse than no correction. Its range of 18.9 exceeds the raw artefact of 0.363, because it inherits a ceiling at n/m. 5. The statistic that works is the anchor log-odds ratio, Lambda = logit(mass) - log(m/(n-m)), which recovers the underlying logit gap to within 0.03 and varies by only 0.012 across an eightfold compression sweep. A measurement protocol is specified, covering measure-family identification, correction, length-matched controls with a filler-inertness sensitivity check, position as covariate, per-head and per-layer reporting, and the item as the unit of analysis. Scope and limitations. The quantification uses a generative model of attention logits, not a trained transformer, and its parameters are illustrative rather than estimated. What transfers is structural -- that the two measure families are biased oppositely, that raw entropy has a locatable inversion point, that lift fails and Lambda does not -- and follows from the log n bound and from softmax renormalisation. The magnitudes do not transfer, and a validation harness for open-weight models is released alongside, with a preregistration. The preprint takes no position on the direction of the attention-failure relationship, which is condition-dependent and currently unresolved. The contribution is that the question cannot be settled by instruments that invert or manufacture their own answer within the range of manipulations used to probe it. Relevant to work using attention-based hallucination detection (Yuksekgonul et al. 2024; Chuang et al. 2024; Sriramanan et al. 2024), prompt-compression evaluation (LLMLingua, LLMLingua-2), and any ablation design that alters prompt length. Preprint. Not peer reviewed. All reported quantities are reproduced by an accompanying package requiring only numpy, with a validator asserting 34 numeric claims including three negative controls.
Authors
- Igor Salganik
Publication Details
- Journal
- Zenodo (CERN European Organization for Nuclear Research)
- Published
- 2026-09-04
- DOI
- https://doi.org/10.5281/zenodo.22309801
- Primary Topic
- Neurobiology of Language and Bilingualism
- Type
- article
- Field-Weighted Citation Impact
- 0.00