arXiv:2607.00692cs.AI2026-07被引 1

让大模型长时任务自主管理上下文,减少冗余信息同时保留关键证据。

Self-GC: Self-Governing Context for Long-Horizon LLM Agents

论文配图:Self-GC: Self-Governing Context for Long-Horizon LLM Agents
图 1 · 摘自论文原文
  • 将用户交互、工具输出等转化为可索引的上下文对象,实现生命周期管控。
  • 在33会话测试中减少43.95%前缀token,未来延续性影响低于15%。
  • 适合需要长期推理与高可靠性的智能体系统,如客服或自动化决策平台。

长时程大模型智能体累积的工具结果、文件、计划和用户约束结构复杂,不宜简单作为一次性文本尾部处理。现有系统多依赖运行时启发式规则(如按时间修剪、屏蔽工具输出)或接近上下文极限时的自我摘要,但前者忽略未来依赖,后者常丢失精确证据、定位信息与可编辑内容。本文提出Self-GC,即自治理上下文机制,通过将用户轮次、工具片段和技能状态转为带索引的上下文对象,由侧通道规划器建议折叠、遮蔽与删除操作,并由执行引擎保障可恢复的旁车机制、安全提交边界与缓存感知提交。在33会话的Hard Set测试中,Self-GC实现43.95%的前缀token剪枝,同时保持84.85%的未来延续性不受影响,显著优于启发式基线(54.55%~69.70%无影响率)。在包含332会话的生产衍生套件中,三种规划器骨干均达到91.27%~94.58%的无影响率,而基线仅77.71%~87.46%。实际部署中,账户级切分使日均输入token降低10%~15%,峰值降幅近20%。结果表明,上下文管理应是基于索引、可恢复对象的运行时生命周期控制,而非事后文本清理。

原文摘要 · Abstract (English)

Long-horizon LLM agents accumulate tool results, files, plans, and user constraints that are too structured to be treated as a disposable text suffix. Current systems mostly rely on in-run heuristics such as chronological pruning and tool-output masking, or on final self-summary near a context limit. Heuristics are cheap but blind to future dependencies; summaries preserve narrative state but often hide exact evidence, locators, and editable artifacts. We present Self-GC, where GC denotes self-governing context while deliberately echoing garbage collection: the system does not merely reclaim unused tokens, but governs the lifecycle of agent context objects. Self-GC turns user turns, tool spans, and skill state into indexed objects; asks a side-channel planner to propose fold, mask, and prune actions; and lets the harness enforce recoverable sidecars, safe commit boundaries, and cache-aware commit. On a 33-session Hard Set, Self-GC prunes 43.95% of prefix tokens while leaving 84.85% of future continuations unaffected, compared with no-impact rates of 54.55% to 69.70% for heuristic baselines. On a 332-session production-derived suite, three planner backbones reach no-impact rates of 91.27% to 94.58%, while baselines remain at 77.71% to 87.46%. In production, an online account-level split reduces daytime average input tokens by 10% to 15%, with peak reductions near 20%. These results point to context management as runtime lifecycle control over indexed, recoverable objects rather than post hoc text cleanup.

大模型智能体上下文管理长时推理

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。