arXiv:2610.24133cs.AIOct 2026

Manuscript Offprint

arXiv:2610.24133

A Conditional No-Hair Theorem for Transformers: How Language Models Forget Their Prompt

Shuyang Xiang

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

Abstract

A black hole retains only a few conserved charges of the matter it formed from. We ask how much an autoregressive transformer retains of its prompt after generating t tokens. Consider two different prompts followed by the same continuation text, so that any difference in their hidden states comes from the prompt alone, and we find that the distance between their hidden states decays approximately as a power law t−αt^{-\alpha}, where α=1\alpha = 1 is the rate at which a fixed prompt's share of uniform attention shrinks and smaller values mean longer memory. Beyond the first layers, trained models forget fast ( α≈0.55−0.7\alpha \approx 0.55-0.7), while untrained models with the same architecture forget slowly ( α≈0.2−0.5\alpha \approx 0.2-0.5, decreasing with depth). We prove that this offset is O(P(log⁡t)L−1/t)O(P(\log t)^{L-1}/t) for a prompt of length P and depth L. The bound holds for finite-depth pre-LN softmax transformers with full causal attention and bounded attention logits (e.g. rotary position encodings), under one additional condition: the pre-norm activations stay away from zero. The mechanism is geometric: the prompt's direct influence is diluted as the context grows, and relay — continuation tokens passing on what earlier tokens read from the prompt — can only add logarithmic factors. This is what we call the conditional no-hair theorem: given the text generated so far, the prompt's influence on the next token vanishes as t grows, so any property of the prompt that survives, such as its language, must be carried by the text itself. An exactly solvable linear relay model shows that the bound cannot be improved and reproduces the rise of the local exponent towards 1 seen in untrained networks. Cancelling the dilution with a logit bias on the prompt stops the decay early in training and makes the offset grow after training, so dilution is necessary for the forgetting we measure; untrained networks and the solvable model show that it is also sufficient. An attention path decomposition shows that training suppresses relay within the first billion tokens, before attention sinks form. A mild version of this compensation tends to raise adherence to system instructions at a small perplexity cost, though no more than a constant boost of equal mean strength. We will release the toolkit used in this paper, which measures α\alpha for any Hugging Face causal language model.

1 Introduction

Think of a conversation that runs long with your friends. You open with a remark about the weather — Wednesday looks nice, say, or Thursday looks nice — and by the time it has moved through work, a film, a friend's illness, nobody could tell from the last ten minutes which of the two you said. The opening line is still in the room, in the sense that nothing was deleted. It has simply stopped mattering. Large language models behave the same way. A system prompt sits at the start of the context, all of its tokens visible to every later query, and yet over a few dialogue turns the persona it sets drifts measurably [Li et al., 2024]. An agent whose constraints are given once, at the start of a long trajectory, undergoes the same erosion. Nothing is truncated, and still the model stops listening. We ask how fast this erosion occurs, and what drives it. We find that the decay is close to a power law, and that — counterintuitively — the training process itself accelerates this amnesia, causing a trained network to forget earlier constraints faster than a random-weight baseline. Whatever information does persist, such as the language of the prompt, survives not because the network retains a memory of the past, but because that past has already been inscribed into the local geometry of the generated text.

Why should an opening remark fade at all, when it never leaves the context? Physics offers a template. A black hole forgets almost everything about the matter that formed it: an exterior observer can only measure a few charges, and these persist because the exterior field itself can carry them. The corresponding questions for a transformer are then clear.

The core inquiry of this paper is simple to state. Give a language model a prompt, let it write t tokens, and compare two prompts that differ in a single word, in phrasing, in language, or in genre. Long after the prompt, can anything inside the model still tell them apart? And if not, why not?

We call the residual amount of the prompt in the hidden state its imprint, and ask three questions about it: how large is the imprint after t generated tokens, how fast does it decay, and what properties of the prompt can still be read off from it. Whether an imprint of a given size is readable depends on how it compares with the variation that the continuation itself causes, so we also track a decodability ratio: the imprint measured against the spread of hidden states across different continuations. The two quantities are not the same, but they are linked — a decoder can read the prompt off the state only while the imprint stands out against the continuation — and we show in what follows that in practice they decay at the same rate, which lets a single exponent summarise how quickly a prompt is forgotten.

This paper answers these questions in three steps. We first define a quantity that can be measured: the prompt offset, the difference between the hidden states of two runs that share a continuation but differ in their prompt. We then prove that, under mild conditions on the architecture, this offset decays at least as fast as t−1t^{-1} up to logarithmic factors, and show that the bound is attained by a model that can be solved exactly. Finally, we trace where the prompt's influence goes as it decays: through the attention path we call relay, which the training process suppresses within the first billion tokens.

Contributions. The imprint is measured as a prompt offset, and five results characterise how it decays.

  1. The measured decay. We define the teacher-forced prompt offset and show that it decays approximately as t−αt^{-\alpha}, with logarithmic corrections in untrained networks and close to a pure power law in trained Pythia on coherent text. The spread across continuations stays essentially constant ( β≈0\beta \approx 0 except in untrained Qwen), so the rate at which the prompt is forgotten is governed by a single exponent (Section 3).

  2. A theoretical bound. For finite-depth pre-LN transformers with non-degenerate pre-norm activations, the offset is O(P(log⁡t)L−1/t)O(P(\log t)^{L-1}/t); conditional on the generated text, the prompt's influence on the next token vanishes at the same rate. Uniform attention attains the bound asymptotically, and the resulting linear relay model is solved exactly for arbitrary layer gains (Section 4).

  3. The relay mechanism. We decompose the attention contribution to the offset into a direct path (queries reading the prompt) and a relay path (queries reading continuation tokens that already carry prompt information). The decomposition reproduces the measured α\alpha within 0.06 at every layer and training stage (Section 6).

  4. From mechanism to training. Compensating the dilution with a logit bias on the prompt removes or reverses forgetting; on Pythia, forgetting appears within the first billion training tokens, before attention sinks form; attention weights alone are a misleading proxy (Sections 6.2 and 7).

  5. An application, with its costs. A mild log t compensation increases instruction adherence at a small perplexity cost but induces instruction echoing; in multi-turn conversations it shows a consistent trend towards higher adherence, but no more than a constant boost with the same mean bias, so the benefit comes from extra attention to the instruction rather than from the shape of the compensation (Section 9).