解决软件工程智能体推理上下文爆炸问题,提升效率与深度。
SWE-AGILE: A Software Agent Framework for Efficiently Managing Dynamic Reasoning Context

- 用动态滑窗保留近期推理细节,压缩历史为摘要
- 7B-8B模型在SWE-Bench-Verified上仅用2.2k轨迹达新基准
- 适合需要高效深度推理的自动化软件开发场景
当前主流自主软件工程(SWE)中的ReAct类方法通常缺乏深层分析所需的系统2式推理能力。尽管最近的推理模型展现了长链思维(CoT)潜力,但在多轮SWE任务中面临根本性矛盾:保留完整推理历史会导致上下文爆炸和‘中间迷失’退化,而丢弃则迫使代理重复推理。为此,我们提出SWE-AGILE,一种新型软件代理框架,旨在弥合推理深度、效率与上下文限制之间的差距。SWE-AGILE引入动态推理上下文策略,通过保持详细推理的‘滑动窗口’以确保连续性,避免冗余重分析,同时将历史推理内容压缩为简洁的推理摘要。实验表明,SWE-AGILE在仅使用2.2k轨迹和896个任务的前提下,为7B-8B模型在SWE-Bench-Verified上设立了新标准。代码已开源于https://github.com/KDEGroup/SWE-AGILE。
原文摘要 · Abstract (English)
Prior representative ReAct-style approaches in autonomous Software Engineering (SWE) typically lack the explicit System-2 reasoning required for deep analysis and handling complex edge cases. While recent reasoning models demonstrate the potential of extended Chain-of-Thought (CoT), applying them to the multi-turn SWE task creates a fundamental dilemma: retaining full reasoning history leads to context explosion and ``Lost-in-the-Middle'' degradation, while discarding it would force the agent to redundantly re-reason at every step. To address these challenges, we propose SWE-AGILE, a novel software agent framework designed to bridge the gap between reasoning depth, efficiency, and context constraints. SWE-AGILE introduces a Dynamic Reasoning Context strategy, maintaining a ``sliding window'' of detailed reasoning for immediate continuity to prevent redundant re-analyzing, while compressing historical reasoning content into concise Reasoning Digests. Empirically, SWE-AGILE sets a new standard for 7B-8B models on SWE-Bench-Verified using only 2.2k trajectories and 896 tasks. Code is available at https://github.com/KDEGroup/SWE-AGILE.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。