arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2307.08177cs.SEcs.AIcs.HC
收藏

使用大语言模型辅助代码理解

Using an LLM to Help With Code Understanding

Carnegie Mellon University(卡内基梅隆大学);Google, Inc.(谷歌公司)

Daye Nam, Andrew Macvean, Vincent Hellendoorn, Bogdan Vasilescu, Brad Myers

AI总结:

本文提出并评估了一款集成在IDE中的基于GPT-3.5-turbo的对话式代码理解插件,通过32人用户研究证明其比网络搜索更能帮助完成任务,并揭示了学生与专业人士在使用和收益上的差异。

摘要:

理解代码具有挑战性,尤其是在新的复杂开发环境中工作时。代码注释和文档可以提供帮助,但通常稀少或难以浏览。大语言模型(LLMs)正在彻底改变编写代码的过程。它们能否同样帮助理解代码?在本研究中,我们首次调查了一种直接构建在IDE中的、面向代码理解的基于大语言模型的对话式用户界面。我们的IDE插件通过四个高层请求查询OpenAI的GPT-3.5-turbo模型,而无需用户编写显式提示:解释高亮的代码段、提供代码中使用的API调用的详细信息、解释关键领域特定术语,以及为某个API提供使用示例。该插件还支持开放式提示,这些提示会自动结合正在编辑的程序上下文提供给大语言模型。我们在一项有32名参与者参加的用户研究中评估了该系统,结果证实使用我们的插件比网络搜索更能帮助完成任务。此外,我们对开发者使用系统的方式以及对其有用性的感知进行了深入分析,发现学生和专业人士之间的使用情况和收益存在差异。我们得出结论,在IDE内与大语言模型进行无提示交互是工具构建者一个有前景的未来方向。

英文摘要:

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-turbo model 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 between students and professionals. We conclude that in-IDE prompt-less interaction with LLMs is a promising future direction for tool builders.

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

↑