ChatPaper.aiChatPaper

ChatCoder:基於對話的需求細化改進了LLMs的程式碼生成

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

November 1, 2023
作者: Zejun Wang, Jia Li, Ge Li, Zhi Jin
cs.AI

摘要

大型語言模型在生成符合人類需求的程式碼方面表現出色。然而,用自然語言表達的人類需求可能模糊、不完整且含糊不清,這導致大型語言模型誤解人類需求並出現錯誤。更糟糕的是,人類用戶很難精煉需求。為了幫助人類用戶精煉其需求並提高大型語言模型的程式碼生成性能,我們提出了ChatCoder:通過與大型語言模型聊天來精煉需求的方法。我們設計了一種聊天方案,在這種方案中,大型語言模型將引導人類用戶精煉其需求的表達,使其比以前更加精確、明確和完整。實驗表明,ChatCoder大幅提高了現有大型語言模型的性能。此外,ChatCoder優於基於精煉的方法和通過人類回應進行微調的LLMs。
English
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.
PDF111December 15, 2024