The conditional no-hair theorem for Transformers: how language models forget promptsA Conditional No-Hair Theorem for Transformers: How Language Models Forget Their Prompt
Under shared continuation, L11 α for Pythia-160m in Table 1: 0.40 untrained, 0.66 after training.
- The prompt at the beginning stays in the context throughout, and the persona and constraints will still be eroded as generation proceeds. What needs to be quantified is how much of the prompt remains in the hidden state after generating t tokens, and what drives the decay.
- Fixing the same human continuation, the prompt offset is defined by the difference of the residual streams of the two prompts. The authors give an upper bound of t to the power negative one under pre-LN, and split the influence into direct reading and relay.
- Table 4: after training, 160m last-layer α is 0.66, untrained 0.36; Qwen2.5-0.5B is 0.58 versus 0.18. Per-head compensation can reverse the measured forgetting. On French instructions, log t compensation is no better than an equal-mean constant boost.
- The authors state that the upper bound is only informative when t is much greater than P times e to the power 2B, and that the non-degeneracy assumption is an empirical check. α is measured up to Pythia-1b, behavioral tests up to Qwen2.5-1.5B; 32 dialogues per condition, and the checkpoints used for α are pretrained models.
- Evaluated models
- Pythia-160mPythia-410mPythia-1bQwen2.5-0.5BQwen2.5-1.5BQwen2.5-0.5B-InstructQwen2.5-1.5B-Instruct
- Benchmarks
- hand-written scenesWikiText-103MRPCWMT14real-corpus pairs
- Metrics
- αβprompt offsetperplexity changeFrench share
The researchers propose a conditional baldness theorem for Transformers, namely that given the already generated text, the influence of the prompt on the next token tends to vanish as the generation length t increases. When two different prompts are followed by the same continuation text, the hidden-state distance between the two decays approximately as a power law t^{-α}, where α=1 corresponds to the rate at which a fixed prompt's share under uniform attention shrinks. Measurements show that trained models forget faster (α≈0.55–0.7) and untrained models forget more slowly (α≈0.2–0.5); the paper proves that under finite-depth pre-LN softmax Transformers, bounded attention logits, and pre-norm activations bounded away from zero, the upper bound is O(P(log t)^{L-1}/t), where P is the prompt length and L is the depth. The mechanism given by the paper is that the prompt's direct influence is diluted as the context grows, while relay through continuation tokens paraphrasing earlier content can only add logarithmic factors; an analytically solvable linear relay model shows that this upper bound cannot be improved.
Paper analysis
What problem does this paper attempt to solve?
Under shared continuation, the imprint of the prompt in the hidden state decays as a power law, and training accelerates forgetting.
After an autoregressive transformer generates t tokens, how much of the prompt remains in the hidden state, and how fast and why this memory decays.
- Scenarios where it appears: the authors state that every token of the system prompt is visible to later queries, but after a few rounds of dialogue the persona drifts; constraints given only once at the start of a long trajectory are also eroded. The context has not been deleted, yet the model no longer obeys.
- Shortcomings of existing understanding: if two prompts generate freely, the hidden-state difference may just be responding to different text. The authors also state that raw attention weights are occupied by the sink, yet do not carry prompt-specific content.
- Core observation: when two prompts are followed by the same continuation unrelated to both, the hidden-state difference can only come from the prompt. The authors state that this difference decays approximately as t to the power negative α; α=1 corresponds to the shrinkage of the prompt share under uniform attention, and a smaller α means remembering longer.
- Object of this paper: the measurable prompt offset, and a conditional no-hair theorem for finite-depth pre-LN softmax transformers. Under fully causal attention, bounded logits, and pre-norm away from zero, the authors prove the offset is O(P times (log t) to the power L−1, divided by t). Training suppresses the indirect path called relay.
What related research exists?
Related work falls into three lines: long-context failure, attention information flow, and power-law decay.
The authors place the problem between long-context failure, attention information flow, and the power law of long text and attention.
Failure in long context
- Li et al. [2024]: adherence to the system prompt declines within a few rounds of dialogue, attributed to attention decay, and they propose split-softmax. The authors state that this paper's causal experiments agree with that cause, and explain the drift by the 1/t shrinkage of the share under uniform attention.
- Attention sink: Xiao et al. [2024] and Gu et al. [2025] describe the sink as absorbing attention but not carrying information; Barbero et al. [2025] hold that the sink prevents over-mixing. The authors state that forgetting begins earlier than sink formation, so the sink is not the initial cause.
- Meyer et al. [2026]: there is a sharp length threshold for which sequences a transformer can generate. The authors state that this work asks what the model can produce, whereas this paper asks how the influence of a given prompt decays.
Information flow in attention
- Kobayashi et al. [2020], Abnar and Zuidema [2020]: analyze attention using vector norms and attention flow, on which the authors base their path decomposition.
- Dong et al. [2021]: the rank of pure attention collapses double-exponentially with depth, which is mixing along the depth direction; this paper looks at the token direction.
- Barbero et al. [2024]: in decoder-only models, the sensitivity of the last token to earlier tokens is limited by over-squashing. The authors state that the theorem writes this loss of a fixed prompt as generation proceeds as an upper bound.
Long-range statistics and the attention power law
- Lin and Tegmark [2017], Chen et al. [2025]: the mutual information of natural text decays as a power law. The authors use random initialization to rule out "the power law is only inherited from the corpus": an untrained network already forgets as a power law, and after shuffling continuation sentences the exponent changes within 0.01.
- Koley et al. [2025]: attention scores to earlier tokens decay roughly as a power law, and this is used for dynamic sparse attention. The authors state that the dilution lemma gives a mechanism, but the weights cannot represent whether the hidden state still contains the prompt.
- Nakanishi [2025]: observes that softmax flattens as context grows, and proposes Scalable-Softmax, which multiplies logits by s log n. The authors state that logit scaling that grows with length makes logits unbounded, Lemma 1(a) and Lemma 2 no longer apply, and predict that such scaling would keep prompt information longer.
Influence on the output and positioning
- Marklová et al. [2026]: rescore a fixed generation under different prompts, and the influence fades with accumulated context. They measure the output distribution; this paper measures hidden states, so as to separate the direct path and relay by layer.
- Baselines and data: the controls are random initialization of the same architecture or Pythia's step 0, and a placebo with equal mean added at the start of the continuation. The data are 20 handwritten scenarios, and real-corpus pairs on WikiText-103, MRPC, WMT14.
- Positioning: the authors state that the failure mode comes from the first line, the path decomposition from the second, and the power law from the third.
How does the paper address this problem?
The conditional no-hair theorem bounds the last-layer offset as decaying as t to the power negative one, at most multiplied by L−1 logarithmic factors.
Both the measurement and the upper bound revolve around the prompt offset and the conditional no-hair theorem. Under the same continuation, the prompt's direct share is diluted by the lengthening context; relay contributes only a logarithmic factor.
What is compared and what is measured
- interior and exterior: after generating t tokens, the prompt can remain in the generated text (exterior), or in the residual stream at the current position (interior). Free generation mixes the two, so two prompts are followed by the same human continuation. The authors state that teacher-forcing is a measurement device, not the failure mode itself (Section 3.1).
- offset: the residual stream of layer l is taken before normalization, and averaged over a window of 16 continuation tokens, with time taken at the window center. The offset norm is δl(t;c)=‖hl(x′∘c,t)−hl(x∘c,t)‖ (Definition 1).
- signal, noise, exponent: each coordinate is scaled by the standard deviation of the first window, pooling the two prompts. The signal S is the mean square of the offset common across continuations, and the noise N is the variance of the hidden state across continuations; the two are fitted as t to the power −2α and −2β. Decodability changes as t to the power −2(α−β). The late period uses an unbiased estimate over paired continuations, to avoid estimating the decay too slowly (Section 3.2–3.3).
- windows and sample sizes: Pythia's window ends are 16, 32 up to 1024, handwritten scenarios up to 1920, Qwen up to 2048. real-corpus has 8 continuations per pair, handwritten 16 per scenario. The global α is the least-squares slope of −1/2 ln S against ln t over all measured points, and local exponents are also given (Section 3.3–3.4).
Dilution and the theorem
- Architectural scope: L layers of pre-LN, causal attention, residual; inside logits are rotary position or no position term. The residual stream itself is not normalized, and both sequential and parallel blocks are included. It does not cover post-LN, linear attention, recurrent state. Appendix A also excludes additive positional biases that grow with distance, logit scaling that grows with context, and sliding-window attention.
- Assumption 1: the inputs of block 2 and later, the final norm, and the post-attention residual read by the MLP in sequential blocks satisfy a norm lower bound r>0, so that normalization is Lipschitz. The authors report r divided by the square root of d on the measured sequences: Pythia-160m initialization 0.11, after training 0.24, 1b after training 0.49, Qwen2.5-0.5B block input 0.105; Qwen's first block post-attention norm puts the constant at 0.012. This does not cover arbitrary continuations (Section 4.1, Appendix B).
- Three-part recursion: a query at distance i sees at most P+i keys. Lemma 2 bounds the attention mass on the prompt as at most P e to the power 2B divided by i. A layer's offset consists of the average over the previous layer at the same position and earlier positions (relay) and an O(P/i) direct term; only the direct term shrinks with i (Lemma 3).
- Upper bound: under Assumption 1, the last layer satisfies δL(t)≤CL P(L+ln t)L−1/t. C_L depends on the architecture, not on t or P. The authors state that what it fixes is the asymptotic shape: no decay slower than t to the power negative one with a logarithmic power exceeding L−1; after training the logit span is very large, and in the measurable window the bound has no numerical content (Theorem 1, Remark 1).
Solvable model and paths
- Linear relay: uniform attention, constant gain per layer, prompt difference entering along a fixed direction. With equal gain the offset is exactly Θ(P times (ln i) to the power l−1 divided by i), on which basis the authors state that the logarithmic power in the theorem cannot be removed. Arbitrary gain has a closed form. With small gain the local exponent tends to 1 as t grows, and decreases with depth (Proposition 1–2, Corollary 2).
- Correspondence with the measurement: layer 1's local exponent should be t/(P+t). The authors state that untrained Pythia agrees with this; untrained Qwen's first few blocks are not this mechanism. The authors consider it possible that the sequential residual makes the first block's MLP process the attention write nonlinearly, but did not test it (Section 4.5, 5.4).
- Path decomposition: the attention write is split into direct (the query reads the prompt) and relay (the query reads continuation tokens that already carry prompt information). The sink shared by both sides cancels after subtraction. The cumulative write reproduces the measured α to within 0.06 at each layer and each checkpoint (Section 6.1).
- Compensating for dilution: add γ log((q+1)/P) to the logits of continuation queries pointing at the prompt. γ=1 is uniform compensation; it can also be fitted per head, so that the attention of a typical prompt token no longer decays with distance (Section 7.1).
Does it still influence the next token given the text
- Corollary 1: given the same history, the total variation distance between the next-token distributions of the two prompts is likewise O(P times (ln t) to the power L−1 / t). Within a short window, the next token is determined by the text already written. The sum of the stepwise upper bounds diverges, so the authors state that this does not rule out a cumulative influence bypassing the text, nor does it prove that such an influence exists.
- Judging free generation: the observer sees only the generated text. The window becomes a hashed unigram histogram, and logistic regression is then used to distinguish the two prompts. Whether properties such as language remain is determined by this probe and the teacher-forced language axis comparison, not derived from the theorem alone (Section 4.4, 8).
What experiments did the paper conduct?
After training, deep-layer α is higher than in untrained networks; compensating for dilution can remove or reverse the measured forgetting.
Experimental setup
- Models: Pythia-160m at step 0, 128, 256, 512, 1000, 4000, 16000, 143000; Pythia-410m and Pythia-1b initialized and after training; Qwen2.5-0.5B trained weights and random initialization with standard deviation 0.02, seed 0; trained Qwen2.5-1.5B. Behavioral tests use Qwen2.5-0.5B-Instruct and 1.5B-Instruct. float32, a single Apple-silicon laptop (Section 3.5).
- Data: 20 handwritten scenarios, each with one base plus detail, para, genre, lang, and 16 WikiText-103 validation continuations of at least 1920 tokens per scenario. real-corpus 100 pairs per axis: WikiText with one word changed, MRPC, WMT14 English-French, two unrelated WikiText; 8 validation continuations per pair (Section 3.4).
- Estimation: window length 16, labeled by center. real-corpus, path decomposition, compensation, and trade-off use the unbiased signal; handwritten scenarios use plug-in, and the authors state that its late-period exponent is therefore biased low. 95% intervals are bootstrap over scenarios or prompt pairs (Section 3.3).
- Metrics: α comes from the signal, β from the cross-continuation noise; the exponent of the mean squared offset M is also reported. The main measurement has no LLM judge.
- Controls: untrained or step 0; the placebo in Section 9 is a boost of equal mean strength added at the start of the continuation.
- Free-generation probe: 4096-bin histogram, standardized then projected onto 16 principal components, logistic regression with L2, C=0.1, 5-fold stratified cross-validation; temperature 1, 32 trajectories per prompt, 3 scenarios. Qwen uses a 32-token window, Pythia an 8-token window (Section 8).
Main results
The table below is based on Table 4: mean over the four real-corpus axes, unbiased signal, windows labeled by center. Pythia's te is 16 to 1024, Qwen's to 2048. The last layers are L11, L15, L23, L27 in order.
Swipe horizontally to read the table
Model State First-layer α Last-layer α Pythia-160m untrained 0.73 0.36 Pythia-160m trained 0.97 0.66 Pythia-1b untrained 0.73 0.33 Pythia-1b trained 0.87 0.58 Qwen2.5-0.5B untrained 0.63 0.18 Qwen2.5-0.5B trained 0.74 0.58 Qwen2.5-1.5B trained 0.95 0.55 Pythia-410m is omitted. It is reported only in Table 1 under handwritten scenarios and the plug-in signal: untrained L23 is 0.35, after training 0.60.
- The authors state that on Pythia β is approximately 0, and changes in decodability come from α; untrained Qwen is the exception, with β about −0.1 to −0.2 (Section 5.1, 5.4).
- The authors state that when untrained, α decreases with layer number and is independent of width; after training, layer 1 is close to pure dilution, deeper layers flatten, and the paraphrase and language axes are forgotten more slowly (Section 5.1–5.2).
- The authors state that unrelated sentences and one-word substitutions are forgotten at the same rate: for Pythia-160m's L11, untrained 0.35 versus 0.37, after training 0.70 versus 0.69 (Section 5.2). The size of the difference changes the magnitude, not the exponent.
When training suppresses relay
- What was measured: the same 400 real-corpus prompt pairs through Pythia-160m checkpoints, and attention writes split into direct and relay (Table 6–7, Figure 5).
- Results: under the four-axis mean of Table 7, L11's α is 0.36 at step 0, 0.68 at step 512, and 0.66 at step 143000. L1 is still 0.72 at step 1000 and 0.96 at step 4000. The attention mass of token 0 is no more than 0.003 in the measured layers at step 1000 and before. In Table 6, at step 0 L11's relay share is 0.97 and α_relay is 0.01; after training the relay share is 0.53, while the α of the sum of the two paths is 0.63, which cannot be read directly from the per-path exponents.
- The authors' interpretation: forgetting appears at step 128–512 (about 0.3–1B tokens), earlier than sink formation and earlier than layer 1 becoming a strong recency preference. The earliest change is that relay begins to leak. The authors state that attention weights can predict α only around step 512–1000; before that relay is missed, and after that the sink occupies the weights but carries no prompt content.
Compensating for dilution and instruction following
- Causal compensation: Table 8 uses the same setup as Table 6. For trained L11's α, the original is 0.65, uniform compensation is 0.25, per-head compensation is −0.01. On initialization and step 512, per-head compensation lowers α to 0.05–0.13. The authors state that dilution is a necessary condition for the measured forgetting; sufficiency comes from untrained networks and the linear relay, not from the compensated network. Per-head compensation raises perplexity by 140% to 376%, and the network moves far from the training distribution (Section 7, 9.1).
- Cost of a mild boost: Table 9, Pythia-160m step 143000, s log((q+1)/P). At s=0.5, L11's α is 0.48 (0.65 at s=0), and the perplexity change on WikiText continuations is +2.6%; at s=1 it is 0.25 and +16.1%. The equal-strength placebo at s=1 gives L11 0.53 and perplexity +10.3%. The authors state that at the same retention level, adding to the prompt costs less perplexity; at the same strength, in this experiment the prompt boost is more expensive, because the WikiText continuation is unrelated to the prompt.
- Instructions: with Qwen2.5-0.5B-Instruct, a system prompt requiring only French, and generating 2048 tokens, the all-French sample proportion is 94% at s=0.5, versus 31% without that boost. 1.5B-Instruct goes from 84% to 94–100%, and an equal-mean constant boost also achieves this, with fewer echoes. 8 rounds of dialogue, 32 dialogues per condition: without boost the French proportion drops from 0.90 to 0.81–0.87, and 78% of dialogues are all French; with log t strength 0.1 and 0.25, all-French is 84% and 91%, and the equal-mean constant is 84% and 88%. The authors state that these are trends, and the benefit comes from attending more to the instruction, not from the shape of the compensation curve. In the length-forced single turn, the proportion of the 1.5B output's latter half talking about the instruction goes from 19% to 56–69% (Section 9.2).
What remains in free generation
- What was measured: 3 handwritten scenarios, 32 temperature-1 trajectories per prompt, using a text probe to distinguish the prompts. Chance level is 0.5; the null distribution from randomly splitting trajectories of the same prompt has a 95th percentile of 0.58–0.63 (Section 8).
- Results: detail, paraphrase, genre are not decodable from the text; language is still decodable, at t=512 Qwen2.5-0.5B is 0.81 and Pythia-160m is 0.84. On Qwen, 4–11 of the 32 per scenario switch language, mostly to Chinese. The teacher-forced language axis still decays: the authors state that for trained Pythia-160m's L3–L11, the language axis α is 0.54–0.65, and one-word detail is 0.61–0.69 (Table 3).
- The authors' interpretation: language remains along the exterior: the prompt pushes the opening token toward that language, and thereafter each token is predicted on a history that is already in that language. This is not the hidden state still remembering the prompt.
Other ablations and analyses
- Continuations after shuffled sentences: for untrained Pythia-160m the exponent changes within 0.01; after training the deep-layer global α drops by 0.02–0.11 (160m, L6–11) and 0.09–0.18 (1b, L8–15) (Table 5). The authors state that the reading "coherent continuations crowd out the prompt" was not tested.
- S and M: for untrained Pythia the two differ within 0.01; after training, for 160m's L6–11, α_M is 0.52–0.57 and α_S is 0.58–0.67 (Section 5.3).
- For trained Qwen, α_loc in the last octave drops to 0.23–0.57 (0.5B, including L1's 0.24). The authors state that this is layer 1 attention oscillating in position around 1/t; the unbiased estimate, shared first token, and shuffled sentences all fail to remove this slowdown (Section 5.4).
- Attention weights predict α only around step 512–1000 (Section 6.1).
- In preliminary experiments on handwritten scenarios, the α of model-written continuations and human continuations differ within 0.1 (Section 7.3).
- For Qwen2.5-1.5B's L14 and L21, the signal is always below three times the sampling floor, and the authors do not explain these two layers (Section 5.4).
What are some points that can be further explored?
The authors state that the theorem only constrains the asymptotic shape, and scale, instruction tuning, and oscillation period remain to be investigated.
Limitations and future directions noted by the authors
- Information content of the upper bound: the constant in Theorem 1 can grow exponentially with depth, and is only informative when t is far greater than P times e to the power 2B; it constrains the asymptotic shape, and does not predict the exponent fitted in a finite window (Section 10).
- Assumption not derived: non-degeneracy was checked on the measured sequences, not derived; the margin for Qwen's first block is small (Section 10).
- Scale: the core measurements stop at Pythia-1b, and the behavioral tests stop at Qwen2.5-1.5B. The authors state that changes at larger scale cannot be ruled out, although the untrained results at 160m, 410m, 1b and the agreement between trained Pythia and Qwen give no such indication (Section 10).
- Text and positional encoding: the prompt is English, with a French and, in preliminary experiments, a Chinese variant; free generation uses only one temperature. The continuations are coherent or shuffled WikiText, and the post-training decay shape depends on which. The late-period slowdown of trained Qwen is layer 1 attention oscillating around 1/t, and its period and relation to the rotation frequency remain open (Section 10).
- Behavioral tests and fitting window: the single-turn test fixes the generation length, and the later part contains padding after the story ends; multi-turn has only 32 dialogues per condition. The exponent is fitted over at most seven octaves, and the logarithmic description cannot be separated from the small-gain description (Section 10).
- Follow-up questions: whether the fitted exponent is still in the same range on larger models, and whether the depth dependence of untrained networks remains; the period of the Qwen layer 1 oscillation; whether instruction tuning changes the picture, since the trained models used for α measurement are all only pretrained. The authors plan to release a toolkit to measure α for any Hugging Face causal language model (Section 10, Appendix D).
Scope of the experiments
- The models for α are 8 checkpoints of Pythia-160m, Pythia-410m, Pythia-1b, Qwen2.5-0.5B trained and randomly initialized, and trained Qwen2.5-1.5B (Section 3.5, Table 4, 7).
- The main measurement is teacher-forcing shared continuations: 20 handwritten scenarios, 16 continuations per scenario; real-corpus 100 pairs per axis, 8 continuations per pair, with axes detail, para, lang, and genre or unrelated (Section 3.4).
- The free-generation probe is 3 handwritten scenarios, 32 trajectories per prompt, temperature 1, logistic regression; multi-turn is 8 rounds, 32 dialogues per condition (Section 8, 9.2).
- Dilution compensation includes uniform and per-head, and an equal-mean placebo; path decomposition reports step 0, 512, 143000 (Table 6, 8, 9).
- The paper reports no LLM judging, and no agreement between judging and humans; the exponent intervals are 95% bootstrap over scenarios or prompt pairs (Section 3.3). The proofs do not cover ALiBi, Scalable-Softmax, and sliding-window attention (Appendix A).
Summarize the main content of the paper
Given the already generated text, the prompt's influence on the next token vanishes with t, and the surviving information is carried by the text.
This work gives a measurable exponent and an upper bound for an autoregressive transformer forgetting the prompt.
- The question is: after generating t tokens, can the two prompt segments still be distinguished in the hidden state. Free generation cannot distinguish memory from a reaction to the text, so the authors fix the same human continuation and define the difference in the residual stream as the prompt offset.
- Under finite depth pre-LN, bounded logits, and pre-norm away from zero, the authors prove that the last-layer offset decays at most as t to the power of negative one, times at most L−1 logarithmic factors. A linear relay model with uniform attention achieves this order. Given the already-written text, the difference in the next-token distribution vanishes at the same rate.
- On the handwritten scenario of Table 1, for Pythia-160m's L11: the untrained α is 0.40, and after training it is 0.66. On the four-axis mean of the real-corpus in Table 4, this model's last layer is 0.36 versus 0.66; Qwen2.5-0.5B's last layer is 0.18 versus 0.58. The authors state that Pythia's cross-continuation noise barely decays, so the forgetting rate is this single exponent.
- Table 6: when untrained, the relay share of the L11 last-window offset is 0.97. The relay begins to leak at step 128–512, earlier than the sink at token 0. After per-head compensation and dilution, the trained model's L11 α is −0.01 (Table 8). The authors state that dilution is a necessary condition for the measured forgetting, and that the untrained network shows uniform attention is also sufficient.
- A mild log t boost at s=0.5 increases WikiText perplexity by 2.6% (Table 9). The proportion of fully French samples for Qwen2.5-0.5B-Instruct at this strength is 94%, versus 31% without the boost. The authors state that the shape of log t is not better than a constant boost with equal mean; only more attention to instructions is useful.
- The authors' conclusion is: given the already-generated text, the prompt's influence on the next token vanishes with t; properties like language that can still be read out are carried along by the text itself, not by the hidden state still retaining the prompt.