arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2510.26788cs.LGcs.AIcs.CL
收藏

通过FP16克服训练-推理不匹配

Defeating the Training-Inference Mismatch via FP16

Sea AI Lab;National University of Singapore(新加坡国立大学)

Penghui Qi, Zichen Liu, Xiangxin Zhou, Tianyu Pang, Chao Du, Wee Sun Lee, Min Lin

摘要:

大语言模型(LLM)的强化学习(RL)微调经常由于训练和推理策略之间的数值失配而遭受不稳定性。虽然先前的工作试图通过算法校正或工程对齐来缓解这个问题,但我们发现其根本原因在于浮点精度本身。广泛采用的BF 16尽管动态范围很大,但会引入较大的舍入误差,从而破坏训练和推理之间的一致性。在这项工作中,我们证明,简单地恢复到\textbf{FP16}有效地消除了这种不匹配。这种变化很简单,只需要几行代码的更改就可以得到现代框架的完全支持,并且不需要修改模型架构或学习算法。我们的研究结果表明,统一使用FP 16可以在不同的任务、算法和框架中产生更稳定的优化、更快的收敛和更强的性能。我们希望这些发现能够激发人们对RL微调中精度权衡的更广泛的重新考虑。

英文摘要:

Reinforcement learning (RL) fine-tuning of large language models (LLMs) often suffers from instability due to the numerical mismatch between the training and inference policies. While prior work has attempted to mitigate this issue through algorithmic corrections or engineering alignments, we show that its root cause lies in the floating point precision itself. The widely adopted BF16, despite its large dynamic range, introduces large rounding errors that breaks the consistency between training and inference. In this work, we demonstrate that simply reverting to \textbf{FP16} effectively eliminates this mismatch. The change is simple, fully supported by modern frameworks with only a few lines of code change, and requires no modification to the model architecture or learning algorithm. Our results suggest that using FP16 uniformly yields more stable optimization, faster convergence, and stronger performance across diverse tasks, algorithms and frameworks. We hope these findings motivate a broader reconsideration of precision trade-offs in RL fine-tuning.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