Understanding and Mitigating Numerical Sources of Nondeterminism in LLM Inference
Jiayi Yuan, Hao Li, Xinheng Ding, Wenya Xie, Yu-Jhe Li, Wentian Zhao, Kun Wan, Jing Shi, Xia Hu, Zirui Liu
Abstract
Large Language Models (LLMs) are now integral across various domains and have demonstrated impressive performance. Progress, however, rests on the premise that benchmark scores are both accurate and reproducible. We demonstrate that the reproducibility of LLM performance is fragile: changing system configuration, such as evaluation batch size, GPU count, and GPU version, can introduce significant differences in the generated responses. This issue is especially pronounced in reasoning models, where minor rounding differences in early tokens can cascade into divergent chains of thought, ultimately affecting accuracy. For instance, under bfloat16 precision with greedy decoding, a reasoning model like DeepSeek-R1-Distill-Qwen-7B can exhibit up to 9% variation in accuracy and 9,000 tokens difference in response length due to differences in GPU count, type, and evaluation batch size. We trace the root cause of this variability to the non-associative nature of floating-point arithmetic under limited numerical precision. This work presents the first systematic investigation into how numerical precision affects reproducibility in LLM inference. Through carefully controlled experiments across various hardware, software, and precision settings, we quantify when and how model outputs diverge. Our analysis reveals that floating-point precision - while critical for reproducibility - is often neglected in evaluation practices. Inspired by this, we develop a lightweight inference pipeline, dubbed LayerCast, that stores weights in 16-bit precision but performs all computations in FP32, balancing memory efficiency with numerical stability. Code is available at https://github.com/nanomaoli/llm_reproducibility.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext b275f6c1-962a-427d-9cba-280bc25d1730Cited by top-tier papers6
- Deterministic Inference across Tensor Parallel Sizes That Eliminates Training-Inference MismatchZiyang Zhang, Xinheng Ding, Jiayi Yuan, Rixin Liu et al.ICML 2026 · 13 citations
- When LLMs get significantly worse: A statistical approach to detect model degradationsJonas M. Kübler, Kailash Budhathoki, Matthäus Kleindessner, Xiong Zhou et al.ICLR 2026 · 6 citations
- Synchronizing Probabilities in Model-Driven Lossless CompressionAviv Adler, Jennifer TangICLR 2026 · 1 citation
- LLM-42: Enabling Determinism in LLM Inference with Verified SpeculationRaja Gond, Aditya K Kamath, Ramachandran Ramjee, Ashish PanwarSOSP 2026
- Evolving Quantitative Reasoning through Self-Play in Digital Twin MarketsTianmi Ma, Wenxin Huang, Jiawei Du, Lin Li et al.ICML 2026
Builds on4
- Is Your Code Generated by ChatGPT Really Correct? Rigorous Evaluation of Large Language Models for Code GenerationJiawei Liu, Chunqiu Steven Xia, Yuyao Wang, Lingming ZhangNeurIPS 2023 · 2,317 citations
- Efficient Memory Management for Large Language Model Serving with PagedAttentionWoosuk Kwon, Zhuohan Li, Siyuan Zhuang, Ying Sheng et al.SOSP 2023 · 1,016 citations
- Orca: A Distributed Serving System for Transformer-Based Generative ModelsGyeong-In Yu, Joo Seong Jeong, Geon-Woo Kim, Soojeong Kim et al.OSDI 2022 · 690 citations
- Nondeterminism and Instability in Neural Network OptimizationCecilia Summers, Michael J. DinneenICML 2021 · 55 citations
Related papers
- Has the Two-Decade-Old Prophecy Come True? Artificial Bad Intelligence Triggered by Merely a Single-Bit Flip in Large Language ModelsYu Yan, Siqi Lu, Yang Gao, Zhaoxuan Li et al.WWW 2026 · 1 citation
- PASCAL: A Phase-Aware Scheduling Algorithm for Serving Reasoning-based Large Language ModelsEunyeong Cho, Jehyeon Bang, Ranggi Hwang, Minsoo RhuHPCA 2026
- R2R: Efficiently Navigating Divergent Reasoning Paths with Small-Large Model Token RoutingTianyu Fu, Yi Ge, Yichen You, Enshu Liu et al.NeurIPS 2025 · 32 citations
- Dissecting Failure Dynamics in Large Language Model ReasoningWei Zhu, Jian Zhang, Lixing Yu, Kun Yue et al.ACL 2026 · 2 citations
- TokenSqueeze: Performance-Preserving Compression for Reasoning LLMsYuxiang Zhang, Zhengxu Yu, Weihang Pan, Zhongming Jin et al.NeurIPS 2025 · 6 citations
