arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2611.04320cs.AIcs.SE
收藏

基于大语言模型的代码生成中规划-编码分离的实证研究

Planning-Coding Separation in LLM-Based Code Generation: An Empirical Study

Peking University(北京大学);Institute of Software, Chinese Academy of Sciences(中国科学院软件研究所)

Wentao Wang, Zeyu Sun, Ruwei Pan, Yueyi Xiao, Qingyuan Liang, Lu Zhang

AI总结:

本文通过实证研究发现,基于LLM的代码生成中规划与编码可在较大程度上分离,不同规划器-编码器组合性能相当,强规划器搭配强编码器效果更优,编码器训练可提升组合性能。

摘要:

规划已被证实是提升大语言模型(LLM)代码生成能力的重要因素。然而,规划能力与编码能力之间的相互作用仍未得到充分探索,尤其是当这两种能力来自不同的LLM时。在本文中,我们针对基于LLM的代码生成中的规划-编码相互作用开展了首次全面的实证研究,其中规划与编码被分配给不同的LLM(即规划-编码分离)。具体而言,我们探索了不同的规划器-编码器组合,以研究编码器利用各类规划器提供的规划信息的有效性,以及编码器的进一步训练对规划器-编码器组合的影响。我们的结果表明,几乎所有规划器-编码器组合的性能都与使用同一LLM进行规划和编码的表现相当,且更强规划器与更强编码器的组合通常能实现更优的效果。此外,使用大型模型作为规划器、搭配小得多的模型作为编码器,有时其性能与使用该大型模型同时作为规划器和编码器的表现相当,而编码器的进一步训练通常能提升各类规划器-编码器组合的性能。这些发现提供了实证证据,表明在基于LLM的代码生成中,规划与编码可在相当大程度上分离,这可能为构建代码生成系统提供更灵活的方式。

英文摘要:

Planning has been identified as an important factor for improved code generation with Large Language Models (LLMs). However, the interaction between planning capability and coding capability remains largely underexplored, especially when the two capabilities are from different LLMs. In this paper, we conduct the first comprehensive empirical study of planning-coding interaction in LLM-based code generation, where planning and coding are assigned to different LLMs (i.e., planning-coding separation). Specifically, we explore different planner-coder combinations to investigate the effectiveness for coders to utilize planning information from various planners and the impact of further training of coders on planner-coder combinations. Our results demonstrate that almost all planner-coder combinations are as competitive as using the same LLM for planning and coding, and the combination of a stronger planner and a stronger coder typically achieves improved effectiveness. Furthermore, using a large model as the planner paired with a much smaller model as the coder can sometimes be as competitive as using the large model as both the planner and the coder, and further training of the coder can typically boost various planner-coder combinations. These findings provide empirical evidence that planning and coding can be separated to a considerable extent in LLM-based code generation, which may offer a more flexible way to construct code-generation systems.

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

↑