Greedy Decoding Is Not Precision-Invariant: Cross-Precision Output Divergence in LLM Inference
作者: Gaoyuan Du, Anam Nawaz Khan, Rex Zhou, Xiaoyang Liu, Deepayan Chakrabarti, Fnu Suya, Xueping Li
分类: cs.LG, cs.AI
发布日期: 2026-09-22
备注: Accepted by Transactions on Machine Learning Research (TMLR), 2026
期刊: Transactions on Machine Learning Research, 2026
💡 一句话要点
提出精确度不变性分析以解决大语言模型推理中的输出差异问题
🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)
关键词: 大语言模型 贪婪解码 精确度不变性 误差传播 FP32重计算 自然语言处理 输出一致性
📋 核心要点
- 现有的贪婪解码方法被视为确定性的,但在不同精度下输出却存在显著差异,影响模型的可靠性。
- 论文提出了一种经验误差传播分析,揭示了输出差异的根本原因,并提出选择性FP32重计算的方法以改善一致性。
- 实验结果表明,所提方法在低延迟推理中显著提高了输出一致性,尤其在小批量推理时效果显著。
📝 摘要(中文)
本研究揭示了大语言模型的贪婪解码并非精确度不变,尽管在相同硬件上使用相同模型、提示和解码算法,BF16与FP16的输出却存在显著差异。通过对六个模型的评估,发现49-100%的提示存在输出差异,且单个标记的变化可能导致整个推理轨迹的偏差。研究提出了一种经验误差传播分析,并验证了五个可测试的预测,最终提出了一种选择性FP32 LM头重计算的方法,显著提高了模型输出的一致性。
🔬 方法详解
问题定义:本研究旨在解决大语言模型推理中贪婪解码的输出不一致性问题,现有方法未能考虑不同数值精度对输出的影响,导致在相同条件下输出结果不稳定。
核心思路:通过分析误差传播,论文提出了选择性FP32重计算的策略,以在特定条件下改善模型输出的一致性,尤其是在精度较低时。
技术框架:研究首先对六个不同参数规模的模型进行评估,分析其在不同精度下的输出差异,随后提出基于输出边际的重计算策略,并进行实验验证。
关键创新:论文的主要创新在于揭示了贪婪解码的精确度不变性问题,并提出了基于误差传播的干预策略,与传统方法相比,提供了一种新的思路来提高模型输出的一致性。
关键设计:在实验中,选择性FP32重计算的触发条件是基于输出的边际值,当边际低于某一阈值时进行重计算,确保在低延迟下仍能获得较高的一致性。
🖼️ 关键图片
📊 实验亮点
实验结果显示,所提选择性FP32重计算方法在A10G上实现了22-36个百分点的精确一致性提升,在L4和A100上分别提升12-21个百分点,且在低批量推理中延迟增加不足4%。所有实验结果均与五个预测一致,验证了方法的有效性。
🎯 应用场景
该研究的成果可广泛应用于自然语言处理领域,尤其是在需要高一致性输出的任务中,如对话系统、文本生成和机器翻译等。通过提高模型在不同精度下的稳定性,能够增强用户体验和系统的可靠性,未来可能推动更高效的推理技术发展。
📄 摘要(原文)
Greedy decoding from large language models is commonly treated as deterministic. We show it is not precision-invariant: the same model, prompt, and decoding algorithm produce different outputs in BF16 versus FP16 on identical hardware. Across our evaluations of six models (1.1B-7B parameters, four families; divergence additionally characterised at 12B) and three benchmarks, 49-100\% of prompts diverge; a single token flip often cascades into trajectory-level divergence. We develop an empirical error-propagation analysis and find that 22 layers of accumulated body error do not distinguish flipping from non-flipping steps; the outcome depends primarily on the top-two logit margin at the LM head relative to the directional perturbation between the top-two candidates. The analysis makes five testable predictions about intervention outcomes, including that applying more FP32 compute (broader scope) makes agreement worse. The experiments match all five predictions. The best-performing low-overhead intervention we evaluate, selective FP32 LM head recomputation, triggered only when the margin falls below a threshold, delivers +22-36 pp exact agreement on A10G (+12-21 pp on L4 and A100) at less than 4\% latency overhead in low-batch (batch size <=4) single-stream inference. We map the applicability boundary across six models and four batch sizes, and hypothesise that training-time precision stability is a determining factor. The method is a partial mitigation rather than a universal determinism guarantee: its benefit vanishes when body-originated error dominates, including at batch size >=8 and under end-to-end FP8 in our tests.