随机舍入缩小RL后训练中BF16与FP16的收敛速度差距
Closing the BF16-FP16 Convergence Speed Gap in RL Post-Training with Stochastic Rounding
在可验证奖励的强化学习中,标准混合精度BF16训练在相同学习率下比FP16收敛更慢,原因是FP32影子权重按就近舍入量化为BF16时出现权重粘滞,小更新常无法反映到BF16权重上。将FP32影子权重量化到BF16时改用随机舍入,可在不同模型和数据集上匹配FP16的收敛速度,同时降低相对BF16大学习率训练的KL散度,并保留BF16更宽动态范围且无需loss scaling。
arXiv:2611.13545v1 Announce Type: new Abstract: 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.
来源:arXiv (AI + Vision + Imaging) · arxiv.org