Model techniques map
ModelsQwen3.8-Flash-Next

Alibaba (Qwen) · released 2026-08-26

Qwen3.8-Flash-Next

What Qwen3.8-Flash-Next’s own documents say it is built from — every method with the sentence that describes it.

Curator’s noteExperimental preview of the Qwen4 architecture: sparse MoE, 125B total / 6B active plus 51B of n-gram embedding tables held off the accelerator, with a vision encoder. 48 layers, 3:1 Gated DeltaNet to Qwen Sparse Attention (block-level sparse attention with a lightweight indexer), Gated Residual over 4 residual branches, Muon+AdamW split by weight category. 262k native context, extensible to 1M. OpenRouter serves the hosted Qwen3.8-Flash, which the card describes as the production version *based on* the open Flash-Next weights (1M context by default, built-in tools); the catalog maps it to the open repo, so it is covered under that name. Qwen Community License 1.0, not Apache.

Against the consensus recipe

Its documents state 5 of the 15 methods the field agrees on.

The recipe from the overview: the methods the most labs adopt, per stage. A missing one is something the documents do not say, not something the model lacks.

  1. Data curation

  2. Training objective

  3. Model architecture

  4. Optimization

  5. Post-training

  6. Inference & serving

Checked in its code

Its code shows 10 of the 18 architecture features checked — 6 of them are not stated in its documents.

Documents say what a lab chose to describe; the modeling code says what the checkpoint runs. Each feature below was put to a code verifier, and only the config values and source lines it cited that were found in the files are shown, linked to the line.

Read from Hugging Face Transformers (modeling_qwen4_exp.py, configuration_qwen4_exp.py) and config.json at revision de4b8e4d43, by anthropic/claude-sonnet-5 on 2026-09-25.

FeatureCodeIts documentsEvidence
Grouped-query attention code only in its codenot stated

Full/indexed attention layers project 24 query heads down to 2 KV heads and repeat_kv expands them for the dot product.

text_config.num_attention_heads = 24text_config.num_key_value_heads = 2
self.num_key_value_groups = config.num_attention_heads // config.num_key_value_heads
modeling_qwen4_exp.py · L827
Multi-head latent attention not in its codenot stated

No kv_lora_rank/q_lora_rank down-projection into a shared latent exists in the code or config; attention uses standard separate k_proj/v_proj.

Sliding-window attention not in its codenot stated

No sliding_window config key or window-masking code exists; layer_types only distinguish linear_attention and full/indexed attention, none windowed.

Interleaved sliding-window and global attention not in its codenot stated

layer_types interleaves linear_attention with full/indexed attention, not sliding-window with global attention.

