mlsanityData to 7 Oct 2026

Practical Code RAG at Scale: Task-Aware Retrieval Design Choices under Compute Budgets

arXiv 2510.20609 ↗First posted 23 Oct 2025cs.LG cs.AI cs.IRcited by 3

Not on the map. Why?

Abstract (arXiv)

We study retrieval design for code-focused generation tasks under realistic compute budgets. Using two complementary tasks from Long Code Arena -- code completion and bug localization -- we systematically compare retrieval configurations across various context window sizes along three axes: (i) chunking strategy, (ii) similarity scoring, and (iii) splitting granularity. (1) For PL-PL, sparse BM25 with word-level splitting is the most effective and practical, significantly outperforming dense alternatives while being an order of magnitude faster. (2) For NL-PL, proprietary dense encoders (Voyager-3 family) consistently beat sparse retrievers, however requiring 100x larger latency. (3) Optimal chunk size scales with available context: 32-64 line chunks work best at small budgets, and whole-file retrieval becomes competitive at 16000 tokens. (4) Simple line-based chunking matches syntax-aware splitting across budgets. (5) Retrieval latency varies by up to 200x across configurations; BPE-based splitting is needlessly slow, and BM25 + word splitting offers the best quality-latency trade-off. Thus, we provide evidence-based recommendations for implementing effective code-oriented RAG systems based on task requirements, model constraints, and computational efficiency.

Key facts. Cited by 3 papers in the map (data through 7 Oct 2026). Builds on 28 of its 38 references that are in the map. First posted on arXiv 23 Oct 2025.

Builds on

28 of 38 references.

References · 28

  1. 2020Retrieval-Augmented Generation for Knowledge-Intensive NLP Taskscited by 9,160
  2. 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,286
  3. 2020GraphCodeBERT: Pre-training Code Representations with Data Flowcited by 600
  4. 2022Large Language Models Struggle to Learn Long-Tail Knowledgecited by 452
  5. 2023RepoCoder: Repository-Level Code Completion Through Iterative Retrieval and Generationcited by 357
  6. 2022UniXcoder: Unified Cross-Modal Pre-training for Code Representationcited by 355
  7. 2022DocPrompting: Generating Code by Retrieving the Docscited by 151
  8. 2021SPLADE v2: Sparse Lexical and Expansion Model for Information Retrievalcited by 126
  9. 2022ReACC: A Retrieval-Augmented Code Completion Frameworkcited by 117
  10. 2023Dense X Retrieval: What Retrieval Granularity Should We Use?cited by 88
  11. 2024Repoformer: Selective Retrieval for Repository-Level Code Completioncited by 55
  12. 2024Long Code Arena: a Set of Benchmarks for Long-Context Code Modelscited by 48
16 more
  1. 2023RAP-Gen: Retrieval-Augmented Patch Generation with CodeT5 for Automatic Program Repaircited by 43
  2. 2024Is Semantic Chunking Worth the Computational Cost?cited by 43
  3. 2024Dataflow-Guided Retrieval Augmentation for Repository-Level Code Completioncited by 40
  4. 2025A Systematic Review of Key Retrieval-Augmented Generation (RAG) Systems: Progress, Gaps, and Future Directionscited by 30
  5. 2021A Proposed Conceptual Framework for a Representational Approach to Information Retrievalcited by 24
  6. 2024ChunkRAG: Novel LLM-Chunk Filtering Method for RAG Systemscited by 22
  7. 2024Rewriting the Code: A Simple Method for Large Language Model Augmented Code Searchcited by 17
  8. 2025GraphCodeAgent: Dual Graph-Guided LLM Agent for Retrieval-Augmented Repo-Level Code Generationcited by 17
  9. 2025cAST: Enhancing Code Retrieval-Augmented Generation with Structural Chunking via Abstract Syntax Treecited by 17
  10. 2024Prompt-based Code Completion via Multi-Retrieval Augmented Generationcited by 16
  11. 2024METIS: Fast Quality-Aware RAG Systems with Configuration Adaptationcited by 16
  12. 2024Towards Understanding Systems Trade-offs in Retrieval-Augmented Generation Model Inferencecited by 15
  13. 2023The Devil is in the Tails: How Long-Tailed Code Distributions Impact Large Language Modelscited by 8
  14. 2025Enhancing Retrieval Augmented Generation with Hierarchical Text Segmentation Chunkingcited by 7
  15. 2022Better Than Whitespace: Information Retrieval for Languages without Custom Tokenizerscited by 3
  16. 2024Multi-View Adaptive Contrastive Learning for Information Retrieval Based Fault Localizationcited by 1

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2026: 3.

3 papers.

Similar, not cited

Close in wording, no citation either way

  1. 2026Do Not Treat Code as Natural Language: Implications for Repository-Level Code Generation and Beyond
  2. 2025Impact-driven Context Filtering For Cross-file Code Completion
  3. 2024A Lightweight Framework for Adaptive Retrieval In Code Completion With Critique Model
  4. 2024Evaluating the Effectiveness and Efficiency of Demonstration Retrievers in RAG for Coding Tasks
  5. 2024Retrieval-augmented code completion for local projects using large language models
  6. 2026Better Call Grep: Evaluating and Improving Grep-Like Lexical Retrieval for Repository-Level Code Completion
  7. 2026Not All RAGs Are Created Equal: A Component-Wise Empirical Study for Software Engineering Tasks
  8. 2024CodeRAG-Bench: Can Retrieval Augment Code Generation?