arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2606.23525cs.CL
收藏

自压缩语言模型智能体

Self-Compacting Language Model Agents

Johns Hopkins University(约翰霍普金斯大学);Apple(苹果公司)

Tianjian Li, Jingyu Zhang, William Jurayj, Xi Wang, Chuanyang Jin, Mehrdad Farajtabar, Eric Nalisnick, Daniel Khashabi

AI总结:

提出SelfCompact框架,让语言模型自主决定何时及如何压缩上下文,通过调用压缩工具和轻量级规则实现自适应压缩,无需微调或外部监督,在多个基准上以更低成本匹配或超越固定间隔压缩。

摘要:

由思维链和工具调用组成的长智能体轨迹会积累陈旧内容,锚定后续生成,并最终超出上下文窗口。现有框架通过触发在令牌阈值处的固定间隔压缩来缓解此问题。这种触发不关注轨迹结构,有在推导或搜索过程中丢弃部分结果的风险。我们提出SelfCompact,一种允许模型自身决定何时以及如何压缩的框架。具体来说,它配对两个推理时元素:(i) 模型调用的压缩工具,用于总结累积的上下文,以及(ii) 一个轻量级规则,指定何时触发(子任务已解决,或轨迹正在收敛)以及何时抑制(推导中,或卡住时)。两者都是必需的。仅工具在开放权重模型中使用不均,常常在无帮助的时刻被调用或根本不调用;仅规则无法行动。两者结合,无需任何微调或外部监督即可引发有效的自适应压缩。我们在六个基准(竞赛数学和智能体搜索)和七个模型上展示了实证结果。我们的结果表明,SelfCompact以更低的令牌成本匹配或超过固定间隔总结,在数学上比无总结基线提高最多18.1个百分点,在智能体搜索上提高5-9个百分点,同时每个问题的成本降低30-70%。我们的结果揭示了一个元认知差距:尽管未提示的模型无法可靠地判断其上下文何时在腐化,但一个轻量级规则弥合了这一差距,将何时压缩重新定义为框架无需训练即可提供的能力。

英文摘要:

Long agent traces composed of chains of thought and tool calls accumulate stale content that anchor subsequent generations, and eventually outgrow the context window. Existing scaffolds mitigate it with fixed-interval compaction triggered at a token threshold. Such triggers pay no heed to trajectory structure, risking discard of partial results mid-derivation or mid-search. We propose SelfCompact, a scaffold that allows the model itself to decide when and how to compact. Specifically, it pairs two inference-time elements: (i) a compaction tool the model invokes to summarize the accumulated context, and (ii) a lightweight rubric specifying when to fire (a sub-task has resolved, or the trajectory is converging) and when to suppress (mid-derivation, or when stuck). Both are needed. The tool alone is unevenly used across open-weight models, often invoked at unhelpful moments or not at all; the rubric alone cannot act. Together, they elicit effective adaptive compaction without any fine-tuning or external supervision. We present empirical results on six benchmarks (competitive math and agentic search) and seven models. Our results show that SelfCompact matches or exceeds fixed-interval summarization at a fraction of the token cost, improving over a no-summarization baseline by up to 18.1 points on math and 5-9 points on agentic search at 30-70% lower per-question cost. Our results expose a meta-cognitive gap: although unprompted models cannot reliably tell when their own context is rotting, a lightweight rubric closes this gap, reframing when to compact as a capability that scaffolds can supply without training.

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

↑