arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2312.15960cs.LGcs.PLcs.SE
收藏

MoTCoder:利用思维模块化提升大型语言模型应对挑战性编程任务的能力

MoTCoder: Elevating Large Language Models with Modular of Thought for Challenging Programming Tasks

Chinese University of Hong Kong (CUHK)(香港中文大学);SmartMore(智源)

Jingyao Li, Pengguang Chen, Bin Xia, Hong Xu, Jiaya Jia

AI总结:

提出MoTCoder框架通过MoT指令微调将编程任务分解为子模块,显著提升了代码的模块化、正确性和自我纠错能力,在APPS和CodeContests上分别取得5.9%和5.8%的pass@1提升。

摘要:

大型语言模型(LLMs)在处理简单编程任务时展现了令人印象深刻的能力。然而,当面对更具挑战性的编程问题时,其性能往往会下降。我们观察到,传统模型通常将解决方案生成为单体代码块,这限制了它们处理复杂问题的有效性。为了克服这一局限性,我们提出了思维模块化编码器(MoTCoder)。我们引入了一个MoT指令微调框架,旨在促进将任务分解为逻辑子任务和子模块。我们的研究表明,通过培育和利用子模块,MoTCoder显著提升了生成解决方案的模块化和正确性,在APPS上实现了5.9%的pass@1提升,在CodeContests上实现了5.8%的pass@1提升。MoTCoder在自我纠正能力方面也取得了显著改进,以3.3%的优势超越了当前SOTA。此外,我们分析了问题复杂度与最优模块分解之间的关系,并评估了可维护性指数,证实了MoTCoder生成的代码更易于理解和修改,这有利于长期的代码维护和演进。我们的代码可在https://github.com/dvlab-research/MoTCoder获取。

英文摘要:

Large Language Models (LLMs) have showcased impressive capabilities in handling straightforward programming tasks. However, their performance tends to falter when confronted with more challenging programming problems. We observe that conventional models often generate solutions as monolithic code blocks, restricting their effectiveness in tackling intricate questions. To overcome this limitation, we present Module-of-Thought Coder (MoTCoder). We introduce a framework for MoT instruction tuning, designed to promote the decomposition of tasks into logical sub-tasks and sub-modules. Our investigations reveal that, through the cultivation and utilization of sub-modules, MoTCoder significantly improves both the modularity and correctness of the generated solutions, leading to substantial pass@1 improvements of 5.9% on APPS and 5.8% on CodeContests. MoTCoder also achieved significant improvements in self-correction capabilities, surpassing the current SOTA by 3.3%. Additionally, we provide an analysis of between problem complexity and optimal module decomposition and evaluate the maintainability index, confirming that the code generated by MoTCoder is easier to understand and modify, which can be beneficial for long-term code maintenance and evolution. Our codes are available at https://github.com/dvlab-research/MoTCoder.

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

↑