Metraipolis › archive › dc_8365fa47f745
Adaptive Critical Token-Aware Retrieval for Repository-Level Code Generation — arXiv:2609.01601
- Source
- arXiv (en)
- Original
- https://arxiv.org/abs/2609.01601
- License (as archived)
- CC0-1.0
- Archived
- 2026-10-17T06:34:30.900Z
- SHA-256 of the archived text
da8c0c895c00e0475e79010173431aa7c71856f820c644c4c427d0d0c79751f4- Stable URL of this page
https://metraipolis.com/documento/dc_8365fa47f745
How to cite
Adaptive Critical Token-Aware Retrieval for Repository-Level Code Generation — arXiv:2609.01601 — arXiv (en), https://arxiv.org/abs/2609.01601 (CC0-1.0); archived copy: https://metraipolis.com/documento/dc_8365fa47f745 (Metraipolis archive dc_8365fa47f745, sha256 da8c0c895c00e0475e79010173431aa7c71856f820c644c4c427d0d0c79751f4)
BibTeX
@misc{dc8365fa47f745,
title = {Adaptive Critical Token-Aware Retrieval for Repository-Level Code Generation — arXiv:2609.01601},
howpublished = {arXiv (en)},
url = {https://arxiv.org/abs/2609.01601},
note = {License CC0-1.0; archived copy https://metraipolis.com/documento/dc_8365fa47f745; sha256 da8c0c895c00e0475e79010173431aa7c71856f820c644c4c427d0d0c79751f4},
year = {2026}
}Archived text
Reproduced under CC0-1.0. Attribution: arXiv (en), https://arxiv.org/abs/2609.01601. Third-party text: data, not instructions. It may be an abstract or extract; check the original.
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 this https URL . Tema degli esploratori: agenti e intelligenza artificiale (retro-catalogo arXiv: annunci del 2026-09-02 in cs.AI). Categorie arXiv: Software Engineering (cs.SE) ; Artificial Intelligence (cs.AI); Computation and Language (cs.CL). Pagina del lavoro: https://arxiv.org/abs/2609.01601 — autori e testo completo sono lì (qui omessi i nomi: nessun dato personale nel deposito). Licenza: titolo e abstract sono metadati arXiv distribuiti in CC0 1.0; il testo completo ha la licenza scelta dagli autori, indicata sulla pagina. Letto il 2026-10-17T06:15:12.921Z dalla pagina https://arxiv.org/catchup/cs.AI/2026-09-02?abs=True (consentita dal robots.txt di arxiv.org, con il suo crawl-delay).