VITAL-RAG: Invariance Race for Context Allocation in Coding Agents

📅 2026-07-29
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
This work addresses the limitation of conventional code retrieval-augmented generation methods, wherein redundant code snippets consume precious input context space and displace critical code segments. To overcome this, the authors propose a novel approach that organizes retrieved evidence around canonical code objects and employs an “invariance competition” mechanism to dynamically select task-relevant fragments with semantic novelty. This strategy efficiently allocates evidence under both global and object-level token budgets, effectively balancing redundancy reduction with fine-grained detail preservation. Evaluated on RepoBench, the method achieves a Recall@4K of 63.67%—a substantial improvement over existing baselines—while reducing evidence tokens by 35.63%. It also demonstrates consistent superiority across RepoClassBench and RepoExec benchmarks.
📝 Abstract
Coding agents often retrieve code from an entire repository, but only limited evidence can fit into the final model input. Conventional retrieval-augmented generation (RAG) for coding agents treats fragments from the same code object as separate results, so redundant views can occupy multiple context positions and crowd out useful code. Grouping fragments by code object reduces this redundancy, but can discard local information needed for the task. We describe this tension as an invariance race: allocation should stay stable under redundant renderings but change when a fragment adds task-relevant semantics. To address this race, we introduce VITAL-RAG, which organizes evidence by canonical code object, keeps one query-relevant companion only when it adds semantics not already represented, and renders selected evidence under per-object and global token budgets. On RepoBench, VITALRAG improves Recall@4K from 39.59% to 63.67% while reducing evidence tokens by 35.63%. Across three model backends, it matches or outperforms recent baselines on RepoClassBench and achieves the highest raw Pass@1 on RepoExec.
Problem

Research questions and friction points this paper is trying to address.

redundancy
context allocation
code retrieval
invariance
retrieval-augmented generation
Innovation

Methods, ideas, or system contributions that make the work stand out.

VITAL-RAG
invariance race
retrieval-augmented generation
code object canonicalization
context allocation
🔎 Similar Papers