Conditional Memory via Scalable Lookup: A New Axis of Sparsity for Large Language Models

Xin Cheng, Wangding Zeng, Damai Dai, Qinyu Chen, Bingxuan Wang +9 more
1/12/2026
cs.CLcs.AI

No official code found. Best implementation: deepseek-ai/Engram (4,575 stars, Apache-2.0, last commit 2026-01-14).

Abstract

While Mixture-of-Experts (MoE) scales capacity via conditional computation, Transformers lack a native primitive for knowledge lookup, forcing them to inefficiently simulate retrieval through computation. To address this, we introduce conditional memory as a complementary sparsity axis, instantiated via Engram, a module that modernizes classic $N$-gram embedding for O(1) lookup. By formulating the Sparsity Allocation problem, we uncover a U-shaped scaling law that optimizes the trade-off between neural computation (MoE) and static memory (Engram). Guided by this law, we scale Engram to 27B parameters, achieving superior performance over a strictly iso-parameter and iso-FLOPs MoE baseline. Most notably, while the memory module is expected to aid knowledge retrieval (e.g., MMLU +3.4; CMMLU +4.0), we observe even larger gains in general reasoning (e.g., BBH +5.0; ARC-Challenge +3.7) and code/math domains~(HumanEval +3.0; MATH +2.4). Mechanistic analyses reveal that Engram relieves the backbone's early layers from static reconstruction, effectively deepening the network for complex reasoning. Furthermore, by delegating local dependencies to lookups, it frees up attention capacity for global context, substantially boosting long-context retrieval (e.g., Multi-Query NIAH: 84.2 to 97.0). Finally, Engram establishes infrastructure-aware efficiency: its deterministic addressing enables runtime prefetching from host memory, incurring negligible overhead. We envision conditional memory as an indispensable modeling primitive for next-generation sparse models.

View on arXivView PDF

Code Implementations(1)

deepseek-ai/EngramCommunity78%
Apache-2.0

Conditional Memory via Scalable Lookup: A New Axis of Sparsity for Large Language Models

4,575349PythonJan 12, 20269 months agoApache-2.0

Similar Papers

Cite this paper

@article{cheng2026conditional,
  title  = {Conditional Memory via Scalable Lookup: A New Axis of Sparsity for Large Language Models},
  author = {Xin Cheng and Wangding Zeng and Damai Dai and Qinyu Chen and Bingxuan Wang and Zhenda Xie and Kezhao Huang and Xingkai Yu and Zhewen Hao and Yukun Li and Han Zhang and Huishuai Zhang and Dongyan Zhao and Wenfeng Liang},
  year   = {2026},
  eprint = {2601.07372},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2601.07372v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2601.07372.svg)](https://codeofpaper.com/paper/2601.07372)

Discussion