A model of errors in transformers
Suvrat Raju, Praneeth Netrapalli
TL;DR
This work addresses why LLMs err on deterministic, repetitive-token tasks by proposing an effective two-parameter error model inspired by an effective-field-theory perspective. The model reduces to a compact form with two parameters, $r$ and $q$, yielding an explicit accuracy expression $a = \frac{1}{\Gamma\left(\frac{q}{2}\right)} \gamma\left(\frac{q}{2}, \frac{q}{2 r c^{2 \alpha}}\right)$ with $\alpha=1$ and a clear interpretation of error directions. Empirical validation across eight tasks and three models shows strong agreement with the predicted curve in most cases, with a notable outlier attributed to algorithmic inconsistency that can be mitigated by forcing a specific algorithm or via prompt design. The results imply that LLM errors on long, repetitive tasks can be understood as accumulation of small attention-noise effects rather than intrinsic failures of reasoning, guiding both prompt engineering and future architectural improvements.
Abstract
We study the error rate of LLMs on tasks like arithmetic that require a deterministic output, and repetitive processing of tokens drawn from a small set of alternatives. We argue that incorrect predictions arise when small errors in the attention mechanism accumulate to cross a threshold, and use this insight to derive a quantitative two-parameter relationship between the accuracy and the complexity of the task. The two parameters vary with the prompt and the model; they can be interpreted in terms of an elementary noise rate, and the number of plausible erroneous tokens that can be predicted. Our analysis is inspired by an ``effective field theory'' perspective: the LLM's many raw parameters can be reorganized into just two parameters that govern the error rate. We perform extensive empirical tests, using Gemini 2.5 Flash, Gemini 2.5 Pro and DeepSeek R1, and find excellent agreement between the predicted and observed accuracy for a variety of tasks, although we also identify deviations in some cases. Our model provides an alternative to suggestions that errors made by LLMs on long repetitive tasks indicate the ``collapse of reasoning'', or an inability to express ``compositional'' functions. Finally, we show how to construct prompts to reduce the error rate.
