Skip to content
New Year BoostTop up
Apixo
Blog
news· 4 min read· via Hugging Face blog

Alibaba Launches Qwen4-35B-A3B With Hybrid MoE Design and 1M Context

Alibaba's Qwen Team has released Qwen4-35B-A3B, an Apache 2.0-licensed multimodal MoE model featuring a 1M token context window, hybrid sparse attention, and broad day-0 engine support.

Alibaba Launches Qwen4-35B-A3B With Hybrid MoE Design and 1M Context

Alibaba's Qwen Team has released Qwen4-35B-A3B on Hugging Face under the Apache-2.0 license, bringing the architectural concepts previewed in Qwen3.8-Flash-Next into full production. The model is a natively multimodal Mixture-of-Experts (MoE) system designed to accept text, image, and video inputs while outputting text. Across its entire footprint, it incorporates roughly 35 billion main parameters, 256 routed experts, and approximately 20.5 billion Per-Layer N-gram Embedding (PLE) parameters—amounting to roughly 56 billion parameters overall—while routing only about 3.8 billion active parameters per token.

Alongside an extensive native context window of 1 million tokens, the release arrives with day-0 ecosystem support across transformers, llama.cpp, Llama App, vLLM, SGLang, MLX, Inference Providers, and Inference Endpoints. Checkpoints are available across BF16, FP8, OMLX, and several GGUF quantized formats including Q4_K_M, Q6_K, and Q8_0.

A Hybrid Decoding Architecture

Qwen4-35B-A3B relies on an uncommon hybrid sequence model within its text decoder. The decoder organizes its layers into a four-layer block structure that repeats ten times. The first three layers in each block use Gated DeltaNet, a linear mechanism that updates a fixed-size internal memory state with every incoming token. The fourth layer switches to Qwen Sparse Attention (QSA), enabling the model to retrieve information from specific earlier tokens across the full 1-million-token sequence.

To identify which tokens to read, QSA uses a specialized indexer that clusters tokens into groups of four and averages their keys. For any given query, the indexer selects up to 512 of these groups. The attention layer then examines the individual tokens inside those selected sets, alongside up to three leftover tokens from the final group, allowing it to focus on a targeted subset of up to 2,048 tokens.

Information routing between layers also departs from standard Transformer designs. Each token begins with four separate copies of its 2,048-dimensional embedding, creating four parallel residual streams. Learned gates blend these streams into a consolidated input before each attention or MoE block. A combination of eight routed experts and one shared expert processes the mixed input to generate an output. Each individual residual stream then incorporates a scaled copy of that shared output, modulated by its own learned gating factor.

In the second layer of the decoder, Qwen4-35B-A3B incorporates the 20.5 billion-parameter PLE table. For every token, the system looks up 16 rows: eight rows encode the two preceding tokens, while the other eight encode a three-token sequence (the current token plus the two before it). These lookups are merged, gated into the residual streams, and smoothed through a short convolution.

Visual input is handled by a Vision Transformer (ViT) that slices images into 16×16 patches and aggregates spatial 2×2 patch groups into visual tokens for the decoder. For video input, the model samples two frames per second, pairs consecutive frames together, and lets patches attend across both frames within each pair.

Inference Speeds and Framework Integrations

The model ships with integrated control over generation behavior, including an adjustable reasoning_effort parameter with four settings: xhigh, high, low, and off (defaulting to high).

For on-device execution, the model supports Multi-Token Prediction (MTP) speculative decoding in llama.cpp, Llama App, and Apple Silicon's MLX via oMLX. In testing on an Apple Silicon M5 using the 4-bit GGUF quantization (Q4_K_M) with three draft tokens enabled via MTP, generation speed increased by 22 percent. On Apple Silicon, oMLX provides dedicated Metal kernels for QSA and the gated residual streams, while supporting SSD offloading for the large PLE parameters.

The Qwen Team's published benchmarks indicate that Qwen4-35B-A3B performs comparably to, or exceeds, the larger Qwen 3.8 Flash Next on several community benchmark evaluations.

What it means for developers

For developers deploying models on local hardware or managed clusters, Qwen4-35B-A3B represents a significant shift in resource trade-offs. By keeping active parameters down to approximately 3.8 billion per token while maintaining 56 billion total parameters of structural and n-gram memory, the model lowers compute requirements during generation without abandoning large-context capabilities.

Its Apache-2.0 licensing and prompt integration into tools like vLLM, SGLang, and Hugging Face's TRL make it accessible for both deployment and specialized fine-tuning. In security workflows, for example, the architecture can be paired with TRL's AsyncGRPOTrainer to fine-tune LoRA adapters that categorize incidents and cite specific evidence logs.

Teams building multimodal applications can also process images, video, and lengthy text contexts without having to maintain separate vision and text pipelines. For engineers testing different deployment setups, developers can try top AI models cheaply through one API at https://apixoai.online to evaluate how open-weights MoE architectures compare to managed commercial alternatives in latency and output accuracy.


Source: Welcome Qwen 4: Cutting-edge intelligence on-device — Hugging Face blog. Written by the Apixo team from that report.

#ai-news#qwen4#open-source#machine-learning#multimodal#moe
Try it with your own tools

One key for Claude, GPT, GLM, DeepSeek and more. Pay per token with crypto.

Get your API key

Keep reading