Defeating the Training-Inference Mismatch via FP16

Penghui Qi, Zichen Liu, Xiangxin Zhou, Tianyu Pang, Chao Du +2 more
10/30/2025
cs.LGcs.AIcs.CL

No official code found. Best implementation: sail-sg/Precision-RL (197 stars, MIT, last commit 2025-11-14).

Abstract

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.

View on arXivView PDF

Code Implementations(1)

MIT

Defeating the Training-Inference Mismatch via FP16

19717Shell, PythonOct 30, 202511 months agoMIT

Similar Papers

Cite this paper

@article{qi2025defeating,
  title  = {Defeating the Training-Inference Mismatch via FP16},
  author = {Penghui Qi and Zichen Liu and Xiangxin Zhou and Tianyu Pang and Chao Du and Wee Sun Lee and Min Lin},
  year   = {2025},
  eprint = {2510.26788},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2510.26788v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2510.26788.svg)](https://codeofpaper.com/paper/2510.26788)

Discussion