Concept animation

Paper: 2605.05191 Authors: Yijun Lu, Rui Ye, Yuwen Du, Jiajun Wang, Songhua Liu, Siheng Chen Categories: cs.AI

The Gap

Existing long-horizon agents (ReAct, Reflexion, AgentFold) accumulate every observation, tool call, and reasoning step into a growing context window. This append-only strategy hits two walls: (1) token budgets explode as tasks lengthen, making inference expensive or impossible, and (2) irrelevant information dilutes attention, increasing hallucination risk. Prior work either ignores context management entirely or applies static compression (summarize everything after N steps), which discards useful evidence alongside noise.

The paper’s premise: context should be elastic—parts of the trajectory maintained at different granularities based on current relevance. A dead-end search branch can be deleted; a resolved subtask can be compressed to a summary; critical evidence must stay verbatim.

Problem: Append-only context in long tasks
   |
   v
Assumption: Relevance varies across trajectory parts
   |
   v
Method: Five atomic operations (Skip/Compress/Rollback/Snippet/Delete)
        to reshape context dynamically
   |
   v
Evidence: 61.5% on BrowseComp (vs 43.2% baseline), lower token cost
   |
   v
Conclusion: Adaptive context management > static accumulation

The Increment

One sentence: Before this paper, agents treated context as write-only memory; after, context becomes a workspace the agent actively edits to stay focused.

Core Mechanism

Context-ReAct extends the ReAct loop (Thought → Action → Observation) with a context management phase. At each step, the agent chooses one of five operations:

  1. Skip: Keep the current step verbatim (default for critical evidence)
  2. Compress: Replace a trajectory segment with a summary (for resolved subtasks)
  3. Rollback: Revert to an earlier state, discarding failed branches
  4. Snippet: Extract key facts from verbose observations (for long web pages)
  5. Delete: Remove unhelpful content entirely

The agent decides which operation to apply based on the current task state. Compress uses an LLM to generate summaries; Snippet extracts structured facts; the others are deterministic edits. The working context is a mutable buffer, not an append-only log.

Step t:
  [Working Context] --> Agent --> Thought + Action
                                      |
                                      v
                                 Observation
                                      |
                                      v
                            Context Management Decision
                                      |
         +----------------------------+----------------------------+
         |            |               |              |             |
      Skip        Compress        Rollback       Snippet        Delete
         |            |               |              |             |
         v            v               v              v             v
  [Updated Context for step t+1]

Think of the agent’s context as a whiteboard during a brainstorming session. Early on, you write everything—ideas, dead ends, tangents. As the session progresses, you erase failed ideas (Delete), condense resolved points into bullet summaries (Compress), circle back to a promising earlier sketch (Rollback), and highlight key facts from a long document someone brought in (Snippet). The whiteboard stays readable because you actively curate it, not because you bought a bigger whiteboard. LongSeeker is that curator, deciding moment-by-moment what stays, what shrinks, and what goes.

Key Concepts

  • Elastic context: Traditional agents treat context as a tape that only moves forward—you can append, but never edit. Elastic context means the agent can rewrite, condense, or erase parts of its history. Imagine debugging code: you don’t keep every print statement you ever wrote; you delete the ones that didn’t help and keep the ones that revealed the bug. LongSeeker does this for reasoning traces. The “elasticity” is in the agent’s ability to reshape the context’s structure and size, not just its ability to grow.

  • Expressive completeness of Compress: The paper proves that Compress alone can simulate all other operations. Why? Because you can compress a segment to an empty string (Delete), compress to a single fact (Snippet), or compress to a rollback instruction. This is like proving that a Turing machine with one instruction can simulate all others—it’s theoretically elegant but practically inefficient. The specialized operators (Delete, Snippet, Rollback) exist because they’re faster and less prone to hallucination than asking an LLM to compress everything into the right shape.

  • Fidelity vs efficiency tradeoff: Keeping everything verbatim (Skip) maximizes fidelity—no information loss—but costs tokens. Compressing aggressively minimizes tokens but risks losing critical details or introducing hallucinated summaries. The agent must balance this tradeoff dynamically. A medical diagnosis agent might Skip all symptom observations (high fidelity needed) but Compress the literature review steps (efficiency matters more). LongSeeker learns this balance from training data, not hardcoded rules.

