DecompRL: Solving Harder Problems by Learning Modular Code Generation
作者: Juliette Decugis, Fabian Gloeckle, Francis Bach, Taco Cohen, Gabriel Synnaeve
分类: cs.LG
发布日期: 2026-07-05
💡 一句话要点
提出DecompRL以解决复杂问题的模块化代码生成
🎯 匹配领域: 支柱二:RL算法与架构 (RL & Architecture) 支柱九:具身大模型 (Embodied Foundation Models)
关键词: 模块化生成 强化学习 代码合成 大型语言模型 问题分解
📋 核心要点
- 现有方法在处理复杂问题时面临采样成本高和样本多样性不足的挑战,导致无法有效生成正确解决方案。
- 论文提出的DecompRL通过将问题分解为可独立解决的子功能,利用强化学习学习模块化代码生成,从而简化任务。
- 实验结果表明,DecompRL在LiveCodeBench和CodeContests上显著超越了标准RL基线,解决了更多复杂问题,提升效果明显。
📝 摘要(中文)
如何让大型语言模型(LLMs)解决当前无法解决的问题?重复采样虽然可以提高测试时的准确性,但GPU成本随尝试次数线性增长,而强化学习(RL)在提高单次尝试准确性的同时牺牲了样本多样性。当基础策略几乎没有产生正确解决方案的概率时,这两种策略都无法奏效。我们提出了一种不同的方法:通过将问题分解为更小的、可独立解决的子功能来简化任务,并引入DecompRL,一个明确学习分解和实现层次代码结构的RL算法。通过重组k个n个模块的实现,能够产生多达k^n个候选解决方案,将瓶颈从GPU推向廉价的CPU评估,并将GPU的token成本降低约50倍。在LiveCodeBench和CodeContests上,DecompRL在超过10^5个token的问题上超越了标准和多样性优化的RL基线,解决了标准生成无法达到的问题。
🔬 方法详解
问题定义:本论文旨在解决大型语言模型在面对复杂问题时的生成能力不足,现有方法在高维搜索空间中难以找到有效解决方案。
核心思路:通过将复杂问题分解为多个小的、可独立解决的子问题,DecompRL能够有效地学习和生成模块化代码,从而提高生成的准确性和多样性。
技术框架:DecompRL的整体架构包括问题分解模块、模块生成模块和组合评估模块。首先,输入问题被分解为多个子功能,然后为每个子功能生成实现,最后通过组合这些实现来生成候选解决方案。
关键创新:DecompRL的主要创新在于其模块化生成能力,能够在不依赖大量GPU资源的情况下,通过组合多个子功能的实现来生成高质量的解决方案,这与传统的单一生成方法有本质区别。
关键设计:在设计中,DecompRL采用了特定的损失函数来优化模块化生成的效果,并通过强化学习策略来调整模块的组合方式,以实现最佳的解决方案生成。
🖼️ 关键图片
📊 实验亮点
在实验中,DecompRL在LiveCodeBench和CodeContests上表现出色,超越了标准和多样性优化的RL基线,尤其是在超过10^5个token的问题上,显示出显著的性能提升,GPU token成本降低约50倍,展示了其在复杂问题解决中的优势。
🎯 应用场景
DecompRL的研究成果在多个领域具有潜在应用价值,包括自动代码生成、程序合成和智能编程助手等。通过模块化的方式,开发者可以更高效地解决复杂问题,提升软件开发的效率和质量。未来,该方法可能会推动更智能的编程工具和系统的出现,改变传统编程的方式。
📄 摘要(原文)
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.