N-Gram Memories at Two Bits: Quantizing Lookup Tables in Large Language Models
Abstract
Conditional Program compresses language-model embedding tables by reconstructing only requested rows via shared codes and local scales, reducing storage by 75% while improving fidelity.
Conditional memory expands language-model capacity through selective lookup, but the full embedding table must remain available for every possible input. We introduce Conditional Program (CP), a compressed representation that reconstructs only the rows an input requests. CP represents each row by a short code and a local scale, with a reconstruction program shared across the table. We instantiate this representation with a Gaussian trellis, norm restoration and independently decodable row records. CP's two-bit code lowers output KL by 41--63\% relative to 2-bit round-to-nearest. Analysis across three trained n-gram memory families shows that Gaussian-like coordinate statistics coexist with learned relationships among rows; at matched storage budgets, the shared trellis outperforms the fitted codebooks and low-rank residual variants we test. For DeepSeek, it reduces table storage from 203GB to 51GB, leaving room for larger workloads when the table is kept on GPU.
Community
Offloading Engram-style n-gram embedding tables only moves their cost; we shrink them to 2 bits per value (203 GB → 51 GB for DeepSeek) with 41–63% lower KL than 2-bit RTN.
This is an automated message from the Librarian Bot. I found the following papers similar to this paper.
The following papers were recommended by the Semantic Scholar API
- Cache the Encoder Within:Compact, Reusable Memory across LLM Queries (2026)
- RoleQ: Role-Aligned Scales for Converting Language Models to Ternary (2026)
- Read What Matters: Query-Adaptive Quantization for KV Caches (2026)
- AlignQuant: Tile-Aligned Mixed-Precision Quantization for Efficient LLM Generation (2026)
- FactorEngram: Factorized N-gram Memory with Basis-Level Gating for Language Models (2026)
- The COUNT: Counting N-grams Unlocks Scaling on Host Memory and Training-Free Adaptation (2026)
- E8 Lattice Key Quantization for Low-Bit KV-Cache Compression (2026)
Please give a thumbs up to this comment if you found it helpful!
If you want recommendations for any Paper on Hugging Face checkout this Space
You can directly ask Librarian Bot for paper recommendations by tagging it in a comment: @librarian-bot recommend
Get this paper in your agent:
hf papers read 2610.21810 Don't have the latest CLI?
curl -LsSf https://hf.co/cli/install.sh | bash Models citing this paper 0
No model linking this paper
Datasets citing this paper 0
No dataset linking this paper
Spaces citing this paper 0
No Space linking this paper
Collections including this paper 0
No Collection including this paper