发表机构
Beihang University(北京航空航天大学)
机构由 AI 辅助整理,请以论文原文为准。AI 中文总结
RepoNav提出一种轻量级检索后接口,将检索片段重组为以文件为中心的导航脚手架,通过结构线索和候选目标引导智能体浏览文件结构,从而提升函数级定位并缩小文件到函数的差距。
AI 中文摘要
解决仓库级代码任务需要基于大语言模型的智能体使用代码搜索工具来导航大型代码库,并识别出少量相关的文件和函数。然而,当前的检索工具通常返回孤立的代码片段的扁平列表:这种列表虽然能呈现相关文件,但缺乏足够的结构,使智能体难以将目标函数与同一文件中语义相似的替代函数区分开来。我们提出了RepoNav,一种轻量级的检索后接口,它将检索到的片段重新组织为以文件为中心的导航脚手架。通过呈现紧凑的结构线索和候选目标,该脚手架引导按需的文件结构浏览,帮助智能体在选择目标函数之前比较同级的符号。在LocBench上对多种模型进行的评估中,RepoNav提高了函数级定位能力,并缩小了文件到函数之间的差距。受控消融实验表明,这些提升来自于结构化的证据组织,而非仅仅暴露额外的文件结构,并且该方法在仓库级问答基准上也提升了性能。
英文摘要
Solving repository-level code tasks requires LLM-based agents to use code search tools to navigate large codebases and identify a small set of relevant files and functions. However, current retrieval tools typically return flat lists of isolated code snippets: such lists can surface relevant files, but provide insufficient structure for agents to distinguish the target function from semantically similar alternatives in the same file. We introduce RepoNav, a lightweight post-retrieval interface that reorganizes retrieved snippets into a file-centered navigation scaffold. By presenting compact structural cues and candidate targets, this scaffold guides on-demand file-structure browsing, helping agents compare sibling symbols before selecting a target function. Across diverse models on LocBench, RepoNav improves function-level localization and narrows the file-to-function gap. Controlled ablations demonstrate that these gains come from structured evidence organization rather than simply exposing additional file structure, and the approach also improves performance on a repository-level question-answering benchmark.
CommentsAccepted to EMNLP 2026