paper-with-me

홈 › Papers

When Retrieval Hurts Code Completion: A Diagnostic Study of Stale Repository Context

2026-05-14 · Haojun Weng, Qianqian Yang, Hao Fu, Haobin Pan, Xinwei Lv arxiv

Context: Retrieval-augmented code generation relies on cross-file repository context, but retrieved snippets may come from obsolete project states. Objectives: We study whether temporally stale repository snippets act as harmless noise or actively induce current-state-incompatible code. Methods: We conduct a controlled diagnostic study on a curated 17-sample set of production-helper signature changes from five Python repositories. For each sample, we compare current-only, stale-only, no-retrieval, and mixed current/stale retrieval conditions under prompts that hide commit freshness and expected current signatures. Results: Under neutralized prompts, stale-only retrieval induces stale helper references on 15/17 Qwen2.5-Coder-7B-Instruct samples and 13/17 gpt-4.1-mini samples, corresponding to 88.2 and 76.5 percentage-point increases over current-only retrieval. No retrieval produces zero stale references but only 1/17 passing completions. The two models share 75.0% Jaccard overlap among stale-triggering samples, and mixed conditions show that adding valid current evidence largely rescues stale-only failures. Conclusion: Temporal validity of retrieved repository context is a distinct diagnostic variable for Code RAG robustness: stale context can actively bias models toward obsolete repository state rather than merely removing useful evidence.

📄 PDF Abstract BibTeX arXiv:2605.14478

Code (0)

등록된 구현이 없습니다.

Tasks

Code GenerationCode Completion

Similar Papers 제목 키워드 기반

ReACC: A Retrieval-Augmented Code Completion Framework

2022-03-15 · ACL 2022 5 · Shuai Lu, Nan Duan, Hojae Han, Daya Guo 외

Code completion, which aims to predict the following code token(s) according to the code context, can improve the productivity of software development. Recent work has proved that statistical language modeling with trans…

Code CompletionLanguage ModelingLanguage ModellingRetrieval

Repoformer: Selective Retrieval for Repository-Level Code Completion

2024-03-15 · Di wu, Wasi Uddin Ahmad, Dejiao Zhang, Murali Krishna Ramanathan 외

Recent advances in retrieval-augmented generation (RAG) have initiated a new era in repository-level code completion. However, the invariable use of retrieval in existing methods exposes issues in both efficiency and rob…

Code CompletionRAGRetrievalRetrieval-augmented Generation+1

Dataflow-Guided Retrieval Augmentation for Repository-Level Code Completion

2024-05-30 · Wei Cheng, Yuhan Wu, Wei Hu

Recent years have witnessed the deployment of code language models (LMs) in various code intelligence tasks such as code completion. Yet, it is challenging for pre-trained LMs to generate correct completions in private r…

Code CompletionRetrievaltext similarity

RepoHyper: Search-Expand-Refine on Semantic Graphs for Repository-Level Code Completion

2024-03-10 · Huy N. Phan, Hoang N. Phan, Tien N. Nguyen, Nghi D. Q. Bui

Code Large Language Models (CodeLLMs) have demonstrated impressive proficiency in code completion tasks. However, they often fall short of fully understanding the extensive context of a project repository, such as the in…

Code CompletionLink PredictionRetrieval

RepoCoder: Repository-Level Code Completion Through Iterative Retrieval and Generation

2023-03-22 · Fengji Zhang, Bei Chen, Yue Zhang, Jacky Keung 외

The task of repository-level code completion is to continue writing the unfinished code based on a broader context of the repository. While for automated code completion tools, it is difficult to utilize the useful infor…

Code CompletionLanguage ModelingLanguage ModellingRetrieval