Qwen4-35B-A3B by Alibaba: Multimodal MoE with 1M-token context

The Alibaba Qwen Team has published Qwen4-35B-A3B, a natively multimodal Mixture-of-Experts (MoE) model designed for local and server-side inference. The architecture combines ~35B main parameters with ~3.8B active parameters per token and a Per-Layer N-gram Embedding (PLE) table of about 20.5B parameters (~56B total by their accounting). The model supports native text, image and video inputs with a 1,000,000‑token context window and is licensed under Apache-2.0.

Architecture details

The decoder stacks a repeated four-layer pattern ten times. The first three layers use a component the team calls Gated DeltaNet, which maintains a fixed-size memory as tokens are read. The fourth layer implements Qwen Sparse Attention (QSA): an indexer groups tokens into fours and averages keys to select up to 512 groups per query, then reads the individual tokens in those groups (up to 2,048 selected tokens plus a few at the end).

Each token begins with four copies of its 2,048-dimensional embedding that form four residual streams. Learned gates mix the streams into one input for attention or MoE blocks. Routing selects eight experts plus a shared expert to process the input; their combined output is scaled and added back into each stream by learned gates. A major component in the second decoder layer is the PLE: a 20.5B-parameter per-layer embedding table where each token reads 16 rows (eight lookups for the last two tokens and eight for the last three), then gates and convolves them into the residual streams.

For visual inputs the model uses a ViT that tokenizes 16×16 image patches and merges each 2×2 group of spatial patches into a visual token for the text decoder. For video, frames are sampled at 2 fps, grouped into pairs, and patch attention is computed within each pair.

Inference, formats and ecosystem

The Qwen team published BF16, FP8, oMLX and GGUF checkpoints and provided day‑0 support across transformers, llama.cpp (including Llama App), vLLM, SGLang, MLX, Inference Providers and Inference Endpoints. Quantized GGUF variants include Q4_K_M, Q6_K and Q8_0. The runtime interfaces expose features such as Multi-Token Prediction (MTP) drafting for GGUF and OMLX and an adjustable reasoning_effort parameter with values “xhigh”, “high”, “low” and “off”.

Benchmarks reported in the model card indicate Qwen4-35B-A3B performs competitively with larger models such as Qwen 3.8-Flash-Next on several tasks, according to the Qwen team’s published results.

The Qwen Team also released examples and tooling: code snippets for text, image and video inference, instructions for llama.cpp serving, and recipes for fine-tuning adapters with TRL for applications such as alert triage. The model is available on the Hub under an Apache-2.0 license with quantized checkpoints and day‑0 runtime support.


Original source: Hugging Face Blog

Leave a Comment