Skip to main content
QUICK REVIEW

[Paper Review] Conditional Memory via Scalable Lookup: A New Axis of Sparsity for Large Language Models

Xin Cheng, Shengding Hu|arXiv (Cornell University)|Jan 12, 2026
Topic ModelingComputer Science0 citations
TL;DR

The paper introduces Engram, a conditional memory module that provides scalable N-gram memory lookups to complement MoE, finding a U-shaped sparsity allocation between memory and computation and achieving strong gains across reasoning, code/math, and long-context tasks.

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.

Motivation & Objective

  • Motivate a complementary sparsity axis for LLMs beyond conditional computation (MoE) by leveraging static knowledge lookups.
  • Revisit N-gram embeddings as a scalable, differentiable memory mechanism integrated into Transformers.
  • Formulate the Sparsity Allocation problem to balance memory versus compute under fixed budgets.
  • Demonstrate that Engram scales to multi-billion parameters and yields gains across reasoning, knowledge, and code/math tasks.

Proposed method

  • Present Engram as a conditional memory module that retrieves static N-gram embeddings via multi-head hashing and deterministic addressing.
  • Implement tokenizer compression to reduce vocabulary size and enable robust N-gram suffixes.
  • Use a context-aware gating mechanism to modulate retrieved memory with current hidden states.
  • Fuse retrieved memory with dynamic backbone via a multi-branch-aware integration and residual connections.
  • Decouple memory and compute to enable host-memory offloading and deterministic prefetching for efficiency.
  • Analyze allocation via a Sparsity Allocation framework to find the optimal split between MoE experts and Engram memory under fixed compute, revealing a U-shaped scaling law.
Figure 1 : The Engram Architecture. The module augments the backbone by retrieving static $N$ -gram memory and fusing it with dynamic hidden states via context-aware gating. This module is applied only to specific layers to decouple memory from compute, leaving the standard input embedding and un-em
Figure 1 : The Engram Architecture. The module augments the backbone by retrieving static $N$ -gram memory and fusing it with dynamic hidden states via context-aware gating. This module is applied only to specific layers to decouple memory from compute, leaving the standard input embedding and un-em

Experimental results

Research questions

  • RQ1How should model capacity be allocated between conditional computation (MoE) and conditional memory (Engram) under fixed parameter and compute budgets?
  • RQ2Does introducing a scalable memory primitive complement MoE in improving performance across knowledge, reasoning, and long-context tasks?
  • RQ3What is the scaling behavior of Engram under infinite memory or large memory budgets?
  • RQ4Can Engram maintain or improve efficiency by decoupling storage from compute and enabling host-memory offloads?
  • RQ5How does Engram affect internal representations and long-context retrieval in practice?

Key findings

  • Engram with 27B total parameters outperforms an iso-parameter/is0-FLOPs MoE baseline across diverse tasks.
  • Under fixed budgets, the optimal allocation is a U-shaped curve, with best performance when a portion of sparse capacity is allocated to Engram (roughly 20–25% of the sparse budget).
  • Engram scales in the infinite-memory regime following a power-law improvement, enabling substantial gains without additional compute.
  • Engram achieves notable gains on long-context benchmarks (LongPPL and RULER) and improves retrieval-heavy and code/math tasks.
  • Mechanistic analyses show Engram reduces static reconstruction in early layers, effectively deepening the network for reasoning, and frees attention for global context.
Figure 2 : System implementation of Engram. (a) Training Phase: The massive embedding tables are sharded across available GPUs. An All-to-All communication primitive is employed to retrieve active embedding rows across devices. (b) Inference Phase: Engram tables are offloaded to host memory. By expl
Figure 2 : System implementation of Engram. (a) Training Phase: The massive embedding tables are sharded across available GPUs. An All-to-All communication primitive is employed to retrieve active embedding rows across devices. (b) Inference Phase: Engram tables are offloaded to host memory. By expl

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.