Most layers carry a recurrent state
Thirty-six GDN layers summarize history in fixed-size matrices; twelve QSA layers retain token-growing K/V caches.
A hybrid MoE decoder with three ways to spend capacity: recurrent states carry history, sparse attention retrieves selected blocks, and four gated residual streams carry information through depth. A 51-billion-parameter lexical table adds memory through lookups.
Based on the official model card, technical report, released configuration, and a shape audit of all 131 checkpoint shards. Shapes are logical shapes before GPUs divide the work. Reference checked October 28, 2026.
Forty-eight decoder layers repeat a four-layer rhythm twelve times: GDN, GDN, GDN, QSA. Every layer has 512 routed experts and one shared expert. Lexical embeddings enter at layer 2; separate gated residual modules surround attention and MoE in every layer. [2]
Select a layer to update the computation diagram. Gold marks the only lexical embedding layer.
Thirty-six GDN layers summarize history in fixed-size matrices; twelve QSA layers retain token-growing K/V caches.
A lightweight indexer scores four-token blocks. The main attention reads up to 512 complete blocks, plus the current partial block.
Each sublayer reads a learned channel-wise mixture of the streams, computes at width 2560, and writes through one scalar gate per stream.
Sixteen bigram/trigram hash heads retrieve 160 features each. A 51.2B table supplies 2560 lexical features per token.
Choose a layer and click an operation to inspect its tensor shape, weight count, and backward dependencies. Thick borders mark matrix multiplies or attention kernels.
T is the packed token count; R = 10T is the logical number of token-expert assignments. The diagram shows grouped operations, not a measured GPU schedule. Shapes can describe logical tensors processed in chunks.
The three main additions are QSA, gated residuals, and lexical embeddings. GDN, routed experts, and the vision pathway remain the foundation of the hybrid decoder. [1]
GDN is a gated delta-rule recurrence. Short causal convolutions prepare Q/K/V; a decay gate forgets old state, and a beta gate controls a corrective write. Chunked training computes this recurrence in parallel; token-by-token decoding carries the state forward.
Sixteen Q/K heads feed forty-eight value heads, so each Q/K head serves three value heads. The output uses per-head RMS normalization and a sigmoid gate in this release. [4]
The thirty-six recurrent matrices occupy 108 MiB at FP32 per sequence, independent of context length. Short-convolution history adds a small fixed term.
The main projections produce QKV width 10,240 and gate width 6,144. The beta and decay projections each produce 48 scalars per token. State accumulation and normalization use higher precision than BF16 activations.
A small multi-query indexer predicts relevance for complete four-token blocks. It averages raw keys inside each block, then normalizes and applies positional encoding using the first token's position. Four query heads score each block; their rectified scores are summed.
Top-k chooses up to 512 blocks. Main GQA uses the original, unpooled K/V of the selected 2048 tokens, plus up to three tokens in the current incomplete block. Causality and document boundaries apply to both selection and attention. [3]
The report introduces QSA during continued pretraining: first distill a dense-attention teacher into the indexer, then jointly train the backbone and indexer with sparse attention and a selected-block KL objective.
The sparse attention core reads a bounded token budget. The indexer still scores the growing set of compressed blocks; whole-sequence prefill indexing remains quadratic in sequence length, reduced by the factor-four compression.
The persistent residual is [T, 4, 2560], or [T, 10240] when flattened. Each stream is normalized independently. A 10,240 → 320 → 10,240 bottleneck predicts an element-wise sigmoid read gate. Averaging the gated streams produces a width-2560 input for the sublayer.
Four scalar write gates send the sublayer's output back into the four streams. Attention and MoE have independent read/write modules. A final read-only mixer reduces the streams before the LM head; the reference has no separate final RMSNorm. [4]
Attention and expert projections operate at D = 2560. The wider residual path increases activation traffic and gives the model different learned reads of accumulated information.
Kimi K3 retrieves earlier depth summaries using attention. GR keeps four streams and learns channel-wise read gates plus scalar writes. Its design omits an additional stream-to-stream residual mixing matrix.
Eight bigram and eight trigram hash heads each address a distinct prime-sized vocabulary near twenty million slots. Their tables are concatenated into 320,001,536 padded rows, each with 160 features. Sixteen lookups concatenate to [T, 2560].
The lexical features project to one shared value and four stream-specific keys. Normalized residual streams gate the value. A width-four causal convolution with dilation three adds local lexical context. The result is added before layer 2's attention read. [2]
The BF16 table alone is 95.37 GiB. Each token reads 5 KiB of lexical features before projections. The report places PLE at layer 2 so predictable lookups can be prefetched from host memory while layer 1 runs.
Hashing requires original IDs and resets history at EOS. Packed training also needs document boundaries, including when PLE lives on a later pipeline stage. Multimodal rotary coordinates do not replace that lexical history.
Every layer routes each token to ten of 512 SwiGLU experts and also evaluates one shared expert. Each expert has gate, up, and down matrices at widths 2560 and 640. Selected router probabilities are normalized; the shared expert has its own sigmoid output gate.
Routing uses FP32 softmax on activation-rounded logits, then casts expert mixing weights to the activation dtype. Small BF16 rounding differences near a tie can change the discrete expert IDs. [4]
The routed bank holds 120.796B weights. Ten experts per token select 2.359B of those weights across all layers. Routers, attention, residual mixers, and the LM head add to the token's active path.
Dispatch and combine exchange token activations across expert owners. R is a logical group-wide assignment count; expert imbalance and placement determine how many assignments each GPU receives.
A twenty-seven-layer vision transformer uses width 1152, sixteen heads, and intermediate width 4304. A spatiotemporal patch embedding consumes [3, 2, 16, 16] patches for images and video. A 2 × 2 spatial merge projects visual features to width 2560.
The decoder uses interleaved multimodal rotary coordinates: 64 rotary channels in a 256-channel main attention head, with temporal/height/width sections [11, 11, 10]. The released configuration has no deepstack visual injection layers. [2]
Image resolution, video sampling, and patch merging determine the decoder's visual token count. Visual tokens consume context and follow the same decoder attention and MoE paths.
The checkpoint sets 262,144 positions and RoPE theta 10,000,000. The model card describes YaRN extension to 1,000,000 tokens. The hosted Qwen3.8-Flash product advertises a default 1M context and additional built-in tools.
Move the query forward. Complete blocks compete for a fixed budget; the partial tail is always included. This 64-token illustration uses synthetic scores and a reduced budget to make selection visible.
The released model uses the same block size of four, with a 2048-token budget. The scores here illustrate selection mechanics and are not predictions from the checkpoint.
The model card reports a 125B backbone, 6B activated, plus 51B n-gram embeddings and 4B MTP. The checkpoint contains 179,999,981,424 BF16 weight elements. Choose a counting scope to see where those weights live. [5]
| Scope | Exact count | What it includes |
|---|---|---|
| Text backbone | 125,743,653,760 | Decoder, input/output tables, gated residuals, and PLE projections; excludes lexical lookup table, vision, and MTP. |
| Backbone + lexical + vision | 177,392,830,576 | The released backbone and vision weights, before MTP. |
| MTP unique weights | 2,607,150,848 | 31 checkpoint tensors under mtp.*. |
| Full BF16 checkpoint | 179,999,981,424 | All unique BF16 weight elements across 131 shards. |
The MTP configuration shares embeddings. Its checkpoint contains no dedicated copies of the input table or LM head. Counting the shared 1.271B input/output tables as part of the draft's footprint gives 3.879B; full-checkpoint storage counts each table once. The card's 4B MTP label and unique stored MTP weights therefore use different scopes.
The checkpoint also stores 35 int64 hash-buffer elements. We exclude these from trainable parameter counts. Its total tensor payload is 359,999,963,128 bytes: about 360 GB or 335.28 GiB, before runtime and allocator overhead.
The 2048-token budget limits which K/V entries a query reads. A future query can select any earlier complete block, so the main K/V history remains token-growing. GDN's recurrent matrices stay constant. The pinned Transformers reference also caches raw indexer keys. [4]
These are logical per-sequence cache sizes before sharding. The comparison baseline uses 48 dense GQA layers with the same two KV heads and head width. Estimates exclude convolution history, PLE history, speculative draft caches, model weights, prefill activations, quantization metadata, and allocator overhead.
The report treats optimizer choice, residual stability, and memory movement as part of the design. These are findings from the released model's training study. [3]
Attention/GDN projections, expert matrices, and PLE key/value projections use Muon. Fused matrices are split into their semantic operators before orthogonalization; the report uses per-head splitting for attention and GDN.
Input/output tables, routers, and GR's elongated low-rank projections use AdamW. The n-gram table uses Adam with weight decay disabled. The optimizer assignment follows the role and shape of each weight.
Hash addresses depend on token IDs, so lookups can be prepared before the decoder reaches PLE. Placing PLE at layer 2 creates overlap with layer 1's computation and makes host-memory storage practical in the report's system.
A dense-attention teacher first trains the indexer. Sparse continued pretraining then adapts both the backbone and indexer. The report's QSA objective learns block relevance from detached main-attention probabilities.
The report also refits batch-size and learning-rate scaling laws and starts at the target batch size without traditional batch-size warmup. GR's gated normalization is evaluated for training stability under larger learning rates.
The audit reads only bounded header byte ranges and materializes no checkpoint weight tensors. Every tensor name is checked against the index, and shape-derived payload bytes match the index's total_size. The downloadable snapshot records source hashes, grouping, individual shapes, and the exact revision.
Full checkpoint: 179,999,981,424 BF16 weights. Backbone + vision before MTP: 177,392,830,576. Text backbone after removing the 51,200,245,760-weight lexical table and 448,931,056 vision weights: 125,743,653,760. Parameter count is distinct from active computation, cache memory, and physical GPU placement.
Presentation follows the Kimi K3 architecture study, which was inspired by Edward Yang's DeepSeek diagram. This page's dimensions, graph, and accounting are specific to Qwen3.8-Flash-Next.