面向检测提示知识缺口以改进LLM引导的问题解决
Towards Detecting Prompt Knowledge Gaps for Improved LLM-guided Issue Resolution
AI总结:
本研究分析433段开发者-ChatGPT对话,识别提示知识缺口(如缺失上下文)和对话风格对问题解决的影响,并提出具体性、上下文丰富性、清晰度等启发式规则及浏览器扩展原型,以动态检测并改进提示质量。
摘要:
大型语言模型(LLMs)已成为软件开发中不可或缺的工具,尤其是在问题解决方面。然而,尽管其应用广泛,LLM对问题解决查询的响应质量仍存在显著挑战。LLM交互常常产生不正确、不完整或模糊的信息,这主要归因于提示设计中的知识缺口,可能导致无效交流并降低开发者生产力。本文分析了GitHub问题线程中的433段开发者与ChatGPT的对话,以考察提示知识缺口和对话风格对问题解决的影响。我们识别出开发者提示中的四类主要知识缺口:缺失上下文、缺失规范、多重上下文和指令不明确。假设已关闭问题中的对话有助于成功解决,而开放问题中的对话未成功解决,我们发现无效对话中44.6%的提示包含知识缺口,而有效对话中这一比例仅为12.6%。此外,我们观察到七种不同的对话风格,其中指令式提示、思维链和响应式反馈最为普遍。我们发现所有对话风格中都存在知识缺口,其中缺失上下文是开发者在问题解决对话中面临的最反复出现的挑战。基于我们的分析,我们识别出与成功关闭问题相关的关键文本和代码相关启发式规则(具体性、上下文丰富性和清晰度),这些规则有助于评估提示质量。这些启发式规则为自动化工具奠定了基础,该工具可以动态标记不明确的提示并建议结构化改进。为测试可行性,我们开发了一个轻量级浏览器扩展原型,用于检测提示缺口,该原型可轻松适配到开发者工作流程中的其他工具。
英文摘要:
Large language models (LLMs) have become essential in software development, especially for issue resolution. However, despite their widespread use, significant challenges persist in the quality of LLM responses to issue resolution queries. LLM interactions often yield incorrect, incomplete, or ambiguous information, largely due to knowledge gaps in prompt design, which can lead to unproductive exchanges and reduced developer productivity. In this paper, we analyze 433 developer-ChatGPT conversations within GitHub issue threads to examine the impact of prompt knowledge gaps and conversation styles on issue resolution. We identify four main knowledge gaps in developer prompts: Missing Context, Missing Specifications, Multiple Context, and Unclear Instructions. Assuming that conversations within closed issues contributed to successful resolutions while those in open issues did not, we find that ineffective conversations contain knowledge gaps in 44.6% of prompts, compared to only 12.6% in effective ones. Additionally, we observe seven distinct conversational styles, with Directive Prompting, Chain of Thought, and Responsive Feedback being the most prevalent. We find that knowledge gaps are present in all styles of conversations, with Missing Context being the most repeated challenge developers face in issue-resolution conversations. Based on our analysis, we identify key textual and code-related heuristics (Specificity, Contextual Richness, and Clarity) that are associated with successful issue closure and help assess prompt quality. These heuristics lay the foundation for an automated tool that can dynamically flag unclear prompts and suggest structured improvements. To test feasibility, we developed a lightweight browser extension prototype for detecting prompt gaps, that can be easily adapted to other tools within developer workflows.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。