Paper proves transformers forget their prompt as a power law

A preprint on Hugging Face Papers asks a simple question: how much of its prompt does an autoregressive transformer still retain after it has generated t tokens? To isolate the prompt's effect, the authors take two different prompts and follow both with the same continuation text. Any difference in the hidden states then comes from the prompt alone.
The authors find that the distance between the two hidden states decays approximately as a power law, t^{-α}. The reference point is α=1, the rate at which a fixed prompt's share of uniform attention shrinks; smaller values of α mean longer memory. Trained models forget fast, with α of roughly 0.55 to 0.7. Untrained models forget slowly, with α of roughly 0.2 to 0.5.
The paper also proves an upper bound on this offset: 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 bounded attention logits, under one additional condition: the pre-norm activations stay away from zero.
The mechanism is described as geometric. The prompt's direct influence is diluted as the context grows. Relay, meaning continuation tokens passing on what earlier tokens read from the prompt, can only add logarithmic factors, which is where the (log t)^{L-1} term comes from.
The authors call the result 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.
Two further results back the account. An exactly solvable linear relay model shows that the bound cannot be improved, and it reproduces the rise of the local exponent towards 1 seen in untrained networks. And an intervention test: cancelling the dilution with a logit bias stops the decay early in training and reverses it afterwards. That makes dilution necessary for the forgetting the authors measure; untrained networks and the solvable model show it is also sufficient.
Key facts
- Hidden-state distance between two prompts followed by the same continuation decays approximately as a power law t^{-α}, where smaller α means longer memory.
- Measured exponents: roughly 0.55 to 0.7 in trained models, roughly 0.2 to 0.5 in untrained ones; α=1 is the rate at which a fixed prompt's share of uniform attention shrinks.
- Proved bound: the offset is O(P (log t)^{L-1} / t) for prompt length P and depth L, for finite-depth pre-LN softmax transformers with bounded attention logits and pre-norm activations kept away from zero.
- Mechanism: the prompt's direct influence is diluted as context grows, and relay through continuation tokens adds only logarithmic factors.
- A solvable linear relay model shows the bound cannot be improved; cancelling dilution with a logit bias stops or reverses the decay, so dilution is necessary for the measured forgetting.
Why it matters
The paper gives a precise statement of how a transformer's memory of its prompt fades during generation, rather than leaving it as an intuition. Its headline claim is the conditional no-hair theorem: given the text generated so far, the prompt's influence on the next token vanishes as t grows. Any prompt property that persists, such as its language, must therefore be carried by the generated text itself. The paper pairs a proof with measurements, and the trained-versus-untrained gap (roughly 0.55 to 0.7 against roughly 0.2 to 0.5) shows training makes models forget faster.
Who it affects
The work is aimed at researchers studying how transformers use context and how information moves through attention layers. It is a theory-first result about autoregressive pre-LN softmax transformers in general; the source names no specific models, model sizes, datasets or context lengths.
How to use it
No practical implications (for prompting, safety or long-context use) are stated. What the paper offers is a framework: the exponent α as a measure of how long a model remembers its prompt, the bound O(P (log t)^{L-1} / t) as a reference, and a logit-bias intervention that cancels dilution and can be used to test whether dilution drives forgetting.
How solid is it
The central bound is a proof, not only an empirical fit, and the authors back it with an exactly solvable linear relay model that shows the bound cannot be improved. The measured exponents are given as approximate ranges, and the source gives no per-model values or uncertainty. The logit-bias experiment is reported as showing dilution is necessary for the forgetting measured, with untrained networks and the solvable model showing it is also sufficient. The page is a preprint abstract on Hugging Face Papers, and the abstract names no authors or institutions.
Risks and caveats
The theorem is conditional. It covers finite-depth pre-LN softmax transformers with bounded attention logits, and it needs the pre-norm activations to stay away from zero. The abstract does not say that the theorem applies to non-pre-LN architectures, unbounded attention logits, or cases where pre-norm activations approach zero. The result is an upper bound on the offset, and the measured exponents come as approximate ranges without effect sizes for the logit-bias experiment.
“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”
— Paper abstract, Hugging Face Papers