Understanding code is challenging, especially when working in new and complex development environments. Code comments and documentation can help, but are typically scarce or hard to navigate. Large language models (LLMs) are revolutionizing the process of writing code. Can they do the same for helping understand it? In this study, we provide a first investigation of an LLM-based conversational UI built directly in the IDE that is geared towards code understanding. Our IDE plugin queries OpenAI's GPT-3.5 and GPT-4 models with four high-level requests without the user having to write explicit prompts: to explain a highlighted section of code, provide details of API calls used in the code, explain key domain-specific terms, and provide usage examples for an API. The plugin also allows for open-ended prompts, which are automatically contextualized to the LLM with the program being edited. We evaluate this system in a user study with 32 participants, which confirms that using our plugin can aid task completion more than web search. We additionally provide a thorough analysis of the ways developers use, and perceive the usefulness of, our system, among others finding that the usage and benefits differ significantly between students and professionals. We conclude that in-IDE prompt-less interaction with LLMs is a promising future direction for tool builders.
翻译:理解代码具有挑战性,尤其是在处理新型复杂开发环境时。代码注释和文档虽有助益,但通常数量稀少或难以浏览。大型语言模型(LLM)正在革新代码编写方式——它们能否同样辅助代码理解?本研究首次探讨了直接内置于集成开发环境(IDE)中、面向代码理解的LLM对话式用户界面。我们的IDE插件调用OpenAI的GPT-3.5和GPT-4模型,通过四种高级请求(无需用户编写显式提示词)实现:解释高亮代码片段、提供API调用细节、解释领域特定术语、以及展示API使用示例。该插件还支持开放性提示词,系统会自动结合当前编辑程序为LLM生成上下文。我们通过32名参与者的用户研究验证了该系统,结果表明使用插件比网络搜索更能辅助任务完成。此外,我们深入分析了开发者使用该系统的方式及其对系统实用性的认知,发现学生与专业人士在使用模式和收益上存在显著差异。最终结论认为:在IDE内实现无需提示词的LLM交互是工具开发者值得探索的未来方向。