A generated title card reading Qwen4 MoE Leak, with the subtitle The kernels match Qwen4-Max's architecture, and four chips reading qwen4_moe, 92 files +5,463 lines, Draft PR 3 Dec 2026 and No weights yet.
Guides & Insights

Qwen4 MoE Leak: The Kernels Match Qwen4-Max's Architecture

Date Published

Models in this article · 2View all models →
Back to all posts

A draft pull request landed in vLLM on 3 December 2026 carrying the least informative title in the repository: [Model] Add Qwen4 MoE. It names no checkpoint, no parameter count, no context length, no licence, no release date. It is a draft. It has two commits, and one of them is a merge from main. What it does have is 92 changed files, 5,463 inserted lines, and a kernel inventory that reads like a specification for Qwen4 MoE, the open-weight model Alibaba promised on 16 November when it shipped Qwen4-Max. No weights exist. Nothing in this piece is a release, and nothing in the pull request says when one is coming. But the code is specific enough to say what kind of model is being built, and it is not the 2.4-trillion-parameter flagship.

What the pull request actually registers

The diff adds a model type called qwen4_moe and a class called Qwen4MoeForConditionalGeneration. The PR body is four lines long and says the new class is built "on top of the existing Qwen4Exp implementation" — which is the detail worth understanding before anything else.

Qwen4Exp is not a new name in vLLM. It is the architecture inside Qwen3.8-Flash-Next, the 125-billion-parameter open-weight model Alibaba published on 24 August 2026 and described as "an experimental preview of the architecture that will underpin Qwen4." vLLM has carried a Qwen4Exp path since at least October. So this PR is not introducing the Qwen4 family to the serving stack. It is carving out a second entry point beside the one that already exists.

That distinction is the whole story. A contributor who wanted to run a variant of a model already supported would add a config branch. Registering a separate architecture class, with its own model type, its own parser stack, and 92 files of kernel work, implies a checkpoint whose configuration is different enough that the existing path could not simply absorb it.

What sits inside those 92 files:

• A full native chat renderer, at rust/src/chat/src/renderer/qwen4/, with its own encoding module, tool fixtures and tests. • A reasoning parser and a tool parser, implemented twice — Python (vllm/reasoning/qwen4_engine_reasoning_parser.py, vllm/tool_parsers/qwen4_engine_tool_parser.py) and Rust (rust/src/parser/src/reasoning/, rust/src/parser/src/tool/qwen_coder.rs). • A new vllm/config/engram.py and a documentation page at docs/features/engram.md. • Attention kernels under vllm/models/qwen4_exp/ split into separate NVIDIA and AMD trees, with multi-token-prediction heads for both. • Two new CUDA files for the residual path: csrc/qwen4_exp/hc_down_silu.cu and hc_up_gate_mix.cu.

A screenshot of vLLM pull request #71659 titled [Model] Add Qwen4 MoE, showing the Draft badge, gau-nernst as author, 92 files changed, +5,463 and -835 lines, and the modifications list naming qwen4_moe, Qwen4MoeForConditionalGeneration, NVFP4 K/V cache for QSA layers, FlashInfer PrimTS on SM100/SM103 and AITER QSA indexer scoring on AMD.

Parsers and renderers are the part of a serving integration that gets written last, once the weights are stable enough that someone knows what the chat template emits. Their presence, in two languages, in a draft opened a day before this article was written, is the strongest signal in the diff that this is launch preparation rather than an experiment.

The kernels name Qwen4-Max's architecture

Here is the part that turns a framework patch into something a reader can act on. File names in a diff are not prose a contributor can carefully word, so they are harder to overclaim than a PR description. Read against Alibaba's own description of Qwen4-Max, they line up one for one.

Alibaba's release says the Qwen4 architecture "upgrades the sparse Mixture-of-Experts (MoE) design across attention, residual connections, and embeddings." The disclosure Alibaba published alongside the launch is more concrete: Qwen Sparse Attention (QSA) mixed with Gated DeltaNet (GDN) layers, a gated residual built from four parallel residual branches, and a large N-gram embedding table — 328 billion parameters of it, against 2.4 trillion total and 71 billion active per token.

Now the PR's file list:

• Attention — a dozen qsa_* modules: qsa_flashinfer.py, qsa_fp8.py, qsa_nvfp4.py, qsa_hisparse.py, qsa_indexer.py, qsa_prepare.py, plus a qwen4_exp_qsa_warmup.py in the warmup directory. • Recurrence — vllm/model_executor/layers/mamba/gdn/qwen_gdn_linear_attn.py, with fused decode kernels in csrc/gdn/ and a fused GDN prefill in the Flash Linear Attention third-party tree. • Residual — vllm/models/qwen4_exp/nvidia/hyperconnection.py. The shape constant is declared as HcShape<4, 2560, 320> and HcShape<4, 2048, 256>, and the injection width check reads inj_out == 4. Four branches. • Embeddings — the new engram config, which is the N-gram embedding path.

Four named components in Alibaba's architecture write-up, four matching subsystems in the diff, including the branch count. That correspondence is the reason this leak is worth more than most. It does not prove the checkpoint is real, and it does not tell you a size. It does establish that whoever wrote this code was working against the same architecture the vendor described, and not against a name scraped off a rumour thread.

Two widths, not one

