Recent advancements in large language models (LLMs) have substantially improved automated code generation. While function-level and file-level generation have achieved promising results, real-world software development typically requires reasoning across entire repositories. This gives rise to the challenging task of Repository-Level Code Generation (RLCG), where models must capture long-range dependencies, ensure global semantic consistency, and generate coherent code spanning multiple files or modules. To address these challenges, Retrieval-Augmented Generation (RAG) has emerged as a powerful paradigm that integrates external retrieval mechanisms with LLMs, enhancing context-awareness and scalability. In this survey, we provide a comprehensive review of research on Retrieval-Augmented Code Generation (RACG), with an emphasis on repository-level approaches. We categorize existing work along several dimensions, including generation strategies, retrieval modalities, model architectures, training paradigms, and evaluation protocols. Furthermore, we summarize widely used datasets and benchmarks, analyze current limitations, and outline key challenges and opportunities for future research. Our goal is to establish a unified analytical framework for understanding this rapidly evolving field and to inspire continued progress in AI-powered software engineering.


翻译:近年来,大型语言模型(LLMs)的进步显著提升了自动化代码生成的性能。尽管函数级和文件级代码生成已取得可喜成果,但现实世界的软件开发通常需要对整个代码仓库进行推理。这催生了具有挑战性的仓库级代码生成(RLCG)任务,该任务要求模型必须捕获长距离依赖关系、确保全局语义一致性,并生成跨多个文件或模块的连贯代码。为应对这些挑战,检索增强生成(RAG)已成为一种强大的范式,它将外部检索机制与LLMs相结合,从而增强了上下文感知能力和可扩展性。本综述对检索增强代码生成(RACG)的研究进行了全面回顾,并着重关注仓库级方法。我们从多个维度对现有工作进行了分类,包括生成策略、检索模态、模型架构、训练范式和评估协议。此外,我们总结了广泛使用的数据集与基准,分析了当前存在的局限性,并概述了未来研究的关键挑战与机遇。我们的目标是建立一个统一的分析框架,以理解这一快速发展的领域,并启发人工智能驱动的软件工程领域持续取得进展。

0
下载
关闭预览

相关内容

代码(Code)是专知网的一个重要知识资料文档板块,旨在整理收录论文源代码、复现代码,经典工程代码等,便于用户查阅下载使用。
大语言模型中的检索与结构化增强生成综述
专知会员服务
32+阅读 · 2025年9月17日
多模态检索增强生成的综合综述
专知会员服务
43+阅读 · 2025年2月17日
定制化大型语言模型的图检索增强生成综述
专知会员服务
37+阅读 · 2025年1月28日
通过强化学习增强代码生成中的代码大语言模型:综述
专知会员服务
29+阅读 · 2025年1月1日
检索增强生成系统中的可信度:综述
专知会员服务
43+阅读 · 2024年9月18日
《大型语言模型代码生成》综述
专知会员服务
68+阅读 · 2024年6月4日
大型语言模型增强强化学习综述:概念、分类和方法
专知会员服务
57+阅读 · 2024年4月4日
基于模型的强化学习综述
专知
42+阅读 · 2022年7月13日
深度学习文本分类方法综述(代码)
中国人工智能学会
28+阅读 · 2018年6月16日
关于强化学习(附代码,练习和解答)
深度学习
37+阅读 · 2018年1月30日
国家自然科学基金
18+阅读 · 2017年12月31日
国家自然科学基金
5+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
2+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
VIP会员
相关VIP内容
大语言模型中的检索与结构化增强生成综述
专知会员服务
32+阅读 · 2025年9月17日
多模态检索增强生成的综合综述
专知会员服务
43+阅读 · 2025年2月17日
定制化大型语言模型的图检索增强生成综述
专知会员服务
37+阅读 · 2025年1月28日
通过强化学习增强代码生成中的代码大语言模型:综述
专知会员服务
29+阅读 · 2025年1月1日
检索增强生成系统中的可信度:综述
专知会员服务
43+阅读 · 2024年9月18日
《大型语言模型代码生成》综述
专知会员服务
68+阅读 · 2024年6月4日
大型语言模型增强强化学习综述:概念、分类和方法
专知会员服务
57+阅读 · 2024年4月4日
相关基金
国家自然科学基金
18+阅读 · 2017年12月31日
国家自然科学基金
5+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
2+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员