A Conditional No-Hair Theorem for Transformers: How Language Models Forget Their Prompt
Shuyang Xiang
原文摘要
A black hole retains only a few conserved charges of the matter it formed from. We are inspired to make the analogy and we ask how much an autoregressive transformer retains of its prompt after generating $t$ tokens. For two prompts followed by the same continuation, the difference of their hidden states decays approximately as a power law $t^{-α}$, where $α=1$ is the rate at which a fixed prompt's share of uniform attention shrinks. Beyond the first layers, trained models forget faster ($α\approx0.55$--$0.7$) than untrained ones of the same architecture ($α\approx0.2$--$0.5$). For finite-depth pre-LN softmax transformers with bounded attention logits and non-degenerate pre-norm activations, we prove that this offset is $O\big(P(\log t)^{L-1}/t\big)$ for prompt length $P$ and depth $L$: the prompt's direct influence is diluted as the context grows, and \emph{relay} through continuation tokens adds only logarithmic factors. Conditional on the generated text, the prompt's influence on the next token thus vanishes. The bound fixes only the asymptotic shape and is uninformative at the lengths we measure in trained networks; an exactly solvable linear relay model shows that it cannot be improved and accounts for the untrained curves. Cancelling the dilution with a logit bias on the prompt stops the decay early in training, and training suppresses relay by about one billion tokens, before attention sinks form. A toolkit that measures $α$ for any Hugging Face causal language model is publicly available.
cs.AI