在LLM的强化学习中永不放弃地学习解决难题
研究论文 · 2026/09/16
我们证明,用强化学习训练大语言模型时,性能提升在数据集上并不均衡。强化学习在模型已经擅长的简单问题上提升显著,但在困难问题上提升有限。我们称之为大语言模型强化学习中的马太效应,源自经济学和网络科学中“富者愈富”的累积优势现象。直观解释是困难问题需要更多计算才能找到解。我们认为,现代强化学习方法在简单问题上浪费了过多计算,反而加剧了这一问题,应当动态重新分配计算资源。我们提出“永不放弃”(NGU),一种简单的自适应采样方法,持续为一个问题生成样本,直到有一个正确为止。通过利用异步强化学习,这自然能用更少样本过滤掉简单问题,并将更多计算分配给解决更困难的问题。我们研究了影响NGU的设计选择,如离策略鲁棒性,并制定了一套最佳实践。在数学基准Deepscaler上,NGU提升了单位计算的性能,尤其是在更困难的问题上。在近期的编码任务Manufactoria上,标准GRPO配合逐测试奖励无法完全解决包含简单和困难测试的问题。NGU迭代改进,解决越来越难的测试,直到学会完全解决编码问题。
本文识别了RL训练LLM中的关键效率问题,并提出简单有效的解决方案,对提升困难任务性能有重要实践意义。
We demonstrate that training LLMs with RL does not improve performance equally across a dataset. RL shows large improvements on easy problems that an LLM is already good at solving, but small improvements on hard problems. We call this the Matthew Effect in RL for LLMs, after the phenomenon of cumulative advantage from economics and network science summarized as "the rich get richer". The naive explanation is that hard problems require more compute to find a solution. We argue that modern RL methods are exacerbating the issue by wasting too much compute on easy problems and instead should dynamically reallocate how they use compute. We introduce Never Give Up (NGU), a simple adaptive sampling method that keeps generating samples for a problem until one is correct. By leveraging asynchronous RL, this naturally uses fewer samples to filter out easy problems and allocates more compute to solving harder problems. We investigate the design choices that affect NGU, such as off-policy robustness, and develop a set of best practices. On the math benchmark Deepscaler, NGU improves performance per compute, especially on harder problems. On a recent coding task, Manufactoria, standard GRPO with a per-test reward fails to fully solve problems that have a range of easy and difficult tests. NGU iteratively improves, solving harder and harder tests, until it learns to fully solve coding problems.