mlsanityData to 14 Oct 2026

SelfRACG: Enabling LLMs to Self-Express and Retrieve for Code Generation

arXiv 2507.19033 ↗First posted 25 Jul 2025cs.IRcited by 2

On the map: Retrieval-augmented generation → RAG for code

Abstract (arXiv)

Existing retrieval-augmented code generation (RACG) methods typically use an external retrieval module to fetch semantically similar code snippets used for generating subsequent fragments. However, even for consecutive code fragments, the content often diverges due to logical progression, resulting in a content gap. This gap undermines the performance of current RACG methods, as textitexternal retrieval modules based on content matching fail to infer the specific information need of LLMs to generate the next code fragment. Therefore, we propose SelfRACG, a novel paradigm that enables large language models (LLMs) to Self-express their information needs to enhance RACG. Specifically, SelfRACG includes an information need expression module and a two-stage information need-guided training strategy, which encourages LLMs to express their information need. Extensive experiments demonstrate that SelfRACG can retrieve external knowledge that better aligns with the LLM's own information needs, resulting in superior generation performance compared to vanilla RACG.

Key facts. Cited by 2 papers in the map (data through 14 Oct 2026). Placed in RAG for code, one of 15 directions in Retrieval-augmented generation. Builds on 22 of its 30 references that are in the map. First posted on arXiv 25 Jul 2025.

Builds on

22 of 30 references.

Closest ancestors · 4

Same direction, newest first

  1. 2024CodeRAG-Bench: Can Retrieval Augment Code Generation?20 Jun
  2. 2024GraphCoder: Enhancing Repository-Level Code Completion via Code Context Graph-based Retrieval and Language Model11 Jun
  3. 2022ReACC: A Retrieval-Augmented Code Completion Framework15 Mar
  4. 2021Retrieval Augmented Code Generation and Summarization26 Aug

Other references · 18

  1. 2021LoRA: Low-Rank Adaptation of Large Language Modelscited by 14,380
  2. 2023Efficient Memory Management for Large Language Model Serving with PagedAttentioncited by 5,944
  3. 2020Dense Passage Retrieval for Open-Domain Question Answeringcited by 3,824
  4. 2023Lost in the Middle: How Language Models Use Long Contextscited by 3,455
  5. 2023Retrieval-Augmented Generation for Large Language Models: A Surveycited by 2,212
  6. 2016MS MARCO: A Human Generated MAchine Reading COmprehension Datasetcited by 1,605
  7. 2024Qwen2.5-Coder Technical Reportcited by 1,203
  8. 2024DeepSeek-Coder: When the Large Language Model Meets Programming -- The Rise of Code Intelligencecited by 1,181
  9. 2023Towards General Text Embeddings with Multi-stage Contrastive Learningcited by 723
  10. 2024NV-Embed: Improved Techniques for Training LLMs as Generalist Embedding Modelscited by 472
  11. 2023RepoCoder: Repository-Level Code Completion Through Iterative Retrieval and Generationcited by 367
  12. 2022One Embedder, Any Task: Instruction-Finetuned Text Embeddingscited by 333
6 more
  1. 2024Generative Representational Instruction Tuningcited by 233
  2. 2023CrossCodeEval: A Diverse and Multilingual Benchmark for Cross-File Code Completioncited by 183
  3. 2023SAILER: Structure-aware Pre-trained Language Model for Legal Case Retrievalcited by 62
  4. 2023T2Ranking: A large-scale Chinese Benchmark for Passage Rankingcited by 60
  5. 2023I^3 Retriever: Incorporating Implicit Interaction in Pre-trained Language Models for Passage Retrievalcited by 5
  6. 2025Qilin: A Multimodal Information Retrieval Dataset with APP-level User Sessionscited by 4

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2025: 1; 2026: 1.

2 papers.

Similar, not cited

Close in wording, no citation either way

  1. 2023SelfEvolve: A Code Evolution Framework via Large Language Models
  2. 2025An Empirical Study of Retrieval-Augmented Code Generation: Challenges and Opportunities
  3. 2024Context-Augmented Code Generation Using Programming Knowledge Graphs
  4. 2026Context-Augmented Code Generation Using Programming Knowledge Graphs
  5. 2025What to Retrieve for Effective Retrieval-Augmented Code Generation? An Empirical Study and Beyond
  6. 2024Repoformer: Selective Retrieval for Repository-Level Code Completion
  7. 2025SACL: Understanding and Combating Textual Bias in Code Retrieval with Semantic-Augmented Reranking and Localization
  8. 2026Are you Synthesizing or Recalling? Evaluating LLMs on Algorithmic Code Retrieval