Deep Fusion Memory: A Chunk-Level Parametric Memory for Large Language Models
Organizations: LUMIA Lab, School of Artificial Intelligence, Shanghai Jiao Tong University · Shanghai Artificial Intelligence Laboratory
Abstract
Large language models need effective ways to acquire and use external knowledge beyond what they retain from pretraining. Continued pretraining risks catastrophic forgetting, while retrieval at inference time can add substantial overhead. External parametric memory avoids online retrieval, but constructing its training data requires extensive offline search, and output-level interpolation provides only shallow fusion. We introduce Deep Fusion Memory (DFM), a parametric memory architecture that reduces this construction workload and incorporates learned memory into intermediate hidden states. A causal memory predictor learns to generate memory from the preceding context, using retrieved chunk embeddings from the corpus as supervision. The predicted memory is shared across tokens within each chunk and fused into their hidden states through gated cross-attention. Memory prediction and fusion are trained end to end with the backbone frozen, and inference requires no explicit retrieval. Compared with existing parametric memory approaches, which often construct token-level memory targets, DFM requires fewer retrieval queries and fewer retrieved items to construct its training data. Across six QA tasks, DFM performs better over the strongest baseline by 12.71% on Mistral-7B-v0.3 and 11.19% on Qwen3-8B-Base. Beyond QA, domain adaptation yields average gains of 6.51 and 4.38 points over Qwen3-4B-Base and Qwen3-8B-Base, respectively.
Figures & tables
| Method | Single-hop QA | Multi-hop QA | Avg | ||||
|---|---|---|---|---|---|---|---|
| NQ | WebQA | HotpotQA | 2Wiki | MuSiQue | Bamboogle | ||
| Mistral-7B-v0.3 | |||||||
| Base | 20.30 | 29.28 | 20.96 | 5.87 | 1.43 | 3.91 | 13.63 |
| Non-parametric methods | |||||||
| RAG | 24.03 | 27.90 | 29.09 | 31.02 | 9.87 | 18.56 | 23.41 |
| xRAG | 27.39 | 40.06 | 27.55 | 27.78 | 9.57 | 12.51 | 24.14 |
| Method | Code | Math | Law | Avg | |
|---|---|---|---|---|---|
| HumanEval | HumanEval+ | GSM8K | LawBench | ||
| Qwen3-4B-Base | |||||
| Base | 62.04 | 57.32 | 83.40 | 29.96 | 58.18 |
| RAG | 62.80 | 55.49 {}_{{\color[rgb]{1,0.2,0.2}\text{\textminus{}1.83}}} | 84.99 | 24.35 {}_{{\color[rgb]{1,0.2,0.2}\text{\textminus{}5.61}}} | 56.91 {}_{{\color[rgb]{1,0.2,0.2}\text{\textminus{}1.27}}} |
| CPT | 66.62 | 58.54 | 84.84 | 41.66 | 62.92 |
| LoRA | 59.45 {}_{{\color[rgb]{1,0.2,0.2}\text{\textminus{}2.59}}} | 58.54 | 85.37 | 39.43 | 60.70 |
| Gate | NQ | WebQA | HotpotQA | 2Wiki | MuSiQue | Bamboogle | Avg |
|---|---|---|---|---|---|---|---|
| No gate | 34.08 | 42.72 | 29.80 | 24.94 | 10.08 | 19.35 | 26.83 |
| 32.34 | 42.18 | 28.54 | 23.55 | 9.03 | 14.94 | 25.10 | |
| 32.70 | 42.22 | 29.39 | 25.98 | 10.42 | 19.70 | 26.73 | |
| 33.57 | 42.47 | 29.53 | 25.00 | 10.05 | 22.65 | 27.21 | |
| 34.59 | 42.13 | 30.38 | 29.68 | 10.94 | 19.69 | 27.90 |
Appendix figures & tables13 assets
Supplementary material from the paper’s appendix.
Appendix
| Dataset | Split | Samples | Metric | Max. tokens |
|---|---|---|---|---|
| NQ | Test | 3,610 | F1 | 15 |
| WebQA | Test | 2,032 | Substring match | 100 |
| HotpotQA | Validation | 7,405 | F1 | 15 |
| 2Wiki | Validation | 12,576 | F1 | 32 |
| MuSiQue | Validation | 2,417 | F1 | 32 |
| Bamboogle | Test | 125 | F1 | 32 |
| Method | Single-hop QA | Multi-hop QA | Avg | ||||
|---|---|---|---|---|---|---|---|
| NQ | WebQA | HotpotQA | 2Wiki | MuSiQue | Bamboogle | ||
| OLMo-3-1025-7B | |||||||
| Base | 21.69 | 40.31 | 27.99 | 11.05 | 4.67 | 2.25 | 17.99 |
| RAG | 22.57 | 31.50 | 21.97 | 7.91 | 2.58 | 2.75 | 14.88 {}_{{\color[rgb]{1,0.2,0.2}\text{\textminus{}3.11}}} |
| xRAG | 23.64 | 34.79 | 26.33 | 23.15 | 11.95 | 16.65 | 22.75 |
| RETRO | 21.61 | 38.09 | 27.97 | 29.90 | 11.61 | 12.57 | 23.63 |
| ID | Task | Description |
|---|---|---|
| Legal Knowledge Memorization | ||
| 1-1 | Article Recitation | Recall a specified law article. |
| 1-2 | Knowledge Question Answering | Answer a legal multiple-choice question. |
| Legal Knowledge Understanding | ||
| 2-1 | Document Proofreading | Correct errors in a legal sentence. |
| 2-2 | Dispute Focus Identification | Identify issues disputed by the parties. |
| Task | Base | RAG | CPT | LoRA | DFM |
|---|---|---|---|---|---|
| 1-1 | 18.76 | 11.41 | 42.46 | 31.70 | 22.23 |
| 1-2 | 6.20 | 20.00 | 27.00 | 28.20 | 31.60 |
| 2-1 | 16.83 | 20.06 | 26.82 | 35.36 | 24.13 |
| 2-2 | 12.20 | 0.60 | 31.40 | 23.80 | 35.60 |
| 2-3 | 32.73 | 16.10 | 32.75 | 30.16 | 38.97 |
| 2-4 | 0.00 | 0.20 | 34.00 | 33.40 | 30.80 |
| Task | Base | RAG | CPT | LoRA | DFM |
|---|---|---|---|---|---|
| 1-1 | 16.72 | 8.99 | 54.57 | 54.15 | 29.71 |
| 1-2 | 70.60 | 17.20 | 32.20 | 30.00 | 53.80 |
| 2-1 | 20.74 | 21.89 | 38.60 | 27.72 | 30.85 |
| 2-2 | 0.20 | 0.40 | 14.60 | 9.60 | 36.80 |
| 2-3 | 16.01 | 16.41 | 46.21 | 40.52 | 52.40 |
| 2-4 | 0.00 | 0.00 | 33.80 | 35.00 | 34.40 |
| Learning rate | NQ | WebQA | HotpotQA | 2Wiki | MuSiQue | Bamboogle | Avg |
|---|---|---|---|---|---|---|---|
| 33.47 | 41.93 | 29.18 | 28.60 | 10.43 | 19.00 | 27.10 | |
| 33.57 | 42.47 | 29.53 | 25.00 | 10.05 | 22.65 | 27.21 |
| Projector | NQ | WebQA | HotpotQA | 2Wiki | MuSiQue | Bamboogle | Avg |
|---|---|---|---|---|---|---|---|
| Per-layer | 32.98 | 43.21 | 29.88 | 26.35 | 10.18 | 18.70 | 26.88 |
| Shared | 33.57 | 42.47 | 29.53 | 25.00 | 10.05 | 22.65 | 27.21 |
| Predictor | NQ | WebQA | HotpotQA | 2Wiki | MuSiQue | Bamboogle | Avg |
|---|---|---|---|---|---|---|---|
| 14 layers | 34.27 | 41.83 | 30.14 | 26.31 | 10.30 | 21.03 | 27.31 |
| 56 layers | 33.89 | 42.18 | 29.58 | 25.10 | 10.14 | 17.91 | 26.47 |
| 28 layers | 33.57 | 42.47 | 29.53 | 25.00 | 10.05 | 22.65 | 27.21 |
| Objective | NQ | WebQA | HotpotQA | 2Wiki | MuSiQue | Bamboogle | Avg |
|---|---|---|---|---|---|---|---|
| Cosine | 33.02 | 42.86 | 29.40 | 25.49 | 10.04 | 20.42 | 26.87 |
| Raw MSE | 33.57 | 42.47 | 29.53 | 25.00 | 10.05 | 22.65 | 27.21 |
| Quantity | MLP Memory | DFM | Basis |
|---|---|---|---|
| Added parameters (B) | 1.50 | 0.75 | Configuration |
| A800 GPUs | 16 | 16 | Configuration |
| Measured training hours | 64 | 24 | Timing |
| Training GPU-hours | 1,024 | 384 | GPUs hours |
| Target queries | 4B | 125M | Workload count |
| Neighbors per query | 1,024 | 16 | Configuration |
Memory-Augmented Language Models
Memory-augmented language models combine persistent or temporary memory with neural computation to retain, retrieve, and use information beyond the active context.
See all 292 papers