TL;DR: LUMIA Lab (School of AI, Shanghai Jiao Tong University + Shanghai AI Laboratory) has published Deep Fusion Memory on arXiv — a parametric memory architecture that answers questions over an external knowledge corpus without a single retrieval query at inference. A small predictor model learns to “predict memory” from context, and the result is fused into the host LLM’s hidden states through gated cross-attention. Across six QA benchmarks, DFM beats the strongest baseline by 12.71% (Mistral-7B) and 11.19% (Qwen3-8B), while building its training data with 32× fewer retrieval queries and 2048× fewer retrieved items than its predecessors. The authors promise to release the code.
Three ways to give a model knowledge — and the price of each
LLMs have a fundamental gap: everything a model knows is whatever made it into pretraining. From there, it’s trade-offs all the way down.
Continued pretraining (CPT) and LoRA bake a new corpus into the weights. Inference stays self-contained, but there are two problems: catastrophic forgetting (in DFM’s experiments, continued pretraining of Qwen3-8B on Wikipedia dropped the average QA score from 22.71 to 15.13 — the model simply lost part of its abilities) and the impossibility of “extracting” a single fact back out.
RAG and its relatives (xRAG, RETRO) leave the weights alone: they retrieve relevant fragments per query and feed them into the context or cross-attention. Knowledge stays fresh and updatable, but every answer means a datastore round-trip, latency, and infrastructure. And retrieval isn’t free even on quality: in the authors’ table, RAG on Qwen3-8B scored worse than the bare model with no memory at all (20.86 vs 22.71).
Parametric memory (MLP Memory, Memory Decoder) tries to eat both cakes: run the corpus through a retriever offline, ahead of time, and train a module that predicts “what search would have found.” No retrieval at inference. But previous approaches have two pain points: supervision is built at the token level (the retriever is queried at every corpus position — an astronomical workload), and the fusion is shallow: the memory’s probabilities are simply interpolated with the LLM’s output, so the model’s layers never “digest” that memory.

How DFM works
The authors moved both boundaries — construction and fusion.
Chunk-level memory. Text is split into non-overlapping 32-token chunks. For each chunk, an offline retriever searches the corpus once for top-16 neighbors (embeddings from Qwen3-Embedding-0.6B) — and this “target memory” serves as the ground truth for every token in the chunk at once. Hence the core savings: one query per 32 tokens instead of one per token.
The memory predictor. A small standalone causal transformer looks at the embeddings of previous chunks and generates 16 memory vectors for the next one. It’s trained on two signals at once: the standard language-modeling loss plus an MSE against the retriever’s target memory.
Deep fusion. The predicted memory passes through a shared projector (LayerNorm → linear → GELU → linear) and is fed into four selected decoder layers (9, 16, 24, 31 of 32) via cross-attention — in parallel with self-attention, into the same residual stream. A sigmoid gate on each attention head decides how much memory to let through: a token that doesn’t need memory simply closes it.
Frozen backbone. The Mistral/Qwen weights are never touched — only the predictor, projectors, and gates are trained. No forgetting by construction. Added parameters: 0.75B on a 7–8B backbone (about 10%).
Inference is empty. No datastore, no search, no external encoder. The predictor computes memory from the prompt itself, and the model answers.
Numbers
Six QA benchmarks (NQ, WebQA — single-hop; HotpotQA, 2Wiki, MuSiQue, Bamboogle — multi-hop), trained on the December 2018 English Wikipedia (~4B tokens):
| Method (Mistral-7B-v0.3) | Average score |
|---|---|
| Base model | 13.63 |
| RAG | 23.41 |
| xRAG | 24.14 |
| MLP Memory | 22.09 |
| DFM | 27.21 |

Notably, brute-force backbone adaptation loses to everything: CPT on Qwen3-8B scores 15.13 — 7.58 points below the unmodified model. Memory “welded” wholesale into the weights breaks what the model could do.
Beyond QA, the authors tested domain adaptation — code (HumanEval/HumanEval+), math (GSM8K), law (LawBench). DFM delivers an average of +6.51 points over Qwen3-4B-Base and +4.38 over Qwen3-8B-Base — so the gains transfer beyond “Wikipedia questions.”
Construction economics: against token-level predecessors — 32× fewer retrieval queries and 2048× fewer retrieved items when preparing training data. Training: one epoch on 16×A800 GPUs.

Honest caveats
- The corpus is Wikipedia-2018; the tasks are academic QA. That’s a clean, measurable testbed — not agentic work on live code. How DFM behaves on your repository is unknown.
- No code yet. “Will be released soon” — a classic. Independent verification doesn’t exist.
- Memory is frozen at training time. A new fact in the corpus means a new construction and training run. This isn’t an editable knowledge base — it’s an imprint of a corpus.
- +10% parameters and a separate training pipeline — not free, even if cheaper than predecessors.
- Ablations show the result is sensitive to which layers receive memory and how the gates are initialized. Not exactly “flip a switch and it works.”
Why this matters to us
DFM is memory about the world: whatever the corpus learned, baked into weights. Its limits are visible right in the architecture: it can’t know what your agent decided yesterday in your project, because that never existed in any corpus. It can’t forget a single fact — only retrain. It can’t tell “current as of today” from “stale since March.”
That’s not a competitor — it’s a neighboring layer. Weight-space memory answers “what is generally known”; agent memory answers “what we did, what we decided, and why.” The first is baked in a lab; the second is written by the agent itself, every day, and it should live on your machine under your control. That second layer is what MaxGraph does — with dates, invalidation of stale facts, and a living graph you can open and inspect.
FAQ
Is this a RAG replacement? For knowledge from a fixed public corpus — a strong candidate: retrieval-free inference and higher scores. But the corpus is frozen at training time, so for fresh or private data, RAG (or agent memory) is still needed.
Can you bake your own codebase into a model? Technically yes — the paper’s domain adaptation shows +4–6 points on code. But every repository update requires a new training run. For a living project, external memory the agent updates itself is cheaper.
What does it cost in hardware? Training: one epoch on 16 A800 (80GB) GPUs, plus offline target-memory construction with a retriever. Inference is nearly free: +0.75B parameters on a 7–8B model, no retrieval stack.
Where do I get it? The paper is on arXiv: 2610.25100. Code is promised — watch the links in the paper.
What’s next
- 8 memory layers for AI agents: an honest comparison
- Graph or vectors: how agent memory works
- Why AI agents forget everything
MaxGraph — memory for AI agents: local, private, with a living knowledge graph. 7 days free.
Give your agent memory
7-day trial, no card. Installation is one prompt — your agent does the rest.