arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2603.01012cs.SEcs.AI
收藏

FastCode: 快速且成本有效的代码理解和推理

FastCode: Fast and Cost-Efficient Code Understanding and Reasoning

The University of Hong Kong(香港大学);Huawei Noah’s Ark Lab(华为诺亚实验室)

Zhonghang Li, Zongwei Li, Yuxuan Chen, Han Shi, Jiawei Li, Jierun Chen, Haoli Bai, Chao Huang

AI总结:

FastCode通过结构化勘探机制提升代码推理效率,减少计算成本,优于现有基线方法。

摘要:

仓库级的代码推理是现代AI辅助软件工程的基石,使大型语言模型(LLMs)能够处理从程序理解到复杂调试的复杂工作流程。然而,平衡精度与上下文成本仍然是一个重大瓶颈,因为现有代理方法往往通过低效、迭代的全文探索浪费计算资源。为了解决这个问题,我们引入了FastCode,一个将仓库探索与内容消费解耦的框架。FastCode利用结构化勘探机制来导航代码库的轻量级语义-结构地图,使系统能够追踪依赖关系并定位相关目标,而无需全文摄入的开销。通过利用结构感知的导航工具,由成本感知策略调节,该框架在单步优化过程中构建高价值上下文。在SWE-QA、LongCodeQA、LOC-BENCH和GitTaskBench基准上的广泛评估表明,FastCode在推理准确性上始终优于最先进的基线,同时显著减少令牌消耗,验证了大规模代码推理中先勘探策略的效率。源代码可在https://github.com/HKUDS/FastCode上获得。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