mlsanityData to 7 Oct 2026

Adaptive Critical Token-Aware Retrieval for Repository-Level Code Generation

arXiv 2609.01601 ↗First posted 1 Sep 2026cs.SE cs.AI cs.CLcited by 0

Not on the map. Why?

Abstract (arXiv)

The repository-level code generation task requires synthesizing code that satisfies task requirements while remaining consistent with the target repository context. Since real-world repositories often exceed the input length limits of LLMs, existing approaches commonly adopt retrieval-augmented generation (RAG) to provide repository-specific context. Despite improving repository-context retrieval, existing methods typically provide context as task-level support, without explicitly identifying the critical tokens that require fine-grained repository context during generation. During the autoregressive generation process of LLMs, errors often concentrate at a small number of decisive positions: once such tokens are generated incorrectly, subsequent code may follow an incorrect semantic path and eventually lead to functional failure. We refer to these positions as "critical tokens". In this paper, we propose ACToR, an adaptive critical token-aware retrieval framework for repository-level code generation. ACToR identifies critical tokens during generation and triggers targeted retrieval on demand to provide repository context at these decisive positions. In addition, we design a position-aware weighting method for dense retrievers to prioritize context that is more informative for generation. We evaluate ACToR on two representative repository-level benchmarks, RepoExec and CoderEval. Experimental results show that ACToR consistently outperforms state-of-the-art methods, achieving relative improvements of 8.4% on RepoExec and 15.4% on CoderEval. Beyond performance gains, we systematically quantify the impact of critical tokens, revealing their central role in major generation failures and highlighting the necessity of targeted retrieval strategies. We provide the code and data at https://github.com/DeepSoftwareAnalytics/ACToR.

Key facts. No citing papers in the map yet (data through 7 Oct 2026). Builds on 54 of its 67 references that are in the map. First posted on arXiv 1 Sep 2026.

Builds on

54 of 67 references.

References · 54

  1. 2017Attention Is All You Needcited by 59,932
  2. 2021Evaluating Large Language Models Trained on Codecited by 8,053
  3. 2023Code Llama: Open Foundation Models for Codecited by 2,105
  4. 2022Competition-Level Code Generation with AlphaCodecited by 1,427
  5. 2023Is Your Code Generated by ChatGPT Really Correct? Rigorous Evaluation of Large Language Models for Code Generationcited by 1,332
  6. 2024DeepSeek-Coder: When the Large Language Model Meets Programming -- The Rise of Code Intelligencecited by 1,154
  7. 2022CodeGen: An Open Large Language Model for Code with Multi-Turn Program Synthesiscited by 876
  8. 2023StarCoder: may the source be with you!cited by 790
  9. 2024BigCodeBench: Benchmarking Code Generation with Diverse Function Calls and Complex Instructionscited by 527
  10. 2022InCoder: A Generative Model for Code Infilling and Synthesiscited by 492
  11. 2024StarCoder 2 and The Stack v2: The Next Generationcited by 484
  12. 2023Large Language Models for Software Engineering: A Systematic Literature Reviewcited by 389
