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 toplevel software engineers often ask clarifying questions to reduce ambiguity in both requirements and coding solutions, I 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, I explore how to leverage better communication skills to achieve greater confidence in generated code. I 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. I then ask clarifying questions to obtain responses from users for refining the code.
翻译:大型语言模型(LLMs)显著提升了在代码生成领域的任务执行能力。然而,LLMs从具备基本编程能力的编码器成长为顶尖软件工程师之间仍存在差距。基于顶尖软件工程师常通过提出澄清性问题来减少需求与编码方案中的歧义这一观察,本文主张LLMs在代码生成任务中也应遵循这一原则。通过在生成最终代码前就不同主题提出探索性问题,可缓解使用LLMs进行编程时面临的挑战,例如意图说明不清晰、缺乏计算思维以及代码质量不理想等问题,从而提升对生成代码的置信度。本研究探讨如何通过优化沟通技巧来增强生成代码的置信度,提出了一种以沟通为中心的处理流程:利用LLM生成的通信器识别问题描述与生成代码中的高歧义或低置信度部分,随后提出澄清性问题以获取用户反馈,最终优化代码。