From Lookups to Lessons: Turning Retrieved Knowledge into Parametric Memory
On the map: Retrieval-augmented generation → Generation and context integration
Abstract (arXiv)
Retrieval-augmented generation (RAG) helps large language models (LLMs) answer factual questions beyond their training data, but it adds storage and inference costs. Distilling previously retrieved information into parametric memories enables reuse without online retrieval. However, training the memory to mimic a retriever rewards accurate independent predictions, which do not necessarily improve the final output quality when combined with the LLM's existing predictions. To address this, we introduce ResMem, in which the LLM reads retrieved text offline to generate teacher targets. This design avoids storing massive token representations, unlike existing parametric memory approaches such as MLP Memory, which relies on k-nearest neighbor (kNN) datastores. Furthermore, by using the LLM as an offline teacher that reads privileged retrieved evidence alongside the input, we train a parametric memory to learn an additive logit residual. This residual aligns the predictions of a student sharing the same backbone with the teacher distribution, while self-distillation updates remain confined to the parametric memory. On a Wikipedia subset, ResMem reduces the storage retained for teacher construction by 94.7% compared with the evaluated kNN pipeline. Across five question answering datasets, ResMem raises mean token F1 from 32.83% for the frozen LLM to 34.48%. It also breaks 21% fewer of the LLM's correct answers than a kNN-trained memory. These findings validate our motivation of treating retrieval as a learning resource, with parametric memory shaped by how retrieved knowledge is used to inform the model's future predictions. Code and model weights are available at https://github.com/SSRand/From-Lookups-to-Lessons and https://huggingface.co/RandHan/ResMem-Mistral-7B-v0.3.
Key facts. No citing papers in the map yet (data through 24 Nov 2026). Placed in Generation and context integration, one of 15 directions in Retrieval-augmented generation. Builds on 46 of its 53 references that are in the map. Submitted 30 Oct 2026.
Builds on
46 of 53 references.
Closest ancestors · 7
Same direction, newest first
- 2025MLP Memory: A Retriever-Pretrained Memory for Large Language Models3 Aug
- 2024xRAG: Extreme Context Compression for Retrieval-augmented Generation with One Token22 May
- 2023InstructRetro: Instruction Tuning post Retrieval-Augmented Pretraining11 Oct
- 2023Why do Nearest Neighbor Language Models Work?7 Jan
- 2022When Not to Trust Language Models: Investigating Effectiveness of Parametric and Non-Parametric Memories20 Dec
- 2022Atlas: Few-shot Learning with Retrieval Augmented Language Models5 Aug
- 2020Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks22 May
Other references · 39
- 2015Distilling the Knowledge in a Neural Networkcited by 10,967
- 2018HotpotQA: A Dataset for Diverse, Explainable Multi-hop Question Answeringcited by 3,986
- 2023Generative Agents: Interactive Simulacra of Human Behaviorcited by 3,841
- 2023Lost in the Middle: How Language Models Use Long Contextscited by 3,765
- 2017TriviaQA: A Large Scale Distantly Supervised Challenge Dataset for Reading Comprehensioncited by 3,109
- 2017Billion-scale similarity search with GPUscited by 2,575
- 2023MemGPT: Towards LLMs as Operating Systemscited by 1,655
- 2019Root Mean Square Layer Normalizationcited by 1,624
- 2020Transformer Feed-Forward Layers Are Key-Value Memoriescited by 1,424
- 2021Improving language models by retrieving from trillions of tokenscited by 1,328
- 2023On-Policy Distillation of Language Models: Learning from Self-Generated Mistakescited by 1,201
- 2019Generalization through Memorization: Nearest Neighbor Language Modelscited by 835
27 more
- 2024A Survey on the Memory Mechanism of Large Language Model based Agentscited by 683
- 2022Contrastive Decoding: Open-ended Text Generation as Optimizationcited by 640
- 2018Born Again Neural Networkscited by 578
- 2026Self-Distilled Reasoner: On-Policy Self-Distillation for Large Language Modelscited by 573
- 2021DExperts: Decoding-Time Controlled Text Generation with Experts and Anti-Expertscited by 458
- 2024Learning to (Learn at Test Time): RNNs with Expressive Hidden Statescited by 415
- 2024Titans: Learning to Memorize at Test Timecited by 383
- 2023HaluEval: A Large-Scale Hallucination Evaluation Benchmark for Large Language Modelscited by 371
- 2023Trusting Your Evidence: Hallucinate Less with Context-aware Decodingcited by 357
- 2015Unifying distillation and privileged informationcited by 272
- 2020Nearest Neighbor Machine Translationcited by 217
- 2022Learning by Distilling Contextcited by 180
- 2025Cartridges: Lightweight and general-purpose long context representations via self-studycited by 102
- 2024Tuning Language Models by Proxycited by 100
- 2021Efficient Nearest Neighbor Language Modelscited by 95
- 2021Adaptive Nearest Neighbor Machine Translationcited by 60
- 2025Parametric Retrieval Augmented Generationcited by 41
- 2026OPSDL: On-Policy Self-Distillation for Long-Context Language Modelscited by 35
- 2022QUILL: Query Intent with Large Language Models using Retrieval Augmentation and Multi-stage Distillationcited by 23
- 2025Memory Decoder: A Pretrained, Plug-and-Play Memory for Large Language Modelscited by 21
- 2026δ-mem: Efficient Online Memory for Large Language Modelscited by 19
- 2022Nearest Neighbor Knowledge Distillation for Neural Machine Translationcited by 11
- 2026TS-Memory: Plug-and-Play Memory for Time Series Foundation Modelscited by 6
- 2026MemSFT: Mitigating Alignment Tax with an External Parametric Memorycited by 5
- 2026Memory Decoder at Scale: A Pretrained, Parametric Long-Term Memorycited by 3
- 2026TransMem: Transforming Hidden States into Memory for Large Language Modelscited by 3
- 2026Learning What to Remember: Test-Time Training via Context Distillationcited by 3
Built on by
Not cited yet.
Similar, not cited
Close in wording, no citation either way
- 2025Dynamic Parametric Retrieval Augmented Generation for Test-time Knowledge Enhancement
- 2026To Memorize or to Retrieve: Scaling the Interaction Between Pretraining and Retrieval
- 2024Quantifying reliance on external information over parametric knowledge during Retrieval Augmented Generation (RAG) using mechanistic analysis
- 2024From RAGs to rich parameters: Probing how language models utilize external knowledge over parametric information for factual queries
- 2024Memory3: Language Modeling with Explicit Memory
- 2024Unsupervised Information Refinement Training of Large Language Models for Retrieval-Augmented Generation
- 2024Let your LLM generate a few tokens and you will reduce the need for retrieval
- 2026TokenMem: Faithful Knowledge Injection for Frozen LLMs