arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2510.21830cs.LGcs.AI
收藏

GAPO:面向现实世界代码LLM的鲁棒优势估计

GAPO: Robust Advantage Estimation for Real-World Code LLMs

Shanghai Jiao Tong University(上海交通大学);Tencent(腾讯);Zhejiang University(浙江大学);Shenzhen University(深圳大学);Peking University(北京大学)

Jianqing Zhang, Zhezheng Hao, Wei Xia, Hande Dong, Hong Wang, Chenxing Wei, Yuyan Zhou, Yubin Qi, Qiang Lin, Jian Cao

AI总结:

GAPO通过自适应Q机制提升代码编辑LLM的鲁棒性,实现领域内和领域外精确匹配的显著提升。

摘要:

强化学习(RL)被广泛用于代码编辑后的大型语言模型(LLM)训练,其中群体相对方法,如GRPO,因其无需批评者和归一化优势估计而流行。然而,在现实世界代码编辑场景中,奖励分布通常呈偏态分布,伴有不可预测的噪声,导致优势计算失真和滚出异常值增加。为了解决这个问题,我们提出了群体自适应策略优化(GAPO),它自适应地找到每个提示具有最高信噪比(SNR)的区间,并使用该区间的中位数作为自适应Q,以取代优势计算中的群体均值,从而进一步减少噪声。这种自适应Q能够稳健地处理滚出噪声,同时保持即插即用和高效。我们评估GAPO在九个指令微调的LLM(3B-14B)上,使用了一个收集的51,844个现实世界、具有历史意识的代码编辑任务的大型数据集,涵盖10种编程语言。GAPO在领域内(ID)和领域外(OOD)精确匹配上分别比GRPO及其变种DAPO提高了4.35和5.30,同时实现了更低的截断比率和更高的GPU吞吐量。代码:https://github.com/TsingZ0/verl-GAPO。

英文摘要:

Reinforcement learning (RL) is widely used for post-training large language models (LLMs) in code editing, where group-relative methods, such as GRPO, are popular due to their critic-free and normalized advantage estimation. However, in real-world code-editing scenarios, reward distributions are often skewed with unpredictable noise, leading to distorted advantage computation and increased rollout outliers. To address this issue, we propose Group Adaptive Policy Optimization (GAPO), which adaptively finds an interval with the highest SNR (Signal to Noise Ratio) per prompt and uses the median of that interval as an adaptive Q to replace the group mean in advantage calculation to reduce noise further. This adaptive Q robustly handles rollout noise while remaining plug-and-play and efficient. We evaluate GAPO on nine instruction-tuned LLMs (3B-14B) using a collected large dataset of 51,844 real-world, history-aware code-editing tasks spanning 10 programming languages. GAPO yields up to 4.35 in-domain (ID) and 5.30 out-of-domain (OOD) exact-match improvements over GRPO and its variant DAPO, while achieving lower clipping ratios and higher GPU throughput. Code: https://github.com/TsingZ0/verl-GAPO.

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

↑