Agents based on large language models have recently shown strong potential on real-world software engineering (SWE) tasks that require long-horizon interaction with repository-scale codebases. However, most existing agents rely on append-only context maintenance or passively triggered compression heuristics, which often lead to context explosion, semantic drift, and degraded reasoning in long-running interactions. We propose CAT, a new context management paradigm that elevates context maintenance to a callable tool integrated into the decision-making process of agents. CAT formalizes a structured context workspace consisting of stable task semantics, condensed long-term memory, and high-fidelity short-term interactions, and enables agents to proactively compress historical trajectories into actionable summaries at appropriate milestones. To support context management for SWE-agents, we propose a trajectory-level supervision framework, CAT-GENERATOR, based on an offline data construction pipeline that injects context-management actions into complete interaction trajectories. Using this framework, we train a context-aware model, SWE-Compressor. Experiments on SWE-Bench-Verified demonstrate that SWE-Compressor reaches a 57.6% solved rate and significantly outperforms ReAct-based agents and static compression baselines, while maintaining stable and scalable long-horizon reasoning under a bounded context budget.


翻译:基于大型语言模型的智能体最近在需要与仓库级代码库进行长周期交互的实际软件工程任务中展现出强大潜力。然而,现有智能体大多依赖仅追加式语境维护或被动触发的压缩启发式方法,这往往导致长程交互中出现语境爆炸、语义漂移和推理能力退化。我们提出CAT,一种新的语境管理范式,它将语境维护提升为可调用的工具,并集成到智能体的决策过程中。CAT形式化了一个结构化的语境工作空间,包含稳定的任务语义、压缩的长期记忆和高保真的短期交互,使智能体能够在适当的里程碑处主动将历史轨迹压缩为可操作的摘要。为支持软件工程智能体的语境管理,我们提出了轨迹级监督框架CAT-GENERATOR,它基于离线数据构建流程,将语境管理操作注入完整的交互轨迹中。利用该框架,我们训练了一个语境感知模型SWE-Compressor。在SWE-Bench-Verified上的实验表明,SWE-Compressor达到了57.6%的问题解决率,显著优于基于ReAct的智能体和静态压缩基线方法,同时在有限语境预算下保持了稳定且可扩展的长周期推理能力。

0
下载
关闭预览

相关内容

软件(中国大陆及香港用语,台湾作软体,英文:Software)是一系列按照特定顺序组织的计算机数据和指令的集合。一般来讲软件被划分为编程语言、系统软件、应用软件和介于这两者之间的中间件。软件就是程序加文档的集合体。
UTC: 用于视觉对话的任务间对比学习的统一Transformer
专知会员服务
14+阅读 · 2022年5月4日
图机器学习 2.2-2.4 Properties of Networks, Random Graph
图与推荐
10+阅读 · 2020年3月28日
国家自然科学基金
17+阅读 · 2017年12月31日
国家自然科学基金
17+阅读 · 2015年12月31日
国家自然科学基金
46+阅读 · 2015年12月31日
国家自然科学基金
6+阅读 · 2014年12月31日
国家自然科学基金
17+阅读 · 2008年12月31日
VIP会员
相关基金
国家自然科学基金
17+阅读 · 2017年12月31日
国家自然科学基金
17+阅读 · 2015年12月31日
国家自然科学基金
46+阅读 · 2015年12月31日
国家自然科学基金
6+阅读 · 2014年12月31日
国家自然科学基金
17+阅读 · 2008年12月31日
Top
微信扫码咨询专知VIP会员