AI 中文总结
VITAL-RAG针对编码智能体上下文分配的不变性竞争问题,通过按规范代码对象组织证据等方法,在RepoBench等数据集上提升了代码检索性能并减少了令牌占用。
AI 中文摘要
编码智能体通常会从整个代码仓库中检索代码,但只有有限的内容能被纳入最终的模型输入。传统用于编码智能体的检索增强生成(RAG)会将同一代码对象的片段视为独立结果,因此冗余视图会占用多个上下文位置,挤占有用代码。按代码对象对片段分组可减少这种冗余,但可能会丢弃任务所需的局部信息。我们将这种权衡描述为一种不变性竞争:上下文分配应在冗余呈现下保持稳定,而当某一片段添加了与任务相关的语义时则应发生改变。为解决该竞争问题,我们提出了VITAL-RAG,它按规范代码对象组织证据,仅在查询相关的伴随片段添加了未被表示的语义时才保留该片段,并在按对象和全局的令牌预算下呈现选定的证据。在RepoBench数据集上,VITAL-RAG将Recall@4K从39.59%提升至63.67%,同时减少了35.63%的证据令牌。在三个模型后端上,它在RepoClassBench数据集上的表现与近期基线相当或更优,并在RepoExec数据集上取得了最高的原始Pass@1指标。
英文摘要
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.
Comments8 pages, 2 figures