arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2402.03630cs.SEcs.AI
收藏

通过原生集成IDE派生的静态上下文增强基于LLM的编码工具

Enhancing LLM-Based Coding Tools through Native Integration of IDE-Derived Static Context

The Chinese University of Hong Kong(香港中文大学)

Yichen Li, Yun Peng, Yintong Huo, Michael R. Lyu

AI总结:

本文提出IDECoder框架,通过原生集成IDE的静态上下文和诊断结果进行跨上下文构建与自我精炼,有效解决了大型软件项目中LLM仓库级代码补全受限于跨文件信息获取准确率和上下文长度的问题。

摘要:

大型语言模型(LLMs)在代码补全方面取得了显著成功,这从它们在开发Copilot等代码助手服务中的关键作用得以证明。由于在文件内上下文上进行训练,当前的LLMs在为单个源文件补全代码方面非常有效。然而,对于需要跨文件信息的大型软件项目,它们很难进行仓库级代码补全。现有的关于基于LLM的仓库级代码补全的研究识别并整合了跨文件上下文,但其准确率较低且受限于LLMs的上下文长度。在本文中,我们认为集成开发环境(IDEs)可以为仓库级代码补全提供直接、准确且实时的跨文件信息。我们提出了IDECoder,这是一个实用框架,利用IDE原生静态上下文进行跨上下文构建,并利用诊断结果进行自我精炼。IDECoder利用IDE中丰富的跨上下文信息来增强LLMs的仓库级代码补全能力。我们进行了初步实验以验证IDECoder的性能,并观察到这种协同作用代表了未来探索的一个有前景的趋势。

英文摘要:

Large Language Models (LLMs) have achieved remarkable success in code completion, as evidenced by their essential roles in developing code assistant services such as Copilot. Being trained on in-file contexts, current LLMs are quite effective in completing code for single source files. However, it is challenging for them to conduct repository-level code completion for large software projects that require cross-file information. Existing research on LLM-based repository-level code completion identifies and integrates cross-file contexts, but it suffers from low accuracy and limited context length of LLMs. In this paper, we argue that Integrated Development Environments (IDEs) can provide direct, accurate and real-time cross-file information for repository-level code completion. We propose IDECoder, a practical framework that leverages IDE native static contexts for cross-context construction and diagnosis results for self-refinement. IDECoder utilizes the rich cross-context information available in IDEs to enhance the capabilities of LLMs of repository-level code completion. We conducted preliminary experiments to validate the performance of IDECoder and observed that this synergy represents a promising trend for future exploration.

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

↑