DeltaBox: 通过毫秒级沙箱检查点/回滚扩展状态化AI代理
DeltaBox: Millisecond-Scale Sandbox Checkpoint and Rollback for Stateful AI Agents
AI总结:
本文提出DeltaBox,一种通过DeltaFS和DeltaCR机制实现毫秒级检查点/回滚的新型AI代理沙箱,解决了传统方法在高频状态探索中的延迟问题。
摘要:
LLM驱动的AI代理需要高频状态探索(例如测试时的树搜索和强化学习),依赖于快速检查点和回滚(C/R)完整的沙箱状态,包括文件和进程状态(例如内存、上下文等)。现有机制需要完整复制状态,导致每次C/R的延迟达到数百毫秒到秒级,严重限制了深度搜索和大规模扩展。本文观察到AI代理中的后续检查点高度相似,因此沙箱应仅复制连续检查点之间的变化(关键洞察)。然而,实现这一想法并不简单,主要是由于缺乏操作系统支持。本文提出新的操作系统抽象DeltaState,通过两个共同设计的操作系统机制,为AI代理实现基于变化的事务性C/R。首先,DeltaFS通过将文件状态组织成分层结构,动态冻结可写层并在检查点时插入新层,将文件更新转换为写时复制,使回滚成为简单的层切换。其次,DeltaCR通过增量快照实现基于变化的过程状态C/R,并通过绕过传统管道直接从冻结的模板进程fork()来加速回滚。我们随后提出DeltaBox,一种新型的代理沙箱,通过这两种新机制实现毫秒级的C/R。在SWE-bench和RL微基准测试中的评估显示,DeltaBox在毫秒级延迟(14ms和5ms)内完成检查点和回滚,使代理在固定时间预算内能够探索大量节点。
英文摘要:
Emerging LLM-powered AI agent workloads, such as test-time tree search and reinforcement learning (RL), require high-frequency state exploration, relying on rapid checkpoint/restore (C/R) of the complete sandbox state, including files and process state. Existing mechanisms duplicate the entire state, causing hundreds of milliseconds to seconds of latency per C/R, which severely bottlenecks deep search and large-scale fan-outs. We observe that consecutive sandbox states between checkpoints differ only marginally. Therefore, instead of full duplication, a sandbox should only duplicate the changes between consecutive checkpoints (Key Insight), yet the lack of OS support makes this hard to realize. We propose a new OS-level abstraction, DeltaState, that delivers change-based C/R for agents through co-designed OS mechanisms. First, DeltaFS checkpoints file state by freezing the writable layer and inserting a new one, turning updates into copy-on-write and rollback into a layer switch. Second, DeltaCR quickly restores process state by forking from a frozen template process. A coordinator pairs the two so each checkpoint is one consistent (filesystem, memory) state. Building on these mechanisms, we present DeltaBox, an agent sandbox with millisecond-level C/R. On SWE-bench, DeltaBox hides its checkpoint work (10.83 ms) under inference and rolls back in a mean 1.86 ms, with the same warm-template fork driving low-cost RL rollout fan-out. DeltaBox is open-sourced at https://github.com/delta-box.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。