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

DecompRL: 通过学习模块化代码生成解决更难的问题

DecompRL: Solving Harder Problems by Learning Modular Code Generation

FAIR at Meta;Inria, \'Ecole Normale Sup\'erieure

Juliette Decugis, Fabian Gloeckle, Francis Bach, Taco Cohen, Gabriel Synnaeve

AI总结:

提出DecompRL算法,通过强化学习将问题分解为可复用的子函数,重组模块生成候选解,将GPU瓶颈转移至CPU评估,在LiveCodeBench和CodeContests上超越标准RL基线。

摘要:

大型语言模型(LLMs)如何解决它们目前无法解决的问题?重复采样扩展了测试时计算,但GPU成本随尝试次数线性增长,而具有可验证奖励的强化学习(RL)提高了单次尝试的准确性,但牺牲了样本多样性。当基础策略产生正确解的概率接近零时,这两种策略最终都会失败:没有多少采样或梯度信号能够克服过大的搜索空间。我们采取不同的方法:不是更努力地采样,而是通过将问题分解为更小、可独立求解的子函数(其实现可以重新组合)来使任务更容易。由于现成的模型没有针对这种模块化生成进行训练,我们引入了DecompRL,一种明确学习分解和实现分层代码结构的RL算法。重组$n$个模块的$k$个实现可产生多达$k^{n}$个候选解,将瓶颈从GPU推理转移到廉价的CPU评估,并将GPU令牌成本降低约50倍。在LiveCodeBench和CodeContests(Qwen~2.5~7B,Code World Model~32B)上,DecompRL在每问题超过$10^5$个令牌时优于标准和多样性优化的RL基线,解决了标准生成无法达到的问题。

英文摘要:

How can Large Language Models (LLMs) solve problems they currently cannot? Repeated sampling scales test-time compute but GPU cost grows linearly with attempts, while reinforcement learning (RL) with verifiable rewards improves single-attempt accuracy at the expense of sample diversity. Both strategies ultimately fail when the base policy has near-zero probability of producing a correct solution: no amount of sampling or gradient signal can overcome a search space that is simply too large. We take a different approach: rather than sampling harder, we make the task easier by decomposing problems into smaller, independently solvable sub-functions whose implementations can be recombined. Since off-the-shelf models are not trained for this modular generation, we introduce DecompRL, an RL algorithm that explicitly learns to decompose and implement hierarchical code structures. Recombining $k$ implementations of $n$ modules yields up to $k^{n}$ candidate solutions, shifting the bottleneck from GPU inference to cheap CPU evaluation and cutting GPU token cost by $\sim$50$\times$. On LiveCodeBench and CodeContests (Qwen~2.5~7B, Code World Model~32B), DecompRL outperforms standard and diversity-optimized RL baselines beyond $10^5$ tokens per problem, solving problems that standard generation cannot reach.

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

↑