Conditional Memory via Scalable Lookup: A New Axis of Sparsity for Large Language Models
Xin Cheng, Wangding Zeng, Damai Dai, Qinyu Chen, Bingxuan Wang, Zhenda Xie, Kezhao Huang, Xingkai Yu, Zhewen Hao, Han Zhang, Yukun Li, Huishuai Zhang
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 𝑁-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 → 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 nextgeneration sparse models. Code available at: https://github.com/deepseek-ai/Engram .
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext 4b9b0262-6643-428d-9d21-2017d936f616Cited by top-tier papers7
- Simple Is Better: Multiplication May Be All You Need for LLM Request SchedulingDingyan Zhang, Jinbo Han, Kaixi Zhang, Xingda Wei et al.OSDI 2026 · 5 citations
- UMEM: Unified Memory Extraction and Management Framework for Generalizable MemoryYongshi Ye, Hui Jiang, Feihu Jiang, Tian Lan et al.ICML 2026 · 4 citations
- : Large Lookup LayersAlbert Tseng, Chris De SaICML 2026 · 2 citations
- Cram Less to Fit More: Training Data Pruning Improves Memorization of FactsJiayuan Ye, Vitaly Feldman, Kunal TalwarICML 2026 · 1 citation
- LoKiFormer: Locality-aware Attention with Decoupled Knowledge Memory for Efficient Large Language Model PretrainingQiuwu Chen, Zimo Liu, Yuchen Li, Ying Sun et al.ICML 2026
Builds on49
- Measuring Massive Multitask Language UnderstandingDan Hendrycks, Collin Burns, Steven Basart, Andy Zou et al.ICLR 2021 · 7,905 citations
- Efficiently Modeling Long Sequences with Structured State SpacesAlbert Gu, Karan Goel, Christopher RéICLR 2022 · 3,482 citations
- Locating and Editing Factual Associations in GPTKevin Meng, David Bau, Alex Andonian, Yonatan BelinkovNeurIPS 2022 · 3,415 citations
- WinoGrande: An Adversarial Winograd Schema Challenge at ScaleKeisuke Sakaguchi, Ronan Le Bras, Chandra Bhagavatula, Yejin ChoiAAAI 2020 · 3,037 citations
- Retrieval Augmented Language Model Pre-TrainingKelvin Guu, Kenton Lee, Zora Tung, Panupong Pasupat et al.ICML 2020 · 2,937 citations
Related papers
- STEM: Scaling Transformers with Embedding ModulesRanajoy Sadhukhan, Sheng Cao, Harry Dong, Changsheng Zhao et al.ICLR 2026 · 14 citations
- Optimal Sparsity of Mixture-of-Experts Language Models for Reasoning TasksTaishi Nakamura, Satoki Ishikawa, Masaki Kawamura, Takumi Okamoto et al.ICLR 2026 · 2 citations
- Ultra-Sparse Memory NetworkZihao Huang, Qiyang Min, Hongzhi Huang, Yutao Zeng et al.ICLR 2025
- Towards A Unified View of Sparse Feed-Forward Network in Pretraining Large Language ModelZeyu Liu, Tim Dettmers, Xi Lin, Veselin Stoyanov et al.EMNLP 2023 · 3 citations
- OneSparse: A Unified Framework for Sparse Activation Layers in Vision ModelsXingkui Zhu, Dingkang Liang, Cheng Chen, Daoxin Zhang et al.CVPR 2026
