LLM-powered AI agents require high-frequency state exploration (e.g., test-time tree search and reinforcement learning), relying on rapid checkpoint and rollback (C/R) of the complete sandbox state, including files and process state (e.g., memory, contexts, etc.). 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. This paper observes that subsequent checkpoints in AI agents are highly similar. Therefore, instead of full duplication, a sandbox should only duplicate the changes between consecutive checkpoints (Key Insight). However, it is non-trivial to realize the idea, mainly due to the missing OS supports. This paper proposes a new OS-level abstraction, DeltaState, to enable the change-based transactional C/R for AI agents with two co-designed OS mechanisms. First, DeltaFS enables change-based filesystem C/R by organizing the file states into layers and dynamically freezing the writable layer and inserting a new one during checkpoint, reducing file updates to copy-on-write, and making rollback a simple layer switch. Second, DeltaCR enables change-based process state C/R using incremental dumps, and accelerates rollback by bypassing traditional pipelines to directly fork() from a frozen template process. We then present DeltaBox, a novel agent sandbox achieving millisecond level C/R through the two new mechanisms. Evaluations on SWE-bench and RL micro-benchmarks show DeltaBox completes checkpoint and rollback in millisecond-level latency (14ms and 5ms, respectively), empowering agents to explore substantially more nodes under fixed time budgets.
翻译:由大语言模型驱动的AI智能体需进行高频状态探索(如测试时树搜索与强化学习),这依赖对完整沙箱状态(包括文件与进程状态,如内存、上下文等)的快速检查点/回滚(C/R)。现有机制通过完整状态复制导致每次C/R产生数百毫秒至数秒的延迟,严重制约深度搜索与大规模扇出场景。本文观察到AI智能体的后续检查点具有高度相似性,因此沙箱应仅记录连续检查点间的差异(核心洞见)而非完整复制。然而,实现该思想面临重大挑战,主要源于操作系统支持的缺失。本文提出新的操作系统级抽象DeltaState,通过两种协同设计的操作系统机制实现基于变更的AI智能体事务性C/R:其一,DeltaFS通过将文件状态组织为多层结构,在检查点期间动态冻结可写层并插入新层,将文件更新转化为写时复制,使回滚简化为层切换;其二,DeltaCR采用增量转储实现基于变更的进程状态C/R,通过绕过传统流水线直接从冻结模板进程调用fork()加速回滚。基于上述两种新机制,我们构建了DeltaBox——一种实现毫秒级C/R的新型智能体沙箱。SWE-bench与强化学习微基准测试评估表明,DeltaBox的检查点与回滚延迟分别达到毫秒级(14毫秒与5毫秒),使智能体在固定时间预算内可探索更多节点。