DeepSeek says its Engram lookup memory helps AI reasoning
On 12 January 2026 DeepSeek-AI and Peking University posted a preprint, not yet peer reviewed, that adds a lookup table to a language model. The module is called Engram. At 27 billion parameters, the authors report, it beat a mixture-of-experts model with the same parameters and the same compute, and the gains were not limited to knowledge tests: reasoning, code and maths improved too, BBH most of all.
In short
- The preprint ("Conditional Memory via Scalable Lookup: A New Axis of Sparsity for Large Language Models") adds a memory table to a Transformer. The table is read with a fixed-cost lookup keyed by the last two or three words, rather than computed.
- The authors compare Engram-27B with a mixture-of-experts model, MoE-27B, that has the same 26.7 billion parameters, 3.8 billion active per word and 262 billion training tokens.
- Reported gains: BBH +5.0, ARC-Challenge +3.7, HumanEval +3.0, MATH +2.4, against +4.0 on CMMLU, a knowledge test.
- A 100-billion-parameter table kept in ordinary host memory slowed inference by at most 2.8% in their test.
+5.0 BBH reasoning score over the MoE baseline; 84.2 to 97.0 Multi-Query needle-in-a-haystack; 20-25% share of sparse budget best given to memory; < 3% slowdown with a 100B table in host memory
The idea: stop re-computing facts
A language model has to do two different jobs, the authors argue. One is reasoning, which needs deep, step-by-step computation. The other is recalling fixed patterns: a named person, a set phrase, a formula. Those are local and stereotyped, and old-fashioned N-gram models (which just count which words follow the last N words) captured them cheaply. A standard Transformer has no lookup for this, so it spends its early layers rebuilding it. The paper's example is a multi-word name such as "Alexander the Great", which takes several early layers of attention and feed-forward computation to resolve.
Today's large models mostly use mixture-of-experts (MoE): the network holds many specialist sub-networks and only a few run for each word, so the model can be large without being slow (our summary). The authors call that conditional computation and propose conditional memory as a second kind of sparsity: only a few entries of a huge table are read for each word.
How does a lookup table work inside a language model?
Engram, in the paper's words, modernises classic N-gram embeddings. For each position, the last two and three tokens are hashed into slots of a large embedding table, and the slot contents are blended into the model's hidden state by a learned gate that depends on the surrounding context. Cost per word is constant (an O(1) lookup) however big the table is. The paper lists four adaptations: tokenizer compression (which shrinks the effective vocabulary of a 128k tokenizer by 23%, for example by merging "Apple" and " apple"), multi-head hashing, contextualized gating and multi-branch integration. In the 27B model Engram sits at layers 2 and 15, with N-grams up to size 3.
A U-shaped law for splitting the budget
The authors first ask how to divide a fixed pool of "inactive" parameters between experts and Engram memory. Validation loss traces a U against the share given to experts. A pure-MoE model is not the best: giving roughly 20% to 25% of the sparse budget to Engram worked best, and the optimum sat at about 75% to 80% experts across the two compute budgets tested. In the larger (10B-parameter, 6e20 FLOPs) regime loss fell from 1.7248 to 1.7109 at about 80%. Pushing too far the other way, to nearly all memory, hurt, because memory cannot replace computation.

Left: validation loss is lowest when about 20% to 25% of the sparse budget goes to memory, not zero. Right: with more memory slots the loss keeps falling in a straight line on a log scale. Cheng, Tian et al. (DeepSeek-AI and Peking University), arXiv:2601.07372, Fig. 3, CC BY 4.0.
What to notice: Lower loss is better. The left panel is the 'U' in the paper's U-shaped scaling law.
The 27B result
For the headline test, Engram-27B takes the MoE-27B design, cuts routed experts from 72 to 55 and spends the freed parameters on a 5.7-billion-parameter Engram table. Total parameters stay at 26.7B and active parameters at 3.8B. Iso-FLOPs means both models spend the same arithmetic on each word, so a gain cannot come from extra compute (our explanation).
The abstract and introduction give MMLU as +3.4, but the paper's own results table and its later text give 57.4 to 60.4, a gain of 3.0. We use the table. The other changes quoted here match the abstract.
BBH and ARC-Challenge gained more than the knowledge tests MMLU and CMMLU did, which the authors say they had not expected; code and maths gains (HumanEval +3.0, MATH +2.4) were similar to or smaller than the knowledge gains. Their analysis, using LogitLens and CKA probes, suggests Engram relieves the early layers of reconstructing static facts, "effectively deepening the network" for harder reasoning. That is the authors' interpretation of internal measurements, not something we could test.
Long context moved too. After the same context-extension training, Engram-27B scored 97.0 on RULER's Multi-Query needle-in-a-haystack against 84.2 for the baseline, and 89.0 against 77.0 on Variable Tracking. The authors argue that handing local patterns to lookups frees attention for global context. A larger Engram-40B (18.5B memory parameters, 39.5B in total) improved loss further but did not beat Engram-27B on every benchmark.
Memory that can live off the GPU
Because the slot to read depends only on the input tokens, not on the model's hidden state, the system knows which entries it needs before the layer runs and can fetch them while earlier layers compute. The authors tested a 100B-parameter Engram table kept entirely in host memory on NVIDIA H800 GPUs, 512 sequences per run.
The penalty peaked at 2.8% on the 8B model (our arithmetic agrees: 6,140.02 is 97.2% of 6,315.52). The authors call this a conservative setup, since every lookup crossed the PCIe bus. Note that these runs used dense base models, not the 27B MoE.
Terms in plain English
- Mixture-of-experts (MoE): a network of many specialist parts where only a few run for each word (our wording).
- N-gram: a short run of N consecutive words or tokens, used as a key to look something up (our wording).
- Embedding table: a big list of numeric vectors, one per key (our wording).
- Iso-parameter, iso-FLOPs: same total size and same arithmetic per word, so the comparison is fair (our wording).
- Needle in a haystack: a test where the model must find a small fact buried in a very long text (our wording).
Where things stand
This is a preprint from the authors' own lab, with no independent replication that we read. The comparison is against the authors' own MoE baseline at one scale. The arXiv page shows the paper was revised on 12 July 2026 (v2); we read v2. DeepSeek's code on GitHub (Apache 2.0 licence for the repository, a separate model licence for models) says it is a demonstration that mocks the Attention, MoE and mHC parts to show the Engram data flow, so it does not reproduce the 27B results. The authors say they see conditional memory as "an indispensable modeling primitive for next-generation sparse models".
Sources
- Conditional Memory via Scalable Lookup: A New Axis of Sparsity for Large Language Models, Cheng, Tian et al., DeepSeek-AI and Peking University, arXiv, 12 January 2026 (v2 12 July 2026)
- deepseek-ai/Engram, GitHub README
On 22 November 2026 we read the abstract, results and throughput sections of the paper and the code README. Cover image: Figure 1 of the paper, CC BY 4.0, Cheng, Tian et al.
Sources
- Conditional Memory via Scalable Lookup: A New Axis of Sparsity for Large Language Models
- deepseek-ai/Engram code repository
Related stories
- DeepSeek's open models grow to 1.6 trillion parameters in a year
- Baidu releases ERNIE 5.5 Flash Preview, an open 280B model
- DeepSeek opens chatbot web search and OCR to developers
- Word meaning in human neurons lines up best with GPT-2 embeddings
- DeepSeek releases V4.1-Flash, a 510 GB open model under MIT
- DeepSeek releases V4.1-Flash, an open multimodal model