为有状态大模型代理设计可确定性管理的虚拟内存系统
ClawVM: Harness-Managed Virtual Memory for Stateful Tool-Using LLM Agents
- 将上下文视为带类型页的虚拟内存,通过多分辨率表示节省令牌预算
- 在令牌预算内可完全消除策略可控故障,单次操作开销低于50微秒
- 利用代理框架天然位置实现状态管理的确定性与可审计性
有状态工具使用的大模型代理将上下文窗口当作工作内存,但现有代理框架对驻留和持久性的管理仅为尽力而为,导致重复失败:压缩后丢失状态、重置时跳过刷新、写回时造成破坏。我们提出 extsc{ClawVM},一种虚拟内存层,以最小保真度不变量管理状态,支持在令牌预算下的多分辨率表示,并在每个生命周期边界进行验证写回。由于代理框架已负责组装提示、调用工具并观察生命周期事件,它成为天然的执行点;将契约置于其中使驻留和持久性变为确定且可审计。在合成负载、12个真实会话轨迹及对抗性压力测试中, extsc{ClawVM} 在最小保真度集合可容纳于令牌预算时,彻底消除所有策略可控故障,经离线预言机验证,并且每次交互仅增加小于50微秒的策略引擎开销。
原文摘要 · Abstract (English)
Stateful tool-using LLM agents treat the context window as working memory, yet today's agent harnesses manage residency and durability as best-effort, causing recurring failures: lost state after compaction, bypassed flushes on reset, and destructive writeback. We present \textsc{ClawVM}, a virtual memory layer that manages state as typed pages with minimum-fidelity invariants, multi-resolution representations under a token budget, and validated writeback at every lifecycle boundary. Because the harness already assembles prompts, mediates tools, and observes lifecycle events, it is the natural enforcement point; placing the contract there makes residency and durability deterministic and auditable. Across synthetic workloads, 12 real-session traces, and adversarial stress tests, \textsc{ClawVM} eliminates all policy-controllable faults whenever the minimum-fidelity set fits within the token budget, confirmed by an offline oracle, and adds median <50 microseconds of policy-engine overhead per turn.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。