# PEEK：面向长上下文LLM智能体的上下文映射缓存

- 来源：HuggingFace Daily Papers（社区热门论文）
- 发布时间：2026-05-19 08:00
- AIHOT 分数：69
- AIHOT 链接：https://aihot.virxact.com/items/cmpdlmhzw04yvslk1kp49soli
- 原文链接：https://arxiv.org/abs/2605.19932

## AI 摘要

针对现有方法在处理重复长外部上下文时未能有效保存和重用定向知识的问题，本文提出PEEK系统。该系统将关于上下文内容、组织方式及历史有用实体的知识缓存为一个小型固定大小的上下文映射，并置于智能体提示中，以持续辅助处理外部上下文。PEEK通过蒸馏、制图和驱逐模块的可编程缓存策略维护映射。实验表明，在长上下文推理和信息聚合任务上，PEEK相比强基线提升6.3-34.0%，迭代次数减少93-145次，成本比ACE低1.7-5.8倍；在上下文学习任务中，解决率和标准准确率分别提升6.0-14.0%和7.8-12.1%，成本降低1.4倍。这些成果在多种模型和智能体架构（包括OpenAI Codex）上均有效，证明了上下文映射能帮助智能体更准确高效地处理重复外部上下文。

## 正文

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.
