Manuscript Offprint

arXiv:2610.16745

Before Attention Sinks Form: Hidden-State Geometry Reveals and Modulates Their Formation

Fan Yang, Yue Song

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

ABSTRACT

Attention sinks are usually studied after they have formed. We ask whether a measurable hidden-state change appears beforehand and whether changing that geometry alters what happens later. To remove network depth as a shortcut, we compare prompts in the same model and at the same layer. When sink timing varies across prompts, simple spectral summaries of the hidden states add information beyond current attention, with the clearest prompt-specific signal in a short window about two to three layers before sink formation. The predictive strength varies across cohorts, so we treat the spectrum as a readout of a pre-sink state change rather than a universal warning statistic. The signal is broader than one measured extreme activation. We then modify only the singular values of the post-layer hidden states after current attention has already been computed. These interventions change later sink behavior in Qwen2.5, GLM-Z1, and GPT-OSS relative to norm-matched random spectral perturbations. In Qwen2.5, the immediate suppressive effect is accompanied by a reduction in next-layer query-key preference for position 0, and the learned spectral directions remain stable when estimated from substantially less training data. Together, the results show that attention sinks are preceded by a short spectral reorganization of hidden states, and directly perturbing this geometry can causally alter subsequent sink formation. The source code for the observational analyses, spectral interventions, and robustness experiments is available at https://github.com/fyangRobert/attention-sink-geometry

1 INTRODUCTION

Attention sinks are a widely observed behavior in transformer-based large language models (LLMs): a large fraction of attention can concentrate on an early or special token even when that token is not important to the current prediction (Xiao et al., 2024). They also matter for long-context inference and KV-cache management, where retaining sink tokens can stabilize generation (Xiao et al., 2024; Su and Yuan, 2025). Yet most existing work studies sinks after they have already appeared. Much less is known about what happens in the hidden states before a sink forms.

Our main finding is simple: attention sinks are preceded by a short spectral reorganization of hidden states, and directly perturbing this geometry can causally alter subsequent sink formation. The first part is observational: hidden-state geometry changes before the attention pattern becomes visible. The second part is causal: modifying the same geometry after the current layer has already finished computing attention can change sink behavior in later layers.

Studying the observational part requires a strict control for network depth. Sink formation is often tied to a characteristic layer, so a model can appear to predict future sink formation simply by learning where it is in the network. We therefore compare prompts only within the same model and at the same current layer. In this setting, model identity and depth are fixed, and the question is whether prompts that have not yet formed a sink already differ in their hidden states according to how soon a sink will subsequently appear.

∗^{*}Corresponding author.

Figure

Figure 1: Overview of the observational and causal analyses. (A) We compare prompts in the same model and at the same layer before either has formed a sink, and ask whether their hidden-state spectra already differ before their later sink timing diverges. (B) After the source-layer attention has been computed, we modify only the singular values of the post-layer hidden state while keeping the token mean and singular subspaces fixed; current attention is therefore unchanged, and we measure how later sink behavior responds. (C) In Qwen2.5, the immediate effect of the spectral edit is associated with a change in the next layer's relative QK preference for position 0 and a corresponding change in position-0 attention. (D) Tracking the perturbation across layers shows that its norm can survive while its full hidden-state direction rotates and its targeted spectral component may either persist or weaken, helping explain why the downstream effect depends on where the edit is introduced.

We measure this structure using simple summaries of the singular spectrum of the prompt-specific token-by-hidden-state matrix. Where sink timing varies across prompts, these spectral features add information beyond current attention. The pooled effect extends over several short horizons, but the clearest prompt-specific evidence under strict within-cell evaluation is concentrated roughly two to three layers before sink formation. Its predictive strength varies across prompt cohorts, so we interpret the spectrum as a readout of a pre-sink representation change rather than as a universal warning statistic.

The spectral change is not well explained by a single unusually large activation. Compact measures of hidden-state amplitude and concentration leave substantial incremental spectral information, whereas broader descriptions of the distributed activation state contain much of the same predictive information. Qwen3 provides a complementary timing example: 10 prompts form sinks at layer 3 and 40 at layer 7, yet under a stringent criterion the abrupt extreme-activation event occurs at layer 6 for both groups. Its timing therefore cannot explain the prompt-specific difference between early and late sink formation.