38 more
  1. 2022CodeT: Code Generation with Generated Testscited by 369
  2. 2023RepoCoder: Repository-Level Code Completion Through Iterative Retrieval and Generationcited by 357
  3. 2022UniXcoder: Unified Cross-Modal Pre-training for Code Representationcited by 355
  4. 2020IntelliCode Compose: Code Generation Using Transformercited by 225
  5. 2024CacheBlend: Fast Large Language Model Serving for RAG with Cached Knowledge Fusioncited by 211
  6. 2023CacheGen: KV Cache Compression and Streaming for Fast Large Language Model Servingcited by 199
  7. 2023Compressing Context to Enhance Inference Efficiency of Large Language Modelscited by 185
  8. 2023Large Language Models for Software Engineering: Survey and Open Problemscited by 178
  9. 2024MAGIS: LLM-Based Multi-Agent Framework for GitHub Issue Resolutioncited by 132
  10. 2022Repository-Level Prompt Generation for Large Language Models of Codecited by 106
  11. 2024LLM Hallucinations in Practical Code Generation: Phenomena, Mechanism, and Mitigationcited by 92
  12. 2023Towards an Understanding of Large Language Models in Software Engineering Taskscited by 67
  13. 2023A Survey of Large Language Models for Code: Evolution, Benchmarking, and Future Trendscited by 66
  14. 2022CoCoMIC: Code Completion By Jointly Modeling In-file and Cross-file Contextcited by 64
  15. 2024Agents in Software Engineering: Survey, Landscape, and Visioncited by 60
  16. 2024Repoformer: Selective Retrieval for Repository-Level Code Completioncited by 55
  17. 2023No Need to Lift a Finger Anymore? Assessing the Quality of Code Generation by ChatGPTcited by 45
  18. 2024RLCoder: Reinforcement Learning for Repository-Level Code Completioncited by 44
  19. 2024Dataflow-Guided Retrieval Augmentation for Repository-Level Code Completioncited by 40
  20. 2021Code Completion by Modeling Flattened Abstract Syntax Trees as Graphscited by 30
  21. 2024Towards Understanding the Characteristics of Code Generation Errors Made by Large Language Modelscited by 28
  22. 2022RACE: Retrieval-Augmented Commit Message Generationcited by 27
  23. 2024HumanEvo: An Evolution-aware Benchmark for More Realistic Evaluation of Repository-level Code Generationcited by 26
  24. 2025OmniGIRL: A Multilingual and Multimodal Benchmark for GitHub Issue Resolutioncited by 24
  25. 2025What to Retrieve for Effective Retrieval-Augmented Code Generation? An Empirical Study and Beyondcited by 22
  26. 2024On the Impacts of Contexts on Repository-Level Code Generationcited by 21
  27. 2024When to Stop? Towards Efficient Code Generation in LLMs with Excess Token Preventioncited by 21
  28. 2024RepoTransBench: A Real-World Multilingual Benchmark for Repository-Level Code Translationcited by 21
  29. 2024Prompt-based Code Completion via Multi-Retrieval Augmented Generationcited by 16
  30. 2026RealSec-bench: A Benchmark for Evaluating Secure Code Generation in Real-World Repositoriescited by 13
  31. 2025RepoST: Scalable Repository-Level Coding Environment Construction with Sandbox Testingcited by 12
  32. 2024CoSQA+: Pioneering the Multi-Choice Code Search Benchmark with Test-Driven Agentscited by 11
  33. 2024You Augment Me: Exploring ChatGPT-based Data Augmentation for Semantic Code Searchcited by 11
  34. 2025Towards an Understanding of Context Utilization in Code Intelligencecited by 10
  35. 2024R2C2-Coder: Enhancing and Benchmarking Real-world Repository-level Code Completion Abilities of Code Large Language Modelscited by 9
  36. 2024Let the Code LLM Edit Itself When You Edit the Codecited by 8
  37. 2026AlignCoder: Aligning Retrieval with Target Intent for Repository-Level Code Completioncited by 7
  38. 2025SWE-Factory: Your Automated Factory for Issue Resolution Training Data and Evaluation Benchmarkscited by 6

50 most cited of 54 All 54 (JSON)

Built on by

Not cited yet.

Similar, not cited

Close in wording, no citation either way

  1. 2025Retrieval-Augmented Code Generation: A Survey with Focus on Repository-Level Approaches
  2. 2026Do Not Treat Code as Natural Language: Implications for Repository-Level Code Generation and Beyond
  3. 2024CodeRAG-Bench: Can Retrieval Augment Code Generation?
  4. 2025FastCoder: Accelerating Repository-level Code Generation via Efficient Retrieval and Verification
  5. 2026TICoder: A Repository-Level Code Generation Framework with Test-Driven Planning and Implementation-Aware Reuse ↗
  6. 2026MRCoder: An Efficient Context Selecting Approach for Repository-Level Code Generation ↗
  7. 2026In Line with Context: Repository-Level Code Generation via Context Inlining
  8. 2025RepoScope: Leveraging Call Chain-Aware Multi-View Context for Repository-Level Code Generation