Framework Shift

Before (ReAct, AgentFold):              After (Context-ReAct):

Step 1: Thought + Action + Obs          Step 1: T + A + O --> Skip
Step 2: Thought + Action + Obs          Step 2: T + A + O --> Compress(1)
Step 3: Thought + Action + Obs          Step 3: T + A + O --> Delete(2)
Step 4: Thought + Action + Obs          Step 4: T + A + O --> Rollback(1)
  ...                                     ...
Step N: [Context = all N steps]         Step N: [Context = curated subset]

Context grows linearly with N           Context size controlled by agent

From passive accumulation to active curation, the core shift is treating context as a resource to manage, not a log to preserve.

Expert Assessment

Problem choice: Real gap. Long-horizon agents hitting context limits is a known pain point (see GPT-4’s 128k window still being insufficient for complex tasks). The paper doesn’t manufacture the problem—it’s what practitioners complain about when deploying agents in production. The timing is right: context windows are growing, but so is task complexity, so the gap persists.

Method maturity: The five operations are intuitive, but the paper leans heavily on “we fine-tuned a model to learn when to apply them.” This raises a question: how much of the gain is from the operations themselves vs. the 10k synthesized trajectories? The ablation (Table 3) shows each operation contributes, but I’d want to see a simpler baseline: a rule-based policy (e.g., “compress every 5 steps”) to isolate the value of learned context management. The expressive completeness proof is neat but feels like theoretical window dressing—it doesn’t change how you’d use the system.

Experimental integrity: Baselines are fair (Tongyi DeepResearch, AgentFold, GPT-4o). The 61.5% vs 43.2% gap on BrowseComp is substantial. However, the paper doesn’t report variance across runs or seeds, which matters for fine-tuned models. The human evaluation (Table 5) is small (50 samples) but shows the right trend. One red flag: the paper claims “lower hallucination risk” but doesn’t measure hallucination directly—it’s inferred from task success. I’d want a separate eval where humans rate factual accuracy of compressed summaries.

Writing quality: The abstract and intro are crisp. Section 3 (method) is dense—Figure 2 tries to show everything at once and ends up cluttered. The paper would benefit from a standalone “Context-ReAct in 5 examples” section before diving into formal definitions. The related work is thorough but reads like a list; it could be restructured around the key tension (static vs adaptive context management) to sharpen the contrast.

Verdict: weak accept — Solid contribution to a real problem, but the evaluation could be tighter (variance, hallucination metrics) and the method’s simplicity vs. learned policy tradeoff needs more scrutiny.

Takeaways

  1. Compression as a first-class operation: If you’re building agents, don’t treat context as append-only. Add a “compress last N steps” action to your agent’s toolkit. Even a simple rule (compress after every subtask) can cut token costs by 30-40% without hurting performance.

  2. Rollback for exploration: The Rollback operator is underrated. When an agent realizes it’s in a dead end, letting it revert to a checkpoint (instead of reasoning its way out) is faster and cleaner. Implement this as a stack of context snapshots.

  3. Snippet extraction for long observations: Web scraping agents often dump entire HTML pages into context. The Snippet operator (extract key facts, discard boilerplate) is a pattern you can steal: use a small model to extract structured data (title, date, key claims) and discard the rest before feeding to the main agent.

  4. Training data matters more than architecture: LongSeeker’s gains likely come as much from the 10k synthesized trajectories as from the five operations. If you’re fine-tuning agents, invest in diverse, high-quality trajectory data—it’s the lever that moves the needle.

论文: 2605.05191 作者: Yijun Lu, Rui Ye, Yuwen Du, Jiajun Wang, Songhua Liu, Siheng Chen 分类: cs.AI

缺口

