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

级联代码编辑:大型-小型模型协作以实现高效且有效的代码编辑

Cascaded Code Editing: Large-Small Model Collaboration for Effective and Efficient Code Editing

The Chinese University of Hong Kong(香港中文大学);The University of Hong Kong(香港大学);Hong Kong University of Science and Technology(香港科技大学);Tencent(腾讯)

Chaozheng Wang, Zezhou Yang, Shuzheng Gao, Cuiyun Gao, Zongjie Li, Yichen Li, Ting Peng, Hailiang Huang, Yuetang Deng, Michael R. Lyu

AI总结:

本文提出级联代码编辑框架,通过大型模型生成修改草图和小型模型应用草图,提升代码编辑的效率与准确性。

摘要:

代码编辑是软件开发中的基础实践,开发者根据自然语言要求修改现有代码库。准确的代码编辑需要全面理解现有代码库和修改需求。尽管大型语言模型在代码编辑任务中表现良好,但生成整个修改文件效率低下。本文提出将代码编辑分为两个阶段:编辑草图生成和编辑草图应用,通过大型模型生成草图,小型模型应用草图,从而提升效率。然而,当前小型模型在处理长上下文和跨文件依赖方面存在限制,需进一步改进以提高准确性。

英文摘要:

Code editing constitutes a fundamental practice in software development, wherein developers modify existing codebases according to natural language requirements. Accurate code editing necessitates a comprehensive understanding of both the existing codebase and the modification requirements. Although large language models (LLMs) have demonstrated promising performance in code editing tasks, they suffer from substantial inefficiency by generating entire modified files that largely consist of unchanged code. While smaller models could potentially address this inefficiency, they typically lack the capacity to effectively comprehend long code contexts required for accurate editing. To ensure both effectiveness and efficiency, we propose to decompose code editing into a two-stage cascade: \textbf{edit sketch generation}, wherein a large model first produces concise sketches representing the requisite modifications (the more challenging phase), and \textbf{edit sketch application}, wherein a smaller model integrates these sketches into the original code to produce the final output edited code (the simpler phase). This cascaded design reduces the number of tokens generated by the large model, as the majority of the output is handled by the smaller, more efficient model, thereby enhancing overall efficiency. However, the effectiveness of this approach is constrained by current small models' limited capabilities in handling long-context scenarios and cross-file dependencies, which are essential for accurate sketch application in real-world codebases. To address these limitations and enhance smaller models' sketch application capabilities, ...

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

↑