Open Interpretability Models Contributors Research Posts About

Conditional Memory via Scalable Lookup (Engram)

Source

Citation. Xin Cheng, Rui Tian and 19 others (Peking University, DeepSeek-AI). "Conditional Memory via Scalable Lookup: A New Axis of Sparsity for Large Language Models". arXiv 2601.07372v2, 12 July 2026 (v1 12 January 2026). Paper, code.

Status. Not applicable. It is a preprint on model architecture, with no venue given. It trains new models with an added memory module, and its interpretability content is a short analysis section (logit lens, CKA, ablation, gate heatmaps). The repository has a demo of the module with the backbone stubbed out. It has no trained weights.

Read. A text extraction of the v2 PDF, including all appendices, on 2026-11-13. The figures are images, so numbers below come from the text, the tables and the figure labels that the extraction kept. We read the code's README but not the code.

Summary

Claim. Transformers have no primitive for looking up static knowledge, so they rebuild it with computation in their early layers. A hashed N-gram embedding table ("Engram"), added beside Mixture-of-Experts (MoE), takes over that work. Total parameters and per-token FLOPs stay fixed. Moving part of the MoE's inactive parameters into Engram then lowers loss and raises benchmark scores, including reasoning, code and maths.

Method.

Findings, as the paper reports them. One run per configuration throughout. The paper reports no seeds, error bars or significance tests.

Result Number
Allocation sweep, 2e20 and 6e20 FLOPs (Figure 3) U-shaped validation loss in ρ, best near ρ ≈ 75–80%. At 6e20, 1.7248 (pure MoE) → 1.7109
Memory scaling, 2.58e5 to 1.0e7 slots on a 3B MoE Loss falls linearly in log slots ("a strict power law"), more steeply than OverEncoding
Engram-27B vs MoE-27B, 262B tokens, 3.8B activated (Table 1) Validation loss 1.634 → 1.622. MMLU 57.4 → 60.4, CMMLU 57.9 → 61.9, BBH 50.9 → 55.9, ARC-Challenge 70.1 → 73.8, HumanEval 37.8 → 40.8, MATH 28.3 → 30.7
Engram-40B (18.5B Engram parameters) Validation loss 1.610. Better than Engram-27B on most benchmarks, worse on HumanEval (38.4), MBPP (46.2) and C3 (61.8)
Long context, RULER at 32k (Table 2) Multi-query NIAH 84.2 (MoE, 50k steps) → 97.0 (Engram, 46k steps, same pre-training loss). Variable tracking 77.0 → 87.2
Logit lens (Figure 4a) KL from each layer's readout to the final output is lower for Engram, most in early layers
CKA (Figure 4b–c) Engram-27B layer 5 is most similar to about layer 12 of MoE-27B
Layer sweep, one 1.6B module on a 12-layer 3B MoE (Figure 5) Layer 2 best (1.770). Layers 2 and 6 together 1.768, against 1.808 for the baseline
Component ablations (Figure 5) Branch-specific gating, the gate and tokenizer compression matter most. Removing the convolution costs little. Adding 4-grams is slightly worse at 1.6B
Engram output zeroed at inference (Figure 6) Factual QA keeps 29–44% of its score (TriviaQA 29%). Reading comprehension keeps 81–93% (C3 93%)
100B-parameter table in host memory (Table 4) Throughput falls 1.9% on a dense 4B and 2.8% on a dense 8B (H800, nano-vLLM)

Where the claims go beyond the evidence

These are our observations, not the paper's.

Use in this repo

Not applicable as a method or a model. The registry explains native units of pretrained models at pinned revisions (docs/PROTOCOL.md). The configured models are Qwen2.5-0.5B, Qwen2.5-1.5B and GPT-2 (pyproject.toml, [tool.openinterpretability] models). None has an Engram module, and no Engram weights are released, so there are no gates or memory rows to audit.

Its premise is a claim about our models' early layers, which the registry could check. The paper argues that standard transformers spend early layers on local, static patterns: multi-token entities and set phrases. The registry's random draws make this testable without an Engram model. Take the VERIFIED poles in the first few layers. What share are explained as completing a local N-gram or multi-token name? And how does that share change with depth? neuron-family-triage already lists token and N-gram detectors (Voita et al., Gurnee et al.). The N2G baseline item (TODO.md, Protocol and science) would give the floor for that question: how much of a VERIFIED explanation a token-pattern matcher already predicts. No TODO.md item asks the depth question itself.

Two habits of the analysis section are illusions our reviewer looks for.

What doesn't carry over. Hashing, gating, sparsity allocation and host-memory offload are training and serving details. The repo doesn't train or serve models.