arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2506.09477cs.LG
收藏

关于强化学习中 KL 散度梯度估计的若干陷阱

On a few pitfalls in KL divergence gradient estimation for RL

Meta GenAI(Meta 生成人工智能);Meta FAIR

Yunhao Tang, Rémi Munos

AI总结:

本文指出 LLM 的 RL 训练中 KL 散度梯度估计的常见实现错误,分析将 KL 估计直接作为损失微分及忽视序列性导致的问题,并通过表格与 LLM 实验说明影响、给出正确实现。

摘要:

我们指出了在面向 LLM 的 RL 训练中实现 KL 散度梯度估计时存在的若干陷阱,这些问题可见于许多开源项目和论文。第一个主要陷阱是将 KL 估计作为损失函数进行微分,以最小化 KL 散度。我们表明,此类实现通常是不正确的,并且不会产生所需的 KL 梯度。其次,我们表明,一些实现没有考虑估计问题的序列性质,充其量只能产生部分梯度。我们通过说明性的表格实验和 LLM 实验展示了这些问题的影响,并给出了实现 KL 梯度的正确方法。

英文摘要:

We point out a few pitfalls in implementing gradient estimation for KL divergence in RL training for LLM, as seen in a number of open source projects and papers. The first major pitfall is to differentiate through the KL estimate as loss functions to minimize KL divergence. We show that such implementations are generally incorrect and do not produce the desired KL gradient. Secondly, we show that some implementations do not account for the sequential nature of the estimation problem and produce a partial gradient at best. We demonstrate the impact of such issues with illustrative tabular and LLM experiments, and show the correct way to implement the KL gradient.

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

↑