Trie Packing — Forward, Loss & Backward

September 5, 2026

How it works

Follow a concrete example of trie packing, from merging shared prefixes into a tree to computing attention, mapping each prediction to its loss, and accumulating gradients. The walkthrough includes code and engineering checks for preserving the original training objective.

Open the walkthrough in a full page to read or print it separately.