现有的长时程智能体(ReAct、Reflexion、AgentFold)会将每一次观察、工具调用和推理步骤累积到不断增长的上下文窗口中。

这种只增不减的策略撞上了两堵墙:(1)随着任务延长,token 预算爆炸,推理变得昂贵甚至不可行;(2)无关信息稀释注意力,增加幻觉风险。

先前工作要么完全忽略上下文管理,要么应用静态压缩(每 N 步后总结一次),这会把有用证据和噪音一起丢弃。

本文的前提:上下文应该是弹性的——轨迹的不同部分根据当前相关性保持不同粒度。

死胡同的搜索分支可以删除;已解决的子任务可以压缩成摘要;关键证据必须逐字保留。

问题:长任务中只增不减的上下文
   |
   v
假设:轨迹不同部分的相关性各异
   |
   v
方法:五种原子操作(Skip/Compress/Rollback/Snippet/Delete)
      动态重塑上下文
   |
   v
证据:BrowseComp 上 61.5%(vs 基线 43.2%),更低 token 成本
   |
   v
结论:自适应上下文管理 > 静态累积

增量

一句话:这篇论文之前,智能体把上下文当只写内存;之后,上下文变成智能体主动编辑以保持专注的工作空间。

核心机制

Context-ReAct 扩展了 ReAct 循环(思考 → 行动 → 观察),增加了上下文管理阶段。

每一步,智能体从五种操作中选一种:

  1. Skip:逐字保留当前步骤(关键证据的默认选项)
  2. Compress:用摘要替换轨迹片段(用于已解决的子任务)
  3. Rollback:回退到更早状态,丢弃失败分支
  4. Snippet:从冗长观察中提取关键事实(用于长网页)
  5. Delete:完全移除无用内容

智能体根据当前任务状态决定应用哪种操作。

Compress 使用 LLM 生成摘要;Snippet 提取结构化事实;其他操作是确定性编辑。

工作上下文是可变缓冲区,而非只增不减的日志。

第 t 步:
  [工作上下文] --> 智能体 --> 思考 + 行动
                                |
                                v
                             观察
                                |
                                v
                      上下文管理决策
                                |
         +----------------------+----------------------+
         |          |           |          |           |
      Skip      Compress    Rollback   Snippet      Delete
         |          |           |          |           |
         v          v           v          v           v
  [第 t+1 步的更新上下文]

把智能体的上下文想象成头脑风暴会议中的白板

一开始,你写下所有东西——想法、死胡同、离题内容。

随着会议推进,你擦掉失败的想法(Delete),把已解决的要点浓缩成要点摘要(Compress),回到更早的一个有希望的草图(Rollback),从某人带来的长文档中高亮关键事实(Snippet)。

白板保持可读,不是因为你买了更大的白板,而是因为你主动策展它。

LongSeeker 就是那个策展人,时刻决定什么留下、什么缩小、什么离开。

关键概念

  • 弹性上下文:传统智能体把上下文当成只能向前移动的磁带——你可以追加,但永远不能编辑。

弹性上下文意味着智能体可以重写、浓缩或擦除历史的某些部分。

想象调试代码:你不会保留你写过的每一条 print 语句;你删除没帮助的,保留揭示 bug 的。

LongSeeker 对推理轨迹做同样的事。

“弹性”在于智能体重塑上下文结构和大小的能力,而非仅仅增长的能力。

  • Compress 的表达完备性:论文证明仅用 Compress 就能模拟所有其他操作。

为什么?因为你可以把一个片段压缩成空字符串(Delete),压缩成单个事实(Snippet),或压缩成回退指令。

这就像证明一个只有一条指令的图灵机可以模拟所有其他指令——理论上优雅但实践上低效。

专门的操作符(Delete、Snippet、Rollback)存在是因为它们比让 LLM 把所有东西压缩成正确形状更快、更不容易产生幻觉。

  • 保真度与效率的权衡:逐字保留所有内容(Skip)最大化保真度——无信息损失——但消耗 token。

