arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2605.19932cs.AIcs.CLcs.LG
收藏

PEEK:上下文地图作为长上下文LLM代理的导向缓存

PEEK: Context Map as an Orientation Cache for Long-Context LLM Agents

MIT CSAIL(麻省理工学院计算机科学与人工智能实验室);Stanford University(斯坦福大学)

Zhuohan Gu, Qizheng Zhang, Omar Khattab, Samuel Madden

AI总结:

本文提出PEEK系统,通过上下文地图缓存和维护导向知识,提升长上下文LLM代理在重复外部上下文中的交互准确性和效率,相比基线方法在推理和上下文学习任务中均取得显著提升。

摘要:

大型语言模型(LLM)代理越来越多地在长且重复的外部上下文中操作,如文档语料库和代码仓库。在多次调用中,现有方法保留的是代理的轨迹、对原始材料的被动访问或任务级别的策略。但它们没有保留我们认为对于重复相同上下文工作负载最需要的:关于重复上下文本身的可重用导向知识(例如,上下文包含什么、如何组织,以及哪些实体、常量和模式历史上有用)。我们引入PEEK,一种系统,通过上下文地图缓存和维护这种导向知识:一个在代理提示中始终存在的小而固定大小的artifact,使代理能够持续查看外部上下文。该地图由一个可编程的缓存策略维护,包含三个模块:一个Distiller从推理时间信号中提取可转移的知识,一个Cartographer将其转换为结构化的编辑,以及一个基于优先级的Evictor强制执行固定的token预算。在长上下文推理和信息聚合中,PEEK在强基线方法上提高了6.3-34.0%,同时使用93-145次更少的迭代,并且成本比最先进的提示学习框架ACE低1.7-5.8倍。在上下文学习中,PEEK在解决率和评分准确性上分别提高了6.0-14.0%和7.8-12.1%,且成本比ACE低1.4倍。这些收益在不同语言模型和代理架构上均能泛化,包括生产级的OpenAI Codex。这些结果表明,上下文地图有助于长上下文LLM代理更准确、更高效地与重复的外部上下文交互。

英文摘要:

Large language model (LLM) agents increasingly operate over long and recurring external contexts, like document corpora and code repositories. Across invocations, existing approaches preserve either the agent's trajectory, passive access to raw material, or task-level strategies. None of them preserves what we argue is most needed for repeated same-context workloads: reusable orientation knowledge (e.g., what the context contains, how it is organized, and which entities, constants, and schemas have historically been useful) about the recurring context itself. We introduce PEEK, a system that caches and maintains this orientation knowledge as a context map: a small, constant-sized artifact in the agent's prompt that gives it a persistent peek into the external context. The map is maintained by a programmable cache policy with three modules: a Distiller that extracts transferable knowledge from inference-time signals, a Cartographer that translates it into structured edits, and a priority-based Evictor that enforces a fixed token budget. On long-context reasoning and information aggregation, PEEK improves over strong baselines by 6.3-34.0% while using 93-145 fewer iterations and incurring 1.7-5.8x lower cost than the state-of-the-art prompt-learning framework, ACE. On context learning, PEEK improves solving rate and rubric accuracy by 6.0-14.0% and 7.8-12.1%, respectively, at 1.4x lower cost than ACE. These gains generalize across LMs and agent architectures, including OpenAI Codex, a production-grade coding agent. Together, these results show that a context map helps long-context LLM agents interact with recurring external contexts more accurately and efficiently.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