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

CTXAgent——大语言模型智能体的自控制上下文管理

CTXAgent - Self-Controlled Context Management of LLM Agents

Hamburg University of Technology(汉堡工业大学);Helmholtz-Zentrum Hereon(亥姆霍兹中心盖斯特哈赫特);German Research Center for Artificial Intelligence (DFKI)(德国人工智能研究中心);Saarland University(萨尔大学)

Matthias Busch, Marius Tacke, Roland C. Aydin, Christian Feiler, Christian J. Cyron

AI总结:

本研究提出CTXAgent,让大语言模型智能体自行管理上下文,对比7种前沿模型及3种工具,在含多任务的基准上验证其可降低成本且不显著降分,Claude Opus 5.5应用时成本降幅达49%。

摘要:

现有智能体工具在令牌阈值被触发时,会通过压缩历史记录来将长会话维持在上下文窗口内。本研究探索一种替代方案:模型自行管理其上下文,在给定两个工具和一段指导文本的情况下,自主决定何时进行压缩、保留哪些内容以及作为交接内容写入哪些内容。由于早期研究发现开源权重模型无法在无支架的情况下自行管理上下文,因此我们在相同条件下对比了7种前沿模型(含有无上下文工具的情况)在令牌成本和基准分数上的表现,并在其中两种模型上将本工具与三种广泛使用的工具进行了对比。该基准由现有基准整合而成:编码练习、多步骤SciCode问题、SWE-bench Pro和Terminal-Bench 4.0任务与植入事实、临时观察和常设指令交错,所有内容均通过确定性检查,会话轮次为35-212轮,类似用户在一次聊天中处理不同任务的场景。多数最强模型能够管理其上下文:它们会定期压缩和整理,混合会话的活跃上下文大多保持在10万令牌以下,且其基准分数大多未显著下降。对于能良好管理上下文的模型,成本降低幅度可观但因模型而异,部分模型因压缩过于频繁导致其他成本上升。使用Claude Opus 5.5时,自管理工具的任务成功率与Claude Code相当,成本比其显式20万窗口配置低34%,比默认配置低49%,且无需选择上下文窗口。我们发布了该智能体、基准及所有结果行。

英文摘要:

Agent harnesses keep long sessions inside the context window by compacting the history when a token threshold is crossed. We study an alternative in which the model manages its own context: it decides when to compact, what to keep and what to write as the hand-off, given two tools and one paragraph of guidance. Since earlier work found that open-weight models cannot manage their own context without scaffolding, we compare seven frontier models under identical conditions, with and without the context tools, on token cost and benchmark score, and we compare our harness with three widely used harnesses on two of these models. The benchmark is assembled from existing ones: coding exercises, multi-step SciCode problems and SWE-bench Pro and Terminal-Bench 4.0 tasks are interleaved with planted facts, ephemeral observations and standing instructions, all checked deterministically, in sessions of 35-212 turns that resemble a user working through different tasks in one chat. Most of the strongest models manage their context: they compact and curate regularly, the live context of the mixed sessions stays mostly below 100k tokens, and their benchmark scores mostly do not drop significantly. For the models that manage their context well, the cost reduction is substantial but varies between models, because some models compact so often that other costs increase. With Claude Opus 5.5, the self-managed harness matches Claude Code on task success at 34% lower cost than its explicit 200k-window configuration and 49% lower than its default, with no context window to choose. We release the agent, the benchmark and all result rows.

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

↑