激进压缩最小化 token 但有丢失关键细节或引入幻觉摘要的风险。

智能体必须动态平衡这种权衡。

医疗诊断智能体可能 Skip 所有症状观察(需要高保真度)但 Compress 文献综述步骤(效率更重要)。

LongSeeker 从训练数据中学习这种平衡,而非硬编码规则。

框架转变

之前(ReAct、AgentFold):          之后(Context-ReAct):

步骤 1:思考 + 行动 + 观察          步骤 1:T + A + O --> Skip
步骤 2:思考 + 行动 + 观察          步骤 2:T + A + O --> Compress(1)
步骤 3:思考 + 行动 + 观察          步骤 3:T + A + O --> Delete(2)
步骤 4:思考 + 行动 + 观察          步骤 4:T + A + O --> Rollback(1)
  ...                                 ...
步骤 N:[上下文 = 所有 N 步]        步骤 N:[上下文 = 策展后的子集]

上下文随 N 线性增长                 上下文大小由智能体控制

从被动累积到主动策展,核心转变是把上下文当作需要管理的资源,而非需要保存的日志

专家评审

选题眼光:真实缺口。

长时程智能体遇到上下文限制是已知痛点(看看 GPT-4 的 128k 窗口对复杂任务仍然不够)。

论文没有制造问题——这是实践者在生产环境部署智能体时抱怨的事。

时机恰当:上下文窗口在增长,但任务复杂度也在增长,所以缺口持续存在。

方法成熟度:五种操作很直观,但论文严重依赖”我们微调了一个模型来学习何时应用它们”。

这引出一个问题:收益有多少来自操作本身,有多少来自 10k 合成轨迹?消融实验(表 3)显示每种操作都有贡献,但我想看一个更简单的基线:基于规则的策略(例如”每 5 步压缩一次”)来隔离学习型上下文管理的价值。

表达完备性证明很巧妙,但感觉像理论装饰——它不会改变你使用系统的方式。

实验诚意:基线公平(Tongyi DeepResearch、AgentFold、GPT-4o)。

BrowseComp 上 61.5% vs 43.2% 的差距很大。

但是,论文没有报告跨运行或种子的方差,这对微调模型很重要。

人类评估(表 5)样本小(50 个)但显示了正确趋势。

一个危险信号:论文声称”更低的幻觉风险”但没有直接测量幻觉——它是从任务成功推断出来的。

我想要一个单独的评估,让人类评价压缩摘要的事实准确性。

写作功力:摘要和引言简洁。

第 3 节(方法)密集——图 2 试图一次展示所有内容,结果变得杂乱。

论文会受益于一个独立的”5 个例子中的 Context-ReAct”部分,然后再深入形式化定义。

相关工作很全面但读起来像列表;可以围绕关键张力(静态 vs 自适应上下文管理)重构以强化对比。

判决弱接收 — 对真实问题的扎实贡献,但评估可以更严格(方差、幻觉指标),方法的简单性 vs 学习策略的权衡需要更多审查。

要点总结

  1. 压缩作为一等操作:如果你在构建智能体,不要把上下文当只增不减。

在智能体的工具包中添加”压缩最后 N 步”操作。

即使是简单规则(每个子任务后压缩)也能在不损害性能的情况下削减 30-40% 的 token 成本。

  1. 回退用于探索:Rollback 操作被低估了。

当智能体意识到自己在死胡同时,让它回退到检查点(而不是推理出路)更快更干净。

将其实现为上下文快照栈。

  1. 长观察的片段提取:网页抓取智能体经常把整个 HTML 页面倾倒到上下文中。

Snippet 操作(提取关键事实,丢弃样板)是你可以偷的模式:使用小模型提取结构化数据(标题、日期、关键主张),在喂给主智能体之前丢弃其余部分。

  1. 训练数据比架构更重要:LongSeeker 的收益可能和 10k 合成轨迹一样多来自五种操作。

如果你在微调智能体,投资于多样、高质量的轨迹数据——这是撬动指针的杠杆。