arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2311.00272cs.SEcs.AI
收藏

ChatCoder:基于对话的需求细化提升大语言模型的代码生成能力

ChatCoder: Chat-based Refine Requirement Improves LLMs' Code Generation

Key Lab of HCST (PKU), MOE(高可信软件技术教育部重点实验室(北京大学);北京大学计算机学院);SCS

Zejun Wang, Jia Li, Ge Li, Zhi Jin

AI总结:

ChatCoder通过大语言模型与用户对话引导需求细化,使其更精确、无歧义且完整,从而显著提升代码生成性能,优于现有细化方法和人类反馈微调模型。

摘要:

大语言模型在生成满足人类需求的代码方面表现出良好性能。然而,人类用自然语言表达的需求可能模糊、不完整且存在歧义,导致大语言模型误解人类需求并产生错误。更糟糕的是,人类用户很难自行细化需求。为了帮助人类用户细化需求并提升大语言模型的代码生成性能,我们提出ChatCoder:一种通过与大语言模型对话来细化需求的方法。我们设计了一种对话方案,在该方案中,大语言模型将引导人类用户将需求表达细化得比之前更加精确、无歧义且完整。实验表明,ChatCoder大幅提升了现有大语言模型的性能。此外,与基于细化的方法以及通过人类反馈微调的大语言模型相比,ChatCoder具有优势。

英文摘要:

Large language models have shown good performances in generating code to meet human requirements. However, human requirements expressed in natural languages can be vague, incomplete, and ambiguous, leading large language models to misunderstand human requirements and make mistakes. Worse, it is difficult for a human user to refine the requirement. To help human users refine their requirements and improve large language models' code generation performances, we propose ChatCoder: a method to refine the requirements via chatting with large language models. We design a chat scheme in which the large language models will guide the human users to refine their expression of requirements to be more precise, unambiguous, and complete than before. Experiments show that ChatCoder has improved existing large language models' performance by a large margin. Besides, ChatCoder has the advantage over refine-based methods and LLMs fine-tuned via human response.

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

↑