atlas

Research map / Large language models / Retrieval and knowledge

Memory Decoder: A Pretrained, Plug-and-Play Memory for Large Language Models

NeurIPS 2025 · Large language models › Retrieval and knowledge · approach: Long-context and personalized retrieval · 0 citations (OpenAlex)

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Trains a small 0.5B transformer decoder to imitate kNN retriever distributions over a domain corpus, then interpolates it with frozen LLMs of the same tokenizer for plug-and-play domain adaptation without retrieval at inference.

Problem

Domain adaptation of LLMs is costly with full DAPT (catastrophic forgetting, per-model training) while RAG and kNN-LM add heavy inference latency and storage overhead from datastores and nearest-neighbor search.

Approach

Pretrain a compact parametric transformer decoder with a KL distribution-alignment loss (plus LM loss) to match kNN retriever distributions built from a domain datastore; at inference it is simply interpolated with any same-tokenizer LLM's output distribution, with no retrieval.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
augment GPT2-small with Memory DecoderGPT2-small · WikiText-103perplexity: 24.89 -> 13.36Helped
augment GPT2-medium with Memory DecoderGPT2-medium · WikiText-103perplexity: 18.29 -> 12.25Helped
augment GPT2-large with Memory DecoderGPT2-large · WikiText-103perplexity: 15.80 -> 11.53Helped
augment GPT2-xl with Memory DecoderGPT2-xl · WikiText-103perplexity: 14.39 -> 10.93Helped
augment GPT2-small with Memory DecoderGPT2-small · Downstream tasks (average)score: 67.45 -> 69.79Helped
augment Qwen2.5-7B with Memory DecoderQwen2.5-7B · Biomedicineperplexity: 8.19 -> 3.57Helped
augment Qwen2.5-7B with Memory DecoderQwen2.5-7B · Financeperplexity: 8.61 -> 3.42Helped
augment Qwen2.5-7B with Memory DecoderQwen2.5-7B · Lawperplexity: 5.94 -> 4.01Helped
transfer Memory Decoder to Llama3-8BLlama3-8B · Biomedicineperplexity: 7.95 -> 3.92Helped
transfer Memory Decoder to Llama3-8BLlama3-8B · Financeperplexity: 8.63 -> 4.32Helped
transfer Memory Decoder to Llama3-8BLlama3-8B · Lawperplexity: 5.96 -> 4.46; LoRA: 4.12Mixed
increase Memory Decoder size from 124M to 345M (ablation)Memory Decoder · WikiText-103average perplexity: 12.01 -> 11.26Helped

Surprising findings

Limitations

Experimental setup

Datasets: WikiText-103 MIMIC-III financial news Asylex SST-2 MR CR RT HYP CB RTE AGN

Benchmarks: WikiText-103 SST-2 MR CR RT HYP CB RTE AGN Yahoo MIMIC-III financial news

Metrics: perplexity accuracy latency overhead

Baselines: In-Context RAG kNN-LM DAPT LoRA

Builds on: kNN-LM Domain Adaptive Pretraining LoRA kNN-prompt

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy