arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2507.21285cs.AI
收藏

Curiosity by Design:一种会提出澄清问题的基于大语言模型的编程助手

Curiosity by Design: An LLM-based Coding Assistant Asking Clarification Questions

University of Alberta(阿尔伯塔大学)

Harsh Darji, Thibaud Lutellier

AI总结:

针对开发者提示模糊导致LLM编程助手生成错误代码的问题,研究构建了含查询分类器和微调LLM的端到端系统,可主动提出澄清问题,其效果优于零样本提示和基线模型。

摘要:

大语言模型(LLM)正被越来越多地用作编程助手。然而,开发者提示词的模糊性往往会导致代码生成错误,因为当前模型在没有大量提示工程或外部上下文的情况下,很难推断用户意图。本研究旨在构建一种基于LLM的编程助手,它模仿人类代码审查流程,在遇到模糊或规格说明不足的查询时会提出澄清问题。\n我们的端到端系统包含两个部分:(1)一个经过训练的查询分类器,用于检测不清晰的编程相关查询;(2)一个经过微调的LLM,用于生成澄清问题。我们的评估表明,在生成有用的澄清问题方面,经过微调的LLM表现优于标准的零样本提示方法。此外,我们的用户研究显示,用户认为我们的模型生成的澄清问题优于基线模型,证明我们的编程助手相比基线编程助手能生成更准确、更有帮助的代码响应。

英文摘要:

Large Language Models (LLMs) are increasingly used as coding assistants. However, the ambiguity of the developer's prompt often leads to incorrect code generation, as current models struggle to infer user intent without extensive prompt engineering or external context. This work aims to build an LLM-based coding assistant that mimics the human code review process by asking clarification questions when faced with ambiguous or under-specified queries. Our end-to-end system includes (1) a query classifier trained to detect unclear programming-related queries and (2) a fine-tuned LLM that generates clarification questions. Our evaluation shows that the fine-tuned LLM outperforms standard zero-shot prompting in generating useful clarification questions. Furthermore, our user study indicates that users find the clarification questions generated by our model to outperform the baseline, demonstrating that our coding assistant produces more accurate and helpful code responses compared to baseline coding assistants.

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

↑