text_config.layer_types = ["linear_attention", "linear_attention", "linear_attention", "full_attention"…
unsupported_layer_types = sorted(set(self.layer_types) - {"linear_attention", "indexed_attention"})
configuration_qwen4_exp.py · L190
Linear-attention or state-space layers alongside full attention code only in its codenot stated

layer_types alternates linear_attention (GatedDeltaNet) layers with full/indexed softmax attention layers every 4th layer.

text_config.layer_types = ["linear_attention", "linear_attention", "linear_attention", "full_attention"…text_config.full_attention_interval = 4
self.layer_type = config.layer_types[layer_idx]
        if self.layer_type == "linear_attention":
            self.linear_attn = Qwen4ExpTextGatedDeltaNet(config, layer_idx)
        else:
            self.self_attn = Qwen4ExpTextAttention(config, layer_idx)
modeling_qwen4_exp.py · L1261–1265
Gated DeltaNet layers in its code core

Qwen4ExpTextGatedDeltaNet implements the gated delta rule with a decay gate (A_log/dt_bias) and delta-rule state update, used on linear_attention layers.

text_config.linear_num_key_heads = 16text_config.linear_conv_kernel_dim = 4
g = -self.A_log.float().exp() * F.softplus(a.float() + self.dt_bias)
modeling_qwen4_exp.py · L581
last_recurrent_state = last_recurrent_state * chunk_decay[:, :, i] + key[:, :, i].transpose(-1, -2) @ v_new
modeling_qwen4_exp.py · L387
Mamba-2 layers not in its codenot stated

No Mamba-2 SSD block or mamba_num_heads/ssm_state_size config exists; the recurrent mixer here is Gated DeltaNet, not Mamba-2.

Learnable attention sink not in its codenot stated

No learned per-head sink logit is added to the attention softmax denominator anywhere in the code.

Gated attention output code only in its codenot stated

Attention output is multiplied by a sigmoid gate derived from a chunk of the q_proj output before the output projection.

text_config.output_gate_type = "sigmoid"
attn_output = attn_output.reshape(*input_shape, -1).contiguous()
        attn_output = attn_output * torch.sigmoid(gate)
modeling_qwen4_exp.py · L897–898
QK normalization code only in its codenot stated

Qwen4ExpTextAttention applies per-head RMSNorm to queries and keys before RoPE and the attention dot product.

query_states = self.q_norm(query_states.view(hidden_shape)).transpose(1, 2)
        key_states = self.k_norm(self.k_proj(hidden_states).view(hidden_shape)).transpose(1, 2)
modeling_qwen4_exp.py · L872–873
Partial RoPE in its code used

partial_rotary_factor of 0.25 means RoPE is applied only to a quarter of the 256-dim head, the rest carrying no position signal via rotate/nope split.

text_config.partial_rotary_factor = 0.25text_config.rope_parameters = {"mrope_interleaved": true, "mrope_section": [11, 11, 10], "partial_rotary_fa…
q_rope, q_nope = q[..., :rotary_dim], q[..., rotary_dim:]
modeling_qwen4_exp.py · L658
YaRN RoPE scaling documents disagree not in its code used

rope_parameters.rope_type is set to "default", not YaRN, so no YaRN scaling is applied.

text_config.rope_parameters = {"mrope_interleaved": true, "mrope_section": [11, 11, 10], "partial_rotary_fa…
Layers without positional encoding (NoPE) not in its codenot stated

There is no per-layer no_rope_layers config or code path that skips RoPE entirely for some softmax attention layers while applying it to others; all full/indexed attention layers use the same partial RoPE.

Mixture of experts in its code core

Qwen4ExpTextSparseMoeBlock routes each token via a top-k router (Qwen4ExpTextTopKRouter) to a subset of the 512 routed experts.

text_config.num_experts = 512text_config.num_experts_per_tok = 10
router_top_value, router_indices = torch.topk(router_probs, self.top_k, dim=-1)  # (seq_len, top_k)
modeling_qwen4_exp.py · L973
Shared expert code only in its codenot stated

Each MoE block also runs a shared_expert MLP (sized by shared_expert_intermediate_size=640) through every token, gated and added to the routed output.

text_config.shared_expert_intermediate_size = 640
shared_expert_output = F.sigmoid(self.shared_expert_gate(hidden_states_reshaped)) * shared_expert_output
modeling_qwen4_exp.py · L996
Auxiliary-loss-free load balancing (selection bias) not in its codenot stated

The router uses plain softmax top-k selection with no e_score_correction_bias or similar selection-only bias term; only an auxiliary load-balancing loss coefficient exists.

text_config.router_aux_loss_coef = 0.001
Multi-token prediction layers in its code core

The config declares an mtp block with num_hidden_layers=1 (and mtp_num_hidden_layers=1), a nonzero count of extra next-token-prediction layers, even though the given modeling file skips loading mtp weights.

text_config.mtp_num_hidden_layers = 1text_config.mtp = {"hybrid": true, "layer_types": ["full_attention"], "mtp_use_hidden_state_fro…
_keys_to_ignore_on_load_unexpected = [r"^mtp.*"]
modeling_qwen4_exp.py · L1322
SwiGLU feed-forward code only in its codenot stated

Both the dense MLP and expert MLPs compute silu(gate_proj(x)) * up_proj(x), i.e. SwiGLU, matching hidden_act=silu.

text_config.hidden_act = "silu"
def forward(self, x):
        down_proj = self.down_proj(self.act_fn(self.gate_proj(x)) * self.up_proj(x))
        return down_proj
modeling_qwen4_exp.py · L915–917

model architecture 47

token mixer 15

channel mixer 5

positional encoding 2

normalization & residual 19

prediction head 1

context capacity 5

training objective 2

multi-token prediction objective 1

distillation objective 1

optimization 35

filed at the root 2

optimizer 20

learning-rate schedule 6

training precision 1

training stability 4

training parallelism 2

inference & serving 16

decoding strategy 2

reasoning control 1

KV cache management 1

inference quantization 1

serving parallelism 2

inference scheduling 1

inference kernel 7

context management 1

software implementation 1

kernel & quantization library 1

evaluation 2

filed at the root 2

unfiled 23

Sources

The curated document list for this model. "not fetched" means the URL is recorded but its text was not read in the current run.

DocumentKindPublisherStatus
qwen.ai/blog?id=qwen3.8-flash-nextofficial blogQwennot fetched
arxiv.org/abs/2608.30320technical reportQwenread
huggingface.co/Qwen/Qwen3.8-Flash-Nextmodel cardQwenread
github.com/QwenLM/Qwen3.8-Flash-Nextcode repoQwenread
lmsys.org/blog/2026-08-26-qwen-flash-nextvendor docsLMSYSread
recipes.vllm.ai/Qwen/Qwen3.8-Flash-Nextvendor docsvLLMread
inferencex.semianalysis.com/model/qwen-3-8-flash-nextthird party analysisSemiAnalysisread
openrouter.ai/qwen/qwen3.8-flashvendor docsOpenRouterread