cs.LGOct 29, 2026

bf16 Rounding Silently Discards Most RL Policy Updates: A Hidden Training-Inference Mismatch and an Unbiased One-Line Fix

Authors: Andrew Gao, William Gao

Organizations: Stanford University

Abstract

Reinforcement learning (RL) post-training of language models keeps fp32 master weights in the optimizer and serves rollouts from a bf16 copy produced by round-to-nearest conversion. At the learning rates in common use, most per-step updates are smaller than half a bf16 spacing and the conversion discards them: on Qwen3-1.7B only 0.4-0.5% of served weights change per step, and the policy that generates the training data lags the optimizer by 50-150 steps. Existing mismatch corrections cannot see this lag because they compare two copies downstream of the same rounding. We propose Fair Cast: export the master with an unbiased rounding rule (stochastic rounding or error feedback) and compute the training loss on the served copy. The change is one line at the export call, adds no hyperparameters and costs 22-38 ms per export of 1.7B parameters. Across 25 matched seed-pairs on Qwen3-0.6B to 4B with AdamW and Muon, Fair Cast is ahead on 18, tied on 6 and behind on 1, with a mean gain of 6.1 points; on zebra puzzles it reaches 0.57 +/- 0.16 over four runs where round-to-nearest collapses to 0.33 +/- 0.10. It also makes the saved fp32 checkpoint agree with the served model, and it exposes the implicit lag of round-to-nearest as a regularizer that can be restored explicitly when a task needs it.

Figures & tables

Appendix figures & tables1 asset

Supplementary material from the paper’s appendix.

Appendix

Explore similar work

Oct 23, 2026

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

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.
Nov 10, 2026

Closing the BF16-FP16 Convergence Speed Gap in RL Post-Training with Stochastic Rounding

BF16 is widely used to pretrain large language models because it has the same dynamic range as FP32 and converges similarly to FP32 training. However, in reinforcement learning with verifiable rewards, where learning rates are typically low, we find that standard mixed-precision BF16 training converges more slowly than FP16 training at the same learning rate. We attribute this gap to weight sticking: when FP32 shadow weights are quantized to BF16 using round-to-nearest, small updates often leave the BF16 weights used for rollout generation and training unchanged. Consequently, several optimizer steps may be needed before updates to the shadow weights are reflected in the BF16 weights. Raising the BF16 learning rate reduces weight sticking and matches FP16's convergence speed, but it also increases the KL divergence from the reference model. We instead apply stochastic rounding when quantizing the FP32 shadow weights to BF16. This approach matches FP16's convergence speed across different models and datasets while reducing the KL divergence relative to BF16 training with a larger learning rate. Unlike FP16, it keeps BF16's wider dynamic range and needs no loss scaling.
Oct 6, 2026

Lost in the bf16 Cast: Exporting Ternary Language Models Can Revert Most Low-Learning-Rate Code Changes

Ternary language models such as BitNet b1.58, Falcon-E and BitCPM are fine-tuned through higher-precision latents and deployed as ternary codes by an export that, in the labs' documented pipelines, first casts latents to bf16. We audit releases from three labs. In released checkpoints, fp32 quantization of the shipped latents disagrees with deployed codes on 0.83-1.77% of codes (Falcon-E, BitCPM) and 1.530% (2B-4T); most Falcon-E and BitCPM disagreements are bf16 products exactly on the threshold, which ties-to-even maps to zero, and the unmodified onebitllms exporter reproduces all four Falcon-E releases byte for byte. At fine-tuned endpoints with ULP-matched rates, the documented export lowers greedy GSM8K strict accuracy from 58.79% to 0.78% (Falcon-E-1B-Base) and 36.13% to 0.39% (BitCPM-CANN-0.5B), and a bf16 save and reload lowers 2B-4T's by 27.54 points while its last-number accuracy rises at that endpoint. The strict decrease recurs at each of three new seeds in all three models and has the same direction on 607 reserve test rows, but it is recipe-dependent: at Falcon-E's online-loss-selected rate the export was non-inferior, and after a longer recipe no difference was detected. Two remedies, writing the trained codes directly or adjusting bf16 inputs so unchanged tools emit them, met an inherited 4-point strict-accuracy non-inferiority criterion in all three models, also for the pooled mean over three fixed new trajectories per model and, separately, on the reserve rows. In a frozen study of bf16 latents in fine-tuning (one task, one trajectory per arm), native bf16 writes left 2B-4T's endpoint codes unchanged and changed one Falcon-E code; emulated stochastic-rounding and compensated writers changed codes and were non-inferior to fp32 training at that margin. In two model families, randomized threshold-distance interventions support distance-dependent selection of changed codes.