Explained: N-gram vs Experts in Qwen's Architecture
Beamsters · reddit · 2026-08-27
A deep dive into the mechanism combining Mixture of Experts (MoE) and N-gram tables in the Qwen4Exp architecture.
Core Concepts:
- MoE (Experts): Handles arithmetic and reasoning. The routing decision arrives late in the layer, requiring heavy data movement, making it unsuitable for disk storage.
- N-gram Table: Handles memory and recall. Addressed via a hash of the last few tokens, it allows immediate fetching of small data chunks (a few kB), making it suitable for SSD storage.
Metrics & Benefits:
- Qwen 3.8 Flash Next keeps 125B parameters in the MoE network and another 51B in the N-gram table.
- Only 6B parameters are activated per token, retaining the capacity of a 176B model while maintaining the speed of a much smaller one.
- Under a fixed budget, allocating roughly 20-25% of total parameters to the N-gram table yields the most benefit, allowing early layers to handle patterns and deeper layers to focus on reasoning.
More from Infra
- open-daytona: rootless gVisor sandbox pool runs 1,536 concurrent agent-RL sandboxes on Slurm — victor_explore · 2026-11-30
- Notes on 'Looking Back at Postgres': Extensibility, No WAL, Open Source — sh_reya · 2026-11-30
- NRDC concedes BAAJA makes data centers pay grid costs, countering 'giveaway' claim — zacharynado · 2026-11-30
- NIDO 0.1.131: A Fully Offline Phone AI Assistant With No Account, No Cloud, No Analytics — NIDO_007 · 2026-11-30
- Ibiden to spend ~¥2T on four new plants as AI chip substrate demand extends past 2030 — BenBajarin · 2026-11-30
- Simulated FP64 matmul runs 83x faster than native on NVIDIA B300, ETH Zurich paper shows — JiliJeanlouis · 2026-11-30