DecompRL: Solving Harder Problems by Learning Modular Code Generation
作者: Juliette Decugis, Fabian Gloeckle, Francis Bach, Taco Cohen, Gabriel Synnaeve
分类: cs.LG
发布日期: 2026-07-02
💡 一句话要点
提出DecompRL以解决复杂问题的模块化代码生成
🎯 匹配领域: 支柱二:RL算法与架构 (RL & Architecture) 支柱九:具身大模型 (Embodied Foundation Models)
关键词: 模块化生成 强化学习 代码生成 复杂问题解决 大型语言模型
📋 核心要点
- 现有方法在解决复杂问题时面临样本多样性和计算成本的双重挑战。
- 论文提出的DecompRL通过将问题分解为可独立解决的子功能,简化了任务并提高了生成效率。
- 实验结果表明,DecompRL在多个基准测试中显著超越了传统RL方法,解决了更复杂的问题。
📝 摘要(中文)
如何让大型语言模型(LLMs)解决当前无法解决的问题?重复采样虽然能提高测试时的准确性,但GPU成本随尝试次数线性增长。而强化学习(RL)虽然能提高单次尝试的准确性,却牺牲了样本多样性。当基础策略几乎没有产生正确解的概率时,采样或梯度信号都无法克服过大的搜索空间。我们提出了一种不同的方法:通过将问题分解为更小的、可以独立解决的子功能,从而简化任务。为此,我们引入了DecompRL,这是一种强化学习算法,专门学习分解和实现层次化代码结构。通过重组k个n个模块的实现,能够产生多达k^n个候选解,将瓶颈从GPU推向便宜的CPU评估,并将GPU的token成本降低约50倍。在LiveCodeBench和CodeContests上,DecompRL超越了标准和多样性优化的RL基线,解决了标准生成无法达到的问题。
🔬 方法详解
问题定义:本论文旨在解决大型语言模型在面对复杂问题时的性能瓶颈,尤其是当基础策略几乎没有产生正确解的概率时,现有的采样和强化学习方法均无法有效应对。
核心思路:论文的核心思路是通过将复杂问题分解为更小的、可独立解决的子功能,从而降低任务的复杂性。这种模块化的生成方式使得模型能够更高效地组合解决方案。
技术框架:DecompRL的整体架构包括问题分解、模块生成和组合评估三个主要阶段。首先,模型将输入问题分解为多个子任务,然后为每个子任务生成相应的代码模块,最后将这些模块组合成完整的解决方案。
关键创新:DecompRL的最大创新在于其模块化生成的能力,允许模型在解决问题时灵活组合不同的代码实现。这一方法与传统的单一生成策略有本质区别,能够显著提高解决复杂问题的能力。
关键设计:在设计上,DecompRL采用了特定的损失函数来优化模块的生成质量,并通过强化学习策略来指导模块的组合过程。模型的参数设置经过精心调整,以确保在生成过程中保持高效性和准确性。
🖼️ 关键图片
📊 实验亮点
实验结果显示,DecompRL在LiveCodeBench和CodeContests上超越了标准和多样性优化的RL基线,尤其在超过10^5个token的问题上表现出色,解决了传统生成方法无法达到的复杂问题,GPU token成本降低约50倍。
🎯 应用场景
DecompRL的研究成果在多个领域具有广泛的应用潜力,包括自动化编程、智能助手和教育技术等。通过提高代码生成的效率和准确性,该方法能够帮助开发者更快速地解决复杂问题,并推动编程教育的进步。未来,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.