Alibaba releases Qwen 4 open model with 1M-token context
Alibaba’s Qwen team released Qwen4-35B-A3B on Hugging Face on December 4, 2026, the first open-weight model of its Qwen 4 series. It is a multimodal mixture-of-experts (MoE) model that reads text, images and video, has a native context window of 1,048,576 tokens, uses only a few billion parameters per token and is licensed under Apache 2.0. Hugging Face calls it “a high-quality mid-sized model for local setups”, and it runs locally through llama.cpp and MLX from day one.
What’s new
- The model. Qwen4-35B-A3B has 35B parameters in its language model with about 3B activated per token, plus 20B in n-gram embeddings and 2B for multi-token prediction (MTP), according to the model card. Hugging Face’s launch post counts it as ~35B main parameters, ~3.8B active and ~20.5B embedding parameters, about 56B in total.
- Hybrid attention. Its 40 layers repeat one pattern ten times: three layers of Gated DeltaNet, a linear attention that keeps a fixed-size memory, then one layer of Qwen Sparse Attention (QSA), which picks at most 512 blocks or 2,048 tokens from anywhere in the context to look at. The Qwen team says this cuts the cache footprint and is what makes the 1M-token window practical.
- Experts and embeddings. Each MoE layer has 256 experts, of which 8 routed experts and 1 shared expert run per token. A large per-layer n-gram embedding table in the second layer encodes the last two and three tokens with 16 lookups per token, which the Qwen team says improves quality “without extra compute or accelerator memory overhead”.
- Inputs. Text, images and video in, text out. A vision transformer turns images into tokens; for video the processor samples 2 frames per second.
- Reasoning effort. Thinking is controlled with
reasoning_effort:xhigh,high(the default),loworoff. The olderenable_thinking=Falsestill works and equalsoff. - Checkpoints. BF16, FP8, GGUF (Q4_K_M, Q6_K and Q8_0 in the ggml-org repository) and quantized MLX builds for Apple Silicon.
The model follows Qwen3.8-Flash-Next, which previewed the architecture, and Qwen4-Max, the series’ flagship. The model card says the Qwen 4 open model series is “now on its way”. Benchmarks are published as a chart in the model card, with agentic scores such as Terminal Bench 4.1 taken from Artificial Analysis; Hugging Face says the model is comparable to the much larger Qwen 3.8 Flash Next and better on some tasks.
What it means for developers
Qwen4-35B-A3B had day-0 support in Transformers, llama.cpp, vLLM, SGLang, TRL, Hugging Face Inference Providers and Inference Endpoints, and the model card also lists Ollama, Unsloth and LiteRT-LM. With a GGUF build, one command serves it locally, from the Hugging Face post:
llama serve -hf ggml-org/Qwen4-35B-A3B-GGUF:Q6_K
llama.cpp supports the built-in MTP drafter for speculative decoding. Hugging Face measured 22% faster generation with 3 draft tokens on an Apple Silicon M5 with the Q4 quant:
llama serve -hf ggml-org/Qwen4-35B-A3B-GGUF:Q4_K_M --spec-type draft-mtp --spec-draft-n-max 3
In Transformers, the model loads with AutoModelForMultimodalLM and a separate processor repository (huggingface/Qwen4-35B-A3B-processor), and reasoning_effort is passed to apply_chat_template. Tool calling works by passing Python functions as tools. Video input needs torchcodec and ffmpeg installed.
A few things to know before switching:
- New tokenizer. Qwen ships a reference tokenizer that needs
tiktokenandtrust_remote_code=True. A Jinja chat template is included for compatibility, but the model card warns it can produce different token IDs. - Sampling. The recommended settings differ by mode:
temperature=1.0,top_p=0.95with thinking, andtemperature=0.7,top_p=0.80,presence_penalty=1.5without. - Lower effort is not always faster. The model card warns that in multi-turn agent tasks a lower effort can cause more failures and retries, raising total time and token use.
- MLX is partial. oMLX supports image input, MTP and offloading the embedding table to SSD; mlx-lm support for the language model is still on its way to the official repository.
- Hosted API. Qwen Cloud will serve it as
qwen4-35b-a3b; the model card says the API will be available “soon”.
Hugging Face also published a TRL recipe that fine-tunes the model with reinforcement learning to triage security alerts. On 12 held-out tasks, the base model passed 4, an adapter after 50 updates passed 6 and one after 100 updates passed 3, so Hugging Face suggests picking checkpoints with a held-out benchmark rather than training reward.
How it compares
Qwen4-35B-A3B joins other recent open models aimed at local hardware, such as Ternary Bonsai 2.5 27B, a ternary-compressed coding model that fits in 5.9 GB. Its pitch is a long context at low cost: only about 3B parameters run per token, and three out of four attention layers keep a fixed-size memory instead of a cache that grows with the context. For a recent coding model from another Chinese lab, see Z.ai’s GLM-5.4, whose open weights have not been released yet. The Qwen team has not published a direct comparison with either.
Sources
- Welcome Qwen 4: Cutting-edge intelligence on-device, Hugging Face, December 4, 2026
- Qwen4-35B-A3B model card, Qwen team on Hugging Face
- Qwen4-35B-A3B GGUF builds, ggml-org