mlsanityData to 7 Oct 2026

RepoShapley: Shapley-Enhanced Context Filtering for Repository-Level Code Completion

arXiv 2601.03378 ↗First posted 6 Jan 2026cs.SEcited by 3

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

Abstract (arXiv)

Repository-level code completion benefits from retrieval-augmented generation (RAG). However, controlling cross-file evidence is difficult because chunk utility is often interaction-dependent: some snippets help only when paired with complementary context, while others harm decoding when they conflict. We propose RepoShapley, a coalition-aware context filtering framework supervised by Shapley-style marginal contributions. Our offline labeling module, ChunkShapley, estimates signed per-chunk effects via teacher-forced probing, feeds them into a lightweight surrogate game that captures saturation and interference, computes exact Shapley values for small retrieval sets, and selects a decoding-optimal coalition through bounded post-verification with the frozen generator. The verified keep/drop decisions and retrieval triggers are then distilled into a single model via discrete control tokens. Experiments across benchmarks and backbones show that RepoShapley improves completion quality while reducing harmful context and unnecessary retrieval.

Key facts. Cited by 3 papers in the map (data through 7 Oct 2026). Placed in RAG for code, one of 15 directions in Retrieval-augmented generation. Builds on 34 of its 54 references that are in the map. First posted on arXiv 6 Jan 2026.

Builds on

34 of 54 references.

Closest ancestors · 5

Same direction, newest first

  1. 2025CodeRAG: Finding Relevant and Necessary Knowledge for Retrieval-Augmented Repository-Level Code Completion19 Sep
  2. 2025Impact-driven Context Filtering For Cross-file Code Completion8 Aug
  3. 2025A Deep Dive into Retrieval-Augmented Generation for Code Completion: Experience on WeChat24 Jul
  4. 2024CodeRAG-Bench: Can Retrieval Augment Code Generation?20 Jun
  5. 2021Retrieval Augmented Code Generation and Summarization26 Aug

Other references · 29

  1. 2020Language Models are Few-Shot Learnerscited by 32,199
  2. 2020Retrieval-Augmented Generation for Knowledge-Intensive NLP Taskscited by 9,160
  3. 2021Evaluating Large Language Models Trained on Codecited by 8,053
  4. 2017A Unified Approach to Interpreting Model Predictionscited by 6,488
  5. 2023Lost in the Middle: How Language Models Use Long Contextscited by 3,383
  6. 2017Axiomatic Attribution for Deep Networkscited by 3,350
  7. 2023SWE-bench: Can Language Models Resolve Real-World GitHub Issues?cited by 3,193
  8. 2020REALM: Retrieval-Augmented Language Model Pre-Trainingcited by 2,126
  9. 2023Self-RAG: Learning to Retrieve, Generate, and Critique through Self-Reflectioncited by 1,800
  10. 2020Leveraging Passage Retrieval with Generative Models for Open Domain Question Answeringcited by 1,203
  11. 2022When Not to Trust Language Models: Investigating Effectiveness of Parametric and Non-Parametric Memoriescited by 1,103
  12. 2023Large Language Models Can Be Easily Distracted by Irrelevant Contextcited by 820
17 more
  1. 2019Generalization through Memorization: Nearest Neighbor Language Modelscited by 788
  2. 2019Data Shapley: Equitable Valuation of Data for Machine Learningcited by 617
  3. 2025GLM-4.5: Agentic, Reasoning, and Coding (ARC) Foundation Modelscited by 446
  4. 2023Making Retrieval-Augmented Language Models Robust to Irrelevant Contextcited by 364
  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. 2022The Stack: 3 TB of permissively licensed source codecited by 354
  8. 2023RepoBench: Benchmarking Repository-Level Code Auto-Completion Systemscited by 346
  9. 2023CrossCodeEval: A Diverse and Multilingual Benchmark for Cross-File Code Completioncited by 181
  10. 2023CodePlan: Repository-level Coding using LLMs and Planningcited by 139
  11. 2024In-Context Learning with Long-Context Models: An In-Depth Explorationcited by 126
  12. 2024InstructRAG: Instructing Retrieval-Augmented Generation via Self-Synthesized Rationalescited by 100
  13. 2022CoCoMIC: Code Completion By Jointly Modeling In-file and Cross-file Contextcited by 64
  14. 2024Dataflow-Guided Retrieval Augmentation for Repository-Level Code Completioncited by 40
  15. 2024C-RAG: Certified Generation Risks for Retrieval-Augmented Language Modelscited by 27
  16. 2025TokenShapley: Token Level Context Attribution with Shapley Valuecited by 14
  17. 2025Fair Document Valuation in LLM Summaries via Shapley Valuescited by 6

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. 2024Repoformer: Selective Retrieval for Repository-Level Code Completion
  2. 2025SaraCoder: Orchestrating Semantic and Structural Cues for Resource-Optimized Repository-Level Code Completion
  3. 2024GraphCoder: Enhancing Repository-Level Code Completion via Code Context Graph-based Retrieval and Language Model
  4. 2025Completion by Comprehension: Guiding Code Generation with Multi-Granularity Understanding
  5. 2024RepoGenReflex: Enhancing Repository-Level Code Completion with Verbal Reinforcement and Retrieval-Augmented Generation
  6. 2026Better Call Grep: Evaluating and Improving Grep-Like Lexical Retrieval for Repository-Level Code Completion
  7. 2024RLCoder: Reinforcement Learning for Repository-Level Code Completion
  8. 2026AlignCoder: Aligning Retrieval with Target Intent for Repository-Level Code Completion