Folio:面向长 horizon 语言智能体的可恢复多分辨率上下文折叠
Folio: Recoverable Multi-Resolution Context Folding for Long-Horizon Language Agents
AI总结:
该研究提出 Folio 上下文管理器,通过多分辨率层级折叠历史,在 75 项 LOCA-bench 任务上,其任务解决率优于对比系统,运行时间与成本更低,折叠耗时短。
摘要:
长 horizon 语言智能体在历史记录超出上下文窗口容量前,会持续积累工具结果与回复。当前智能体通过模型对历史进行总结来压缩历史,每次压缩会重新读取并重写其替换的历史,缓存感知触发机制在给定结果大小的情况下决定何时压缩。我们提出 Folio,一种通过一组句柄记录、折叠和恢复历史的上下文管理器。在智能体运行时,Folio 记录三个关联层级:模型在常规回复中写入的短对话笔记(L1)、运行时写入的每个调用的事件清单(L2),以及捕获的源记录(L3)。由于这些视图已存在,运行时可通过编程方式折叠上下文,为较早的对话选择更粗粒度的视图。折叠操作会输出索引 L2 和 L3 的句柄,因此读取有限页面、对文件中全文计算并将结果保存在持久档案中的恢复工具,仅需少量额外输入即可获取智能体所需的证据。折叠触发机制会确定包含保留预算的明确着陆点。在 75 项 LOCA-bench 任务上,所有系统均使用 DeepSeek-V4-Pro,Folio 解决了 66 项任务,而相同运行时采用模型编写压缩方法解决了 54 项,Claude Code、Codex 和 SoL-Pi 解决了 49-59 项;Folio 的运行时间约为这些系统的一半,成本比该运行时低 2.4 倍,每次折叠的中位数时间为 0.6 秒。
英文摘要:
Long-horizon language agents accumulate tool results and replies until the history no longer fits the context window. Current agents shrink this history by having a model summarize it, so each compaction rereads and rewrites the history it replaces, and cache-aware triggers decide when to compact while taking the size of the result as given. We present Folio, a context manager that records, folds, and recovers history through one set of handles. While the agent runs, Folio records three linked levels: a short turn note the model writes as part of its ordinary reply (L1), an event manifest of every call written by the runtime (L2), and the captured source records (L3). Because these views already exist, the runtime folds the context programmatically, selecting coarser views for older turns. The fold prints the handles that index L2 and L3, so recovery tools that read bounded pages, compute over full text in files, and keep findings in a persistent dossier reach the evidence the agent needs with little added input. The fold trigger prices an explicit landing point that includes the retained budget. On 75 LOCA-bench tasks with DeepSeek-V4-Pro behind every system, Folio solves 66 tasks against 54 for the same runtime with model-written compaction and 49-59 for Claude Code, Codex, and SoL-Pi, in about half their working time, at 2.4 times lower cost than that runtime; each fold takes a median of 0.6 seconds.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。