AIAny
Icon for item

Engram — Conditional Memory via Scalable Lookup

Provides a conditional memory module that performs O(1) N‑gram lookups and fuses static embeddings into transformer hidden states — enables offloading large embedding tables to host memory with minimal inference overhead.

Introduction

Modern transformers lack a native, constant‑time primitive for looking up static textual patterns; Engram provides that missing axis by reintroducing N‑gram memory as a scalable, conditional module. The core insight: by allocating some capacity to deterministic static memory (Engram) rather than purely dynamic computation (MoE), models can better store and retrieve recurring patterns without increasing per‑token compute.

What Sets It Apart
  • Sparsity-as-allocation, not just routing: the project formalizes a trade‑off between neural computation (MoE) and static memory (Engram), reporting a U‑shaped scaling law that guides how to split capacity under iso‑parameter and iso‑FLOPs constraints — so you can target optimal capacity allocation rather than guessing.
  • O(1) deterministic N‑gram lookup: Engram uses hashed/deterministic addressing for N‑gram embeddings, enabling constant‑time retrieval and straightforward offloading of embedding tables to host memory with minimal latency impact — so very large static memories become practical in inference.
  • Empirical iso‑budget gains: their Engram‑27B experiments (paper + repo) claim consistent improvements over MoE baselines across knowledge, reasoning, code and math benchmarks when keeping parameter/FLOP budgets matched — indicating this is not just an engineering trick but a useful capacity reallocation.
  • Mechanistic clarity: analyses suggest Engram reduces early‑layer burden of pattern reconstruction, preserving depth for higher‑level reasoning tasks — useful if you care about where capacity is used, not just how much.
Who It's For and Trade‑offs

Great fit if you are a researcher or engineering team exploring LLM architecture trade‑offs, reproducing the paper, or building systems that can benefit from large static pattern tables (e.g., specialized codebases, long repeated sequences, or domain corpora). Look elsewhere if your primary need is up‑to‑date, frequently changing knowledge (static N‑gram tables are not ideal for live updates), or if your deployment environment cannot tolerate the memory or engineering cost of maintaining large host‑side embedding tables. Also note Engram trades off some adaptability for compact deterministic lookup — beneficial for pattern recall but less so for emergent, context‑sensitive generalization.

Where It Fits

Compared to MoE, Engram is a complementary sparsity axis: MoE dynamically routes computation for conditional capacity, while Engram stores conditional memory for lookup. Compared to retrieval/RAG, Engram is designed as an internal, fixed N‑gram embedding memory with O(1) access rather than an external document retriever — lower latency and simpler integration, but less suited for long, mutable documents.

Practical notes

The repository provides a demonstration implementation (Python/PyTorch) and figures for scaling, long‑context behavior, and case studies. The code is marked as a demo to illustrate data flow; reproducing large‑scale (e.g., 27B) experiments requires significant compute and careful integration with training pipelines. The project references an Apache‑2.0 style license and a model license in the repo; check the LICENSE files for usage constraints.

Information

  • Websitegithub.com
  • AuthorsDeepSeek AI
  • Published date2026/01/12

More Items

Transfers RL-induced policy shifts from a smaller 'weak' teacher to a stronger target by using the teacher's post-/pre-RL log-ratio as a dense implicit reward applied on the student's on-policy states. Enables reuse of RL supervision without running RL rollouts on the target, improving sample/time efficiency.

Introduces KronQ, a post-training quantization framework that incorporates gradient covariance via a Kronecker‑factored Hessian to guide input/output weight rotations and sensitivity-driven mixed-precision allocation. Demonstrates stable 2-bit weight-only quantization on LLaMA-3-70B (7.93 PPL).

Explores unsupervised visual pretraining on visually rich documents to improve language-model intelligence; shows visual-pretrained models outperform text-only counterparts on the same corpora. Key aspects: direct use of images/layouts (no OCR-only pipeline), scalable across backbones and benchmarks.