arXiv:2505.14398cs.CLcs.AI2025-05被引 5

让AI在答题时复用过往推理过程,提升新问题解决能力。

Log-Augmented Generation: Scaling Test-Time Reasoning with Reusable Computation

  • 用键值缓存存储历史任务的完整推理过程
  • 测试时检索过往计算结果,显著提升新任务准确率
  • 适合需要持续学习与推理的智能体系统

尽管人类能从经验中自然学习和适应,大型语言模型及其代理系统却难以保留以往任务的推理能力并在未来情境中应用。为此,我们提出一种新框架——日志增强生成(LAG),在测试时直接复用过往任务的日志计算与推理过程,以增强模型从过去任务中学习并应对新挑战的能力,同时保持高效与可扩展性。具体而言,系统使用键值(KV)缓存表示任务日志,编码先前任务的完整推理上下文,仅对部分关键标记存储KV缓存。当遇到新任务时,LAG从相关日志中检索KV值以增强生成。该方法区别于基于反思的记忆机制,无需额外的知识提取或蒸馏步骤即可直接复用推理过程;也超越了传统仅用于效率优化的KV缓存技术,旨在提升准确性。在知识密集型与推理密集型数据集上的实验表明,本方法显著优于不使用日志的标准代理系统,以及基于反思和现有缓存技术的方案。

原文摘要 · Abstract (English)

While humans naturally learn and adapt from past experiences, large language models (LLMs) and their agentic counterparts struggle to retain reasoning from previous tasks and apply them in future contexts. To address this limitation, we propose a novel framework, log-augmented generation (LAG) that directly reuses prior computation and reasoning from past logs at test time to enhance model's ability to learn from previous tasks and perform better on new, unseen challenges, all while keeping the system efficient and scalable. Specifically, our system represents task logs using key-value (KV) caches, encoding the full reasoning context of prior tasks while storing KV caches for only a selected subset of tokens. When a new task arises, LAG retrieves the KV values from relevant logs to augment generation. Our approach differs from reflection-based memory mechanisms by directly reusing prior reasoning and computations without requiring additional steps for knowledge extraction or distillation. Our method also goes beyond existing KV caching techniques, which primarily target efficiency gains rather than improving accuracy. Experiments on knowledge- and reasoning-intensive datasets demonstrate that our method significantly outperforms standard agentic systems that do not utilize logs, as well as existing solutions based on reflection and KV cache techniques.

推理增强记忆机制LLM测试时学习

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。