The hyperconnection constant is declared for two different shapes, not one. HcShape<4, 2560, 320> pairs a 2,560-wide projection with rank 320. HcShape<4, 2048, 256> pairs 2,048 with rank 256. Both shapes are compiled and both are exercised, judging by the paired tests/models/qwen4_exp/test_hc_ops.py and test_hc_ops_amd.py.

One of those numbers is already public. The Qwen4-35B-A3B spec that leaked on 30 November, through a withdrawn pull request in AMD's SGLang fork, lists a hidden size of 2,048 across 40 layers with 256 routed experts and top-8 routing. The 2,048 half of this PR's pair matches it. The 2,560 half matches nothing that has surfaced publicly.

Treat that as an inference, not a fact. Tensor shapes are not parameter counts, and a 2,560-wide projection could belong to a differently shaped model, a different precision path, or a configuration the author was testing and has not described. But two declared geometries in a single pull request is a concrete observation, and the most economical reading is that vLLM is being prepared for at least two Qwen4 MoE checkpoints rather than one.

What the numbers do support without inference is scale. A 2,048 or 2,560-wide hidden projection belongs to a small model. Qwen4-Max's 2.4-trillion-parameter backbone does not have that shape. So whatever this PR is pointing at, it is on the "smaller-scale" side of the promise Alibaba made in its 16 November release: "Open-weight, smaller-scale models from the Qwen4 series will soon be released to developers worldwide."

A generated single-column scoreboard for Qwen4 MoE: model type qwen4_moe draft, total params not published, weights none public, widths declared 2,048 and 2,560, attention QSA plus GDN hybrid, and serving not in any vLLM release.

What it means for hardware and VRAM

The PR says nothing about memory, and with no parameter count published there is no honest way to produce a VRAM estimate. What it does say, in hardware flags, is where the model is expected to run.

• Blackwell is the fast path. FlashInfer's PrimTS kernel is wired for SM100 and SM103, the compute capabilities of NVIDIA's current datacentre parts. • Hopper and Ada get a fallback. SM90 and SM89 route to FlashInfer's default sparse kernel instead. • AMD is a first-class target, not an afterthought. A separate qwen4_exp/amd/ tree carries an AITER QSA indexer scoring path and a fused GDN prefill, with AMD-specific tests for the QSA reference and prepare stages. • Quantised KV cache is scoped to the attention layers. The PR adds --kv-cache-dtype nvfp4 specifically "for the QSA layers," which follows from the layer mix: if Alibaba's design really runs three GDN layers per QSA layer, only a quarter of the stack holds a key/value cache at all. • Speculative decoding is in scope. Multi-token-prediction heads appear for both vendors, and the rejection sampler in vllm/v1/worker/gpu/spec_decode/ is modified.

That last structural point is the one worth carrying into a capacity plan. A hybrid stack that keeps three layers of linear recurrence for every layer of sparse attention is not trying to win on raw attention throughput. It is trying to make long context cheap, which is the same trade Qwen4-Max makes at 1M tokens and the same trade Qwen3.8-Flash-Next already makes at 262,144.

What you can run today

Not this. There is no qwen4_moe entry in vLLM's published supported-models documentation, no configuration file in any public repository declaring that model type, and no Qwen4 MoE weights anywhere on Hugging Face. Nothing on this page is callable, and OrcaRouter does not list it.

What is callable is Qwen4-Max, which went from preview to metered general availability on 16 November 2026 at $1.50 in and $4.50 out per million tokens in Singapore, against $2.00 and $6.00 for Qwen3.8-Max. It runs on a single OrcaRouter key among 216 models, at the vendor's own list price with no markup added, so a vendor price change on the Qwen side reaches you on the same day rather than after a reseller updates a table.

Open weights are the other half. Qwen3.8-Flash-Next, the 125-billion-parameter A6B model that Qwen4Exp is named after, has been downloadable since 24 August and is the closest thing to a Qwen4 architecture you can actually hold. If you want to understand how the QSA-plus-GDN mix behaves on your workload before a smaller Qwen4 MoE arrives, that is the model to benchmark — and it is the benchmark that will tell you whether the real release is worth waiting for.

A screenshot of the OrcaRouter model page for Qwen4 Max, showing the identifier qwen/qwen4-max, a 1M-token context window, $1.50 per 1M input tokens and $4.50 per 1M output tokens, a p50 TTFT of 4.18 seconds and an EN locale toggle.

What would confirm it

Four things, in rough order of how much they would settle.

• The pull request leaving draft. A merged model entry is what moves qwen4_moe into vLLM's supported-models list. Until then, no pip-installable release can serve it, because the architecture is not in any shipped version. • A weight repository. A Qwen-organisation Hugging Face repo with a config.json declaring "model_type": "qwen4_moe" would confirm both the architecture string and the width, and would almost certainly settle the two-shape question in the same file. • A named checkpoint. The AMD leak referenced Qwen/Qwen4-35B-A3B-1118, a naming convention that reads as an internal build date of 18 November. A second name in that series would explain the 2,560 shape. • Independent numbers. Nothing here carries a benchmark, and none should be quoted as one. When the weights land, Artificial Analysis and LMArena are where a score becomes something other than a vendor claim.

If you are planning local inference around Qwen4, the practical read is that the architecture is settled and the sizes are not. Wait for the width to be named. If you are building against an API today, none of this changes anything: Qwen4-Max is live and priced, Qwen3.8-Flash-Next is downloadable, and an unmerged draft is a thing to watch rather than a thing to depend on.

Compared in this article1

Detected from this article · Benchmarks: Artificial Analysis · updated daily