arXiv:2603.01012cs.SEcs.AI2026-03被引 1

FastCode通过结构探查快速定位代码关键部分,大幅降低推理成本。

FastCode: Fast and Cost-Efficient Code Understanding and Reasoning

  • 先用轻量结构图探查代码库,再精准提取相关代码
  • 在多个基准上准确率超越现有方法,令牌消耗减少超30%
  • 适合需要高效处理大型代码库的开发与自动化工具

仓库级代码推理是现代AI辅助软件工程的核心,使大语言模型能够完成从程序理解到复杂调试的全流程任务。然而,在准确性与上下文成本之间取得平衡仍是主要瓶颈,现有代理式方法常因低效的全文本迭代探索而浪费计算资源。为此,我们提出 FastCode 框架,将仓库探索与内容消费解耦。FastCode 利用结构探查机制,通过轻量级语义-结构地图导航代码库,无需全文摄入即可追踪依赖关系并定位相关目标。结合成本感知策略与结构感知导航工具,框架以单步优化方式构建高价值上下文。在 SWE-QA、LongCodeQA、LOC-BENCH 与 GitTaskBench 等基准上的广泛评估表明,FastCode 在推理准确率上持续优于当前最优基线,同时显著降低令牌消耗,验证了‘探查优先’策略在大规模代码推理中的高效性。源码已开源:https://github.com/HKUDS/FastCode。

原文摘要 · Abstract (English)

Repository-scale code reasoning is a cornerstone of modern AI-assisted software engineering, enabling Large Language Models (LLMs) to handle complex workflows from program comprehension to complex debugging. However, balancing accuracy with context cost remains a significant bottleneck, as existing agentic approaches often waste computational resources through inefficient, iterative full-text exploration. To address this, we introduce FastCode, a framework that decouples repository exploration from content consumption. FastCode utilizes a structural scouting mechanism to navigate a lightweight semantic-structural map of the codebase, allowing the system to trace dependencies and pinpoint relevant targets without the overhead of full-text ingestion. By leveraging structure-aware navigation tools regulated by a cost-aware policy, the framework constructs high-value contexts in a single, optimized step. Extensive evaluations on the SWE-QA, LongCodeQA, LOC-BENCH, and GitTaskBench benchmarks demonstrate that FastCode consistently outperforms state-of-the-art baselines in reasoning accuracy while significantly reducing token consumption, validating the efficiency of scouting-first strategies for large-scale code reasoning. Source code is available at https://github.com/HKUDS/FastCode.

代码理解推理效率LLM应用

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。