Autoregressive Decoding as a Martingale: Characterizing the Stochastic Dynamics of LLM Generation
Not on the map. Why?
Abstract (arXiv)
Large language models (LLMs) have achieved remarkable success across a wide range of language tasks. At their core, autoregressive LLMs are conditional probability models that learn to approximate the next-token distribution given the preceding context. Despite this probabilistic nature, the stochastic dynamics of autoregressive decoding have rarely been investigated from a rigorous probabilistic perspective. In this work, we define the per-step prediction error as the difference between the sampled token indicator and the model's conditional predictive distribution, and prove that the cumulative error process is a martingale with respect to the decoding filtration, implying that its conditional first-order moment is identically zero. Beyond this first-order property, we derive a closed-form expression for the second-order behavior of the martingale sequence: its predictable quadratic variation reduces to sumtleft(1-p(ytmid y<t)right), computable from realized token probabilities alone. This identity establishes a direct theoretical connection between sequence fluctuations and predictive uncertainty during autoregressive decoding. White-box experiments on Llama-3.x and Qwen2.5 families (1B to 72B parameters) verify that the empirically measured second-order moments closely match the theoretical predictions derived from our martingale analysis. These results provide a probabilistic framework for analyzing autoregressive LLM decoding, reveal intrinsic probabilistic fingerprints of different language models, and establish a rigorous mathematical foundation for LLM-generated text detection and uncertainty quantification.
Key facts. No citing papers in the map yet (data through 26 Nov 2026). Builds on 18 of its 29 references that are in the map. Submitted 12 Oct 2026.
Builds on
18 of 29 references.
References · 18
- 2022Training language models to follow instructions with human feedbackcited by 16,493
- 2023LLaMA: Open and Efficient Foundation Language Modelscited by 14,772
- 2020Score-Based Generative Modeling through Stochastic Differential Equationscited by 9,588
- 2017On Calibration of Modern Neural Networkscited by 5,356
- 2015Dropout as a Bayesian Approximation: Representing Model Uncertainty in Deep Learningcited by 4,568
- 2019The Curious Case of Neural Text Degenerationcited by 3,022
- 2022Locating and Editing Factual Associations in GPTcited by 2,951
- 2022Language Models (Mostly) Know What They Knowcited by 2,078
- 2022Fast Inference from Transformers via Speculative Decodingcited by 1,853
- 2022Interpretability in the Wild: a Circuit for Indirect Object Identification in GPT-2 smallcited by 1,270
- 2018Hierarchical Neural Story Generationcited by 1,221
- 2022In-context Learning and Induction Headscited by 1,085
6 more
- 2022Diffusion-LM Improves Controllable Text Generationcited by 1,073
- 2022Teaching Models to Express Their Uncertainty in Wordscited by 814
- 2023DetectGPT: Zero-Shot Machine-Generated Text Detection using Probability Curvaturecited by 759
- 2020How Can We Know When Language Models Know? On the Calibration of Language Models for Question Answeringcited by 464
- 2020Calibration of Pre-trained Transformerscited by 335
- 2020If beam search is the answer, what was the question?cited by 118
Built on by
Not cited yet.