Large language models (LLMs) have significantly improved the ability to perform tasks in the field of code generation. However, there is still a gap between LLMs being capable coders and being top-tier software engineers. Based on the observation that top-level software engineers often ask clarifying questions to reduce ambiguity in both requirements and coding solutions, we argue that the same should be applied to LLMs for code generation tasks. By asking probing questions in various topics before generating the final code, the challenges of programming with LLMs, such as unclear intent specification, lack of computational thinking, and undesired code quality, may be alleviated. This, in turn, increases confidence in the generated code. In this work, we explore how to leverage better communication skills to achieve greater confidence in generated code. We propose a communication-centered process that uses an LLM-generated communicator to identify issues with high ambiguity or low confidence in problem descriptions and generated code. We then ask clarifying questions to obtain responses from users for refining the code.
翻译:大型语言模型显著提升了代码生成领域任务的执行能力。然而,在成为优秀编程者与顶尖软件工程师之间仍存在差距。基于顶尖软件工程师常通过提问澄清问题以减少需求与编码方案歧义的观察,我们认为大型语言模型在代码生成任务中也应遵循相同原则。通过在生成最终代码前就各类主题提出探究性问题,可缓解使用大型语言模型编程时面临的意图规范不明确、缺乏计算思维及代码质量欠佳等挑战,从而增强对生成代码的置信度。本研究探索如何通过提升沟通能力来获取对生成代码的更高置信度。我们提出以沟通为中心的处理流程:利用大语言模型生成的沟通者识别问题描述与生成代码中高歧义性或低置信度的环节,随后提出澄清性问题以获取用户反馈,进而优化代码。