arXiv:2508.01832cs.CL2025-08被引 12

用轻量MLP模拟检索行为,让大模型高效记住知识

MLP Memory: A Retriever-Pretrained Memory for Large Language Models

  • 用MLP预训练模仿kNN检索,实现可微的参数化记忆
  • 在多个数据集上提升17.5%~24.1%性能,降低幻觉10分
  • 推理速度比RAG快2.5倍,适合需要快速准确的场景

当前增强大模型事实准确性与知识利用的方法存在根本权衡:非参数检索增强生成(RAG)虽灵活但推理延迟高、集成浅;参数化微调如LoRA则易导致灾难性遗忘和通用能力下降。本文提出MLP Memory,一种轻量级参数化模块,学习内化检索模式而无需显式文档访问。通过在预训练数据集上预训练MLP以模仿kNN检索器行为,构建可微记忆组件,将该模块与Transformer解码器通过简单概率插值融合,在WikiText-103和Web数据集上分别实现17.5%和24.1%的性能提升,五个问答基准相对提升12.3%,九个通用NLP任务绝对增益5.2点,同时在HaluEval上将幻觉降低最多10分。此外,该方法推理速度达RAG的2.5倍,兼具高效与高精度。结果表明,参数化学习检索模式可有效弥合高效推理与有效知识访问间的差距,为RAG与微调提供实用替代方案。

原文摘要 · Abstract (English)

Modern approaches to enhancing Large Language Models' factual accuracy and knowledge utilization face a fundamental trade-off: non-parametric retrieval-augmented generation (RAG) provides flexible access to external knowledge but suffers from high inference latency and shallow integration, while parametric fine-tuning methods like LoRA risk catastrophic forgetting and degraded general capabilities. In this work, we propose MLP Memory, a lightweight parametric module that learns to internalize retrieval patterns without explicit document access. By pretraining an MLP to imitate a $k$NN retriever's behavior on the entire pretraining dataset, we create a differentiable memory component that captures the benefits of retrieval-based knowledge access in a fully parametric form. Our architecture integrates this pretrained MLP Memory with Transformer decoders through simple probability interpolation, yielding 17.5\% and 24.1\% scaling gains on WikiText-103 and Web datasets, respectively. It further achieves 12.3\% relative improvement on five question-answering benchmarks and 5.2 points absolute gain across nine general NLP tasks, while reducing hallucinations by up to 10 points on HaluEval. Moreover, MLP Memory delivers 2.5$\times$ faster inference than RAG with superior accuracy. Our findings show that learning retrieval patterns parametrically bridges the gap between efficient inference and effective knowledge access, offering a practical alternative to both RAG and fine-tuning approaches.

知识记忆参数化高效推理大模型

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