As LLM agents are deployed in long-horizon sessions, context accumulation drives up inference costs. Existing approaches utilize text pruning or dynamic memory eviction to minimize token footprints; however, their unconstrained sequence mutations alter layouts, introducing prefix mismatches and cache invalidation. This reveals a critical trade-off between text sparsity and prompt cache continuity. To address this, we present TokenPilot, a dual-granularity context management framework. Globally, Ingestion-Aware Compaction acts as a framework harness to stabilize prompt prefixes and eliminate open-world environmental noise at the ingestion gate. Locally, Lifecycle-Aware Eviction monitors the ongoing residual utility of context segments, enforcing a conservative batch-turn schedule to offload content segments only when task relevance expires. Experiments on PinchBench and Claw-Eval under both isolated and continuous modes demonstrate that TokenPilot reduces costs by 61% and 56% in isolated mode, and 61% and 87% in continuous mode, while maintaining competitive performance compared to prior systems. TokenPilot has been integrated into LightMem2 at https://github.com/zjunlp/LightMem2.


翻译:随着LLM代理被部署到长周期会话场景中,上下文累计导致推理成本急剧攀升。现有方法通过文本剪枝或动态内存驱逐来最小化令牌足迹,但其无约束的序列突变会改变数据布局,引发前缀不匹配与缓存失效问题,揭示了文本稀疏性与提示缓存连续性之间的关键权衡。为此,我们提出TokenPilot——一种双粒度上下文管理框架。在全局层面,引入感知型压缩机制作为框架约束装置,在接收入口稳定提示前缀并消除开放环境噪声;在局部层面,生命周期感知驱逐机制持续监控上下文段落的剩余效用,强制执行保守的批处理轮次调度策略,仅在任务相关性失效时卸载内容段落。在PinchBench与Claw-Eval基准的隔离与连续两种模式下实验表明:隔离模式下TokenPilot使成本降低61%与56%,连续模式下降低61%与87%,同时保持与先前系统相当的竞争性能。TokenPilot已集成至LightMem2,代码地址为https://github.com/zjunlp/LightMem2。

0
下载
关闭预览

相关内容

综述 | Always-On Agents:LLM智能体持久状态与治理
专知会员服务
22+阅读 · 6月30日
【推荐】用TensorFlow实现LSTM社交对话股市情感分析
机器学习研究会
11+阅读 · 2018年1月14日
干货|从LSTM到Seq2Seq
全球人工智能
15+阅读 · 2018年1月9日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
VIP会员
最新内容
乌克兰无人机饱和战场中的错误教训
专知会员服务
11+阅读 · 11月17日
面向最后一战术英里:美军无人机创新尝试
专知会员服务
7+阅读 · 11月17日
《美空军2026条令文件:对海压制作战》
专知会员服务
28+阅读 · 11月9日
人工智能与战争的未来
专知会员服务
11+阅读 · 11月8日
《Agent Mosaic:识别智能体LLM系统中的机密泄露》
专知会员服务
14+阅读 · 11月8日
人工智能在军事教育中的应用:若干视角与经验
专知会员服务
13+阅读 · 11月6日
相关基金
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员