Skip to content
INDIE / MACHINE
// FREE COURSE /courses

The Engram Course

Engram (DeepSeek and Peking University, 2026) gives a transformer a huge table of n-gram memories that it reads with a hash instead of computing. This course takes the layer apart in six short lessons - why a lookup at all, how tokens are compressed, how n-grams are hashed into tables, how the hidden state gates what comes back, the code in PyTorch and Hyperfield side by side, and how the paper trains and serves it - with interactive diagrams, quizzes, and a real layer that runs in your browser and matches DeepSeek's demo code.
START LESSON 1 FOLLOW VIA RSS6 LESSONS~40 MININTERMEDIATE
0 / 6 LESSONS DONE
// STEP BY STEP

Lessons

  1. 01
    CONCEPT6 MIN6 SLIDES2 QUESTIONS
    Memory instead of compute

    What Engram is, why a lookup table belongs next to Mixture-of-Experts, and what DeepSeek measured with it.

  2. 02
    CONCEPT5 MIN4 SLIDES2 QUESTIONS
    Tokenizer compression

    Why Engram merges vocabulary entries that normalize to the same text before hashing, and how much that shrinks real vocabularies.

  3. 03
    MATH7 MIN7 SLIDES2 QUESTIONS
    Hashing n-grams into tables

    The multiplicative-XOR hash, why each head's table has a prime size, why several heads, and how big the tables get.

  4. 04
    MATH7 MIN6 SLIDES2 QUESTIONS
    The gate and the short conv

    How the hidden state decides how much memory to let in, why the demo takes a signed square root, and what the dilated causal conv adds.

  5. 05
    CODE8 MIN8 SLIDES2 QUESTIONS
    Coding it: PyTorch to Hyperfield

    DeepSeek's demo Engram next to a Hyperfield (TypeScript) version, op by op, with a live layer that matches PyTorch.

  6. 06
    CONCEPT7 MIN8 SLIDES3 QUESTIONS
    Training and serving Engram

    Where the layers go, how much of the parameter budget to give them, the training recipe, serving a 100B table from host memory, and what Engram ends up storing.