antirez: Qwen 3.8 Flash Next's 51B N-gram Table Could Be Best Local Inference Option on 64GB Macs
Redis author antirez has been doing an in-depth analysis of the Qwen 3.8 Flash Next architecture, arriving at a practical conclusion for local inference: since the 51 billion n-grams can reside on SSD, the 2-bit quantized version of Qwen 3.8 Flash Next may be the best DwarfStar option for local inference on a 64GB MacBook.
Confirmed
- The core of the architecture is an n-grams mechanism: the model uses a 51B n-grams table in the second layer to "enrich" the representation of the current token, with gating controlling how much is passed through.
- The concrete pipeline: Layer 1 takes the last 2 and 3 tokens (bigrams and trigrams), retrieves 16 small vectors from the 51B database, combines them into one large vector, and injects it into the current token's representation via gating in Layer 2. Because bigrams and trigrams are far too numerous, the index is implemented as a compressed hash.
- The clever part is exploiting timing: during Layer 1 processing, masked loads can prefetch those 16 small vectors from SSD in advance, hiding memory-access latency.
- The semantic significance is akin to combining characters into words (e.g., "New"+"York" → "New York"), letting the representation of "York" directly carry the high-level concept of "New York," so later layers don't have to spend low-level compute combining characters and can work with higher-level concepts directly.
- Resource benefit: the semantic enhancement from the n-gram table can save part of the backbone weights.
Why it matters
- The 51B n-grams table far exceeds what memory can hold, but its SSD-resident design means it doesn't need to be fully loaded into RAM, opening a new path for consumer-grade machines with around 64GB of RAM to run large-parameter models.
- The mechanism shows how model designers can replace some of the low-level computation in Transformer layers with "retrieval + gating," and antirez's calculations give local-inference users a concrete hardware sizing reference.
2026-08-30 ~ 2026-08-30 · 7 related posts
Primary sources
- [source] Quantized Qwen 3.8 Flash Next may be best local model for 64GB Macs — antirez · 2026-08-30
- [source] Qwen 3.8 Flash Next: Using Next-n-grams for efficient local inference — antirez · 2026-08-30
- Qwen N-gram mechanism enriches tokens using 51B table — antirez · 2026-08-30
- [source] Qwen 3.8 Flash Next uses N-gram table to save backbone weights — antirez · 2026-08-30
- Qwen enriches token semantics at Layer 2 using N-grams — antirez · 2026-08-30
- Learned embeddings enable layers to process higher-level concepts directly — antirez · 2026-08-30
- Learned n-grams compress indexing to group tokens like chars into words — antirez · 2026-08-30