Folio:可恢复的多分辨率上下文折叠,提升长程智能体任务表现
Folio: Recoverable Multi-Resolution Context Folding for Long-Horizon Language Agents
搞智能体的朋友可以看看这篇。Folio 不靠模型写摘要压历史,而是运行时留三层记录直接程序化折叠,还能用句柄恢复原文。同一运行时下 75 个任务解决 66 个,比模型摘要方案的 54 个多不少,成本还只有 1/2.4,做长任务 agent 的值得对比一下自己的压缩方案。
论文提出 Folio,一种面向长程语言智能体的上下文管理器。在 75 个 LOCA-bench 任务上,使用 DeepSeek-V4-Pro 的 Folio 解决了 66 个任务,而同一运行时下用模型生成摘要做压缩的方式只解决 54 个,Claude Code、Codex、SoL-Pi 分别为 49-59 个。
Folio 的核心机制是运行时同步维护三层互相关联的记录:L1 是模型在普通回复中顺带写下的简短轮次笔记,L2 是运行时记录的每次调用事件清单,L3 是捕获的原始记录。由于这些视图始终存在,运行时可以程序化地折叠上下文——为更早的轮次选择更粗粒度的视图,折叠时打印索引 L2 和 L3 的句柄,恢复工具据此按有界页面读取证据、在文件上对全文计算,并把发现存入持久的 dossier。
性能方面,Folio 的工作时间约为对比运行时的一半,成本低至其 1/2.4,每次折叠中位耗时 0.6 秒。相比依赖模型重写历史摘要的方案(每次压缩都要重读并重写被替换的历史),Folio 用同一组句柄完成记录、折叠与恢复,省去了重复读取的开销。
Folio: Recoverable Multi-Resolution Context Folding for Long-Horizon Language Agents
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.
本条情报归属 AITOP「论文」核心追踪栏目。在跨区域产业观察坐标中,该动态直接关联「AI 开发者工具链、Coding Agent 与工程化实践」研究主线,反映出当前技术演进与商业落地的最新风向。涉及核心实体与技术议题包括:Folio、DeepSeek-V4-Pro、智能体、LOCA-bench,读者可通过下方标签进入对应专题页查阅历史脉络与关联对比。
信源核验说明:本文原始信息发布自一手权威信源「arXiv: DeepSeek」(Tier-1 一手发布),具备高确定性参考价值。