arXiv(opens in a new tab)cs.LGOct 2026Cited by 1 paper on PaperVantage

Manuscript Offprint

arXiv:2610.32951

Where Rounding Happens Matters: Rounding-Location Alignment Stabilizes LLM Reinforcement Learning

Yijing Ke, Tianle Cai, Ruosong Wang

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Reinforcement learning for large language models often uses separate systems for inference and training. Even with identical weights and BF16 tensors, implementation differences can make an intended on-policy update off-policy and destabilize training. Existing remedies align the entire inference and training stacks, change global precision, or modify the learning algorithm. We ask whether aligning selected parts of the execution stack can stabilize BF16 RL while other implementation differences remain. We align training-side rounding locations with inference in three regions—RoPE, SwiGLU, and residual RMSNorm—by retaining selected intermediates in FP32 until their BF16 outputs. Across four Qwen-family models, aligning all three regions prevents the collapse observed under the default BF16 baseline; RoPE-path alignment alone also suffices in the studied runs, despite remaining numerical discrepancies. The interventions keep the inference engine, matrix-multiplication and attention kernels, and learning objective unchanged.

Date: October 26, 2026

Correspondence: Tianle Cai at caitianle@bytedance.com and Ruosong Wang at ruosongwang@pku.edu.cn

1 Introduction

Reinforcement learning (RL) has become a central method for post-training large language models (LLMs), improving mathematical reasoning, code generation, and search-assisted problem solving [5,10,25][5, 10, 25]. Maintaining stable optimization remains difficult, however, and model performance can collapse during training [37,42][37, 42]. Training–inference mismatch is one source of this instability [36,43][36, 43].

Many RL systems use an inference engine such as vLLM to generate responses and a separate implementation, such as Hugging Face Transformers, to recompute their probabilities for training [14,32][14, 32]. Even with the same checkpoint and nominal data type, implementation differences can make the recomputed probabilities disagree with those of the policy that generated the responses. This discrepancy turns an intended on-policy update off-policy and can destabilize training [22,36,43][22, 36, 43].

Prior studies stabilize training under this mismatch through global precision changes [22][22] or algorithmic corrections [36,43][36, 43]. Another approach seeks exact numerical agreement by aligning arithmetic and reduction order across engines [6,40][6, 40], including the precision of intermediate computations in RoPE and SwiGLU [20][20]. We ask whether aligning only selected parts of the execution stack can stabilize BF16 RL while retaining the learning objective and allowing other implementation differences to remain.

A compiled/eager comparison motivates this question. Both compiled and eager execution support stable training when inference and training use aligned modes; the two crossed conditions collapse. This observation directs attention to agreement between the engines and motivates inspecting the numerical changes introduced by fusion. Separate kernels store some intermediates in BF16, whereas a fused kernel can retain them in FP32 until its output. We call this difference in where values are rounded a rounding-location mismatch.

Guided by graph inspection, we align training-side rounding locations with those in inference in three regions: the RoPE path [28], SwiGLU [27], and residual RMSNorm [38]. We retain selected training intermediates in FP32 and round each region's outputs to BF16, preserving BF16 model weights, the inference engine, matrix-multiplication and attention kernels, and learning objective.

Contribution. We show that selective rounding-location alignment can stabilize BF16 LLM RL without full-stack numerical agreement or additional mismatch corrections in the learning objective. Across four Qwen-family models, aligning all three regions prevents the collapse observed under the default BF16 baseline despite numerical disagreement; RoPE-path alignment alone also suffices in every studied run. These results establish selective alignment as a practical route to stable training in the studied settings.

References (38)