用结构化记忆让模型持续学习,推理更高效准确
Panini: Continual Learning in Token Space via Structured Memory
- 将文档转为问答网络存入外部记忆,避免重复推理
- 六项基准测试平均提升5%-7%,上下文令牌减少2-30倍
- 适合需要长期知识更新的开放源码应用
语言模型越来越多地用于推理未训练过的内容,如新文档、动态知识和用户特定数据。常见方法是检索增强生成(RAG),将原文档作为块外部存储,并在推理时仅检索相关子集供大模型推理。但该方法导致测试时计算效率低(大模型反复推理相同文档);且块检索可能引入无关上下文,增加不支持生成的风险。我们提出一种类人类的非参数化持续学习框架,基础模型保持固定,学习通过将每次新经验整合到持续积累与巩固的外部语义记忆状态中实现。我们提出Panini,其通过将文档表示为生成语义工作区(GSW)——一种实体与事件感知的问答对网络,足以让大模型重建所经历情境,并通过基于推理的链式推导挖掘隐含知识。给定查询时,Panini仅遍历持续更新的GSW(而非原始文档或块),并检索最可能的推理链。在六项问答基准上,Panini平均性能最高,比其他基线高5%-7%,同时使用2-30倍更少的答案上下文令牌,支持全开源流程,并减少对预设不可回答问题的错误答案。结果表明,写入时对经验的高效结构化(如GSW框架)能带来读取时的效率与可靠性提升。代码见https://github.com/roychowdhuryresearch/gsw-memory。
原文摘要 · Abstract (English)
Language models are increasingly used to reason over content they were not trained on, such as new documents, evolving knowledge, and user-specific data. A common approach is retrieval-augmented generation (RAG), which stores verbatim documents externally (as chunks) and retrieves only a relevant subset at inference time for an LLM to reason over. However, this results in inefficient usage of test-time compute (LLM repeatedly reasons over the same documents); moreover, chunk retrieval can inject irrelevant context that increases unsupported generation. We propose a human-like non-parametric continual learning framework, where the base model remains fixed, and learning occurs by integrating each new experience into an external semantic memory state that accumulates and consolidates itself continually. We present Panini, which realizes this by representing documents as Generative Semantic Workspaces (GSW) -- an entity- and event-aware network of question-answer (QA) pairs, sufficient for an LLM to reconstruct the experienced situations and mine latent knowledge via reasoning-grounded inference chains on the network. Given a query, Panini only traverses the continually-updated GSW (not the verbatim documents or chunks), and retrieves the most likely inference chains. Across six QA benchmarks, Panini achieves the highest average performance, 5%-7% higher than other competitive baselines, while using 2-30x fewer answer-context tokens, supports fully open-source pipelines, and reduces unsupported answers on curated unanswerable queries. The results show that efficient and accurate structuring of experiences at write time -- as achieved by the GSW framework -- yields both efficiency and reliability gains at read time. Code is available at https://github.com/roychowdhuryresearch/gsw-memory.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。