We next intervene directly on the spectral geometry. The edit is applied after the source layer has already computed attention and changes only the singular values of the post-layer hidden state, while preserving the token mean, singular subspaces, and centered spectral energy. Random spectral directions are matched to the same realized perturbation norm. These spectrum-only edits change later sink behavior in Qwen2.5, GLM-Z1, and GPT-OSS, while the source-layer attention remains unchanged. The effect is not universal in sign: the naturally observed near-state direction suppresses later sink strength in Qwen2.5 and GLM-Z1, whereas the frozen GPT-OSS direction strengthens its later full-attention sink endpoint. Thus the spectrum is a causally actionable coordinate of the hidden state without being a one-dimensional “toward-sink” axis.

Table 1: Key results and their reference points. For observational rows, AP is the prompt-grouped out-of-fold average precision for predicting future sink formation at the specified horizon. We report the attention-only baseline AP(A) and the gain from adding hidden-state spectral features, ΔAP=AP(A+S)−AP(A)\Delta \mathrm{AP} = \mathrm{AP}(\mathcal{A} + \mathcal{S}) - \mathrm{AP}(\mathcal{A}). Comparisons are made within the same model and current layer. Intervention rows instead report changes in later sink strength under controlled post-layer spectral edits and therefore do not use AP.

QuestionWhat is comparedMain resultWhat it means
Does the spectrum add information before a sink forms?Current attention only (A) vs. current attention plus spectrum (A + S), with model and layer matched.Exact 1: AP .857 → .913 (ΔAP = +.056, [.028, .087]).Strict within-cell: Within 2 +.107 [.048, .155]; Within 3 +.053 [.002, .101]; Within 4 -.021 [-.037, .029].The extra information is clearest about two to three layers before the sink.
Does changing the spectrum change later sink behavior?For the learned direction, opposite signs (+d vs. -d) are compared at the same perturbation size. That directional gap is then tested against gaps from norm-matched random spectral directions.Later-sink directional gap: Qwen2.5: -.00833, p = .0308; GLM-Z1: -.01525, p = .0308; GPT-OSS: +.05625, two-sided p = .0462; 30/30 fresh prompts have the same positive sign.Yes, but the direction and size of the effect depend on model and state.
What changes immediately after the Qwen2.5 edit?Opposite signs of the learned spectral direction are compared at the same perturbation size; source-layer attention is unchanged.Next-layer position-0 attention changes by -.0214.The QK-preference change tracks the attention change: r = .544, with 97.7% sign agreement.The immediate suppressive effect is associated with lower next-layer preference for position 0.
Can the edit direction be estimated from less data?Directions estimated from reduced training sets are compared with the full-data direction or with an independently estimated half-sample direction.Qwen2.5: disjoint-half direction cosine .979.GPT-OSS: half-data effect +.05634 vs. full-data effect +.05625 (effect ratio 1.002).The learned direction and its downstream effect are stable under substantial data reduction.

The downstream effect also depends on what later transformer blocks do to the perturbation. In Qwen2.5, the immediate suppressive effect is accompanied by a reduction in the next layer's relative query-key preference for position 0. Farther downstream, GPT-OSS can preserve both perturbation norm and most of the targeted spectral component while rotating the full hidden-state displacement and sharply weakening the attention effect. Qwen2.5 shows a related but different pattern: the perturbation norm survives, but much of the targeted spectral component is filtered and the remaining hidden-state change is strongly reoriented. These results help explain why the effect of a spectral edit depends on where it is introduced.

Contributions. We make three contributions:

  • Pre-sink state change. We identify a short spectral reorganization before sink formation using same-model, same-layer comparisons, and characterize the cohort dependence and boundary conditions of this observational signal.

  • Controlled spectral intervention. We show that modifying only post-layer singular values can change later sink behavior while current attention remains fixed, with evidence from Qwen2.5, GLM-Z1, and a frozen GPT-OSS confirmation against norm-matched random directions.

  • Local and cross-layer explanation. We trace the immediate Qwen2.5 effect to reduced next-layer position-0 query-key preference and show that later transformer blocks reshape the perturbation, explaining why its downstream effect depends on source layer and model state.

References (23)