Back to Blog
AI Trend DigestEN

Qwen4-35B-A3B: A Sparse 35B Multimodal Model Built for Long-Context Work

6 min read

Abstract illustration for: Qwen4-35B-A3B: A Sparse 35B Multimodal Model Built for Long-Context Work

Qwen4-35B-A3B represents a shift in how large language models balance capability with efficiency. Released as part of the Qwen4 open model series, this 35-billion-parameter multimodal model processes both images and text, but its real innovation lies in its architecture: only 3 billion parameters activate per forward pass, paired with a native 1,048,576-token context window. The model is designed for long-horizon agentic tasks—workflows that demand sustained reasoning over many steps—while keeping inference cost and latency reasonable.

Why it matters

Most production language models face a hard trade-off: scale up to 70B or 405B parameters for quality, and inference becomes expensive and slow. Scale down to 7B or 13B, and you lose reasoning depth on complex tasks. Qwen4-35B-A3B attempts to escape this trap through sparse activation: the model has 35 billion total parameters, but a routing mechanism selects only 8 routed experts plus 1 shared expert from a pool of 256, meaning only about 3 billion parameters fire on any given token. This is not quantization or pruning—it's a structural choice built into training.

The motivation is practical. Knowledge work—coding, analysis, creative tasks, customer support—often requires models to maintain context over dozens of turns, reason through multi-step problems, and produce coherent output in specialized domains like frontend development or 3D modeling. A million-token window makes it possible to include entire codebases, long conversation histories, or detailed reference materials without truncation. Combined with sparse activation, the model can handle these scenarios without the memory and compute overhead of a fully dense 35B model.

How it works

Qwen4-35B-A3B uses a hybrid attention architecture that mixes two complementary mechanisms:

  • Linear attention (Gated DeltaNet): Uses 32 linear attention heads for values and 16 for queries/keys, with 128-dimensional heads. Linear attention scales linearly with sequence length instead of quadratically, making it efficient for very long contexts.
  • Sparse attention (Qwen Sparse Attention): Uses 16 query heads and 2 key-value heads with multi-query attention (MQA) indexing, operating on a budget of 512 blocks or 2048 tokens. This allows selective attention to relevant parts of the context without computing attention over the entire sequence.

The model stacks these in a repeating pattern: 10 blocks of (3 layers of Gated DeltaNet + MoE, then 1 layer of Qwen Sparse Attention + MoE), for 40 total layers. Each MoE layer routes tokens to 8 active experts from a pool of 256, with each expert having an intermediate dimension of 512.

Additional architectural choices include:

  • N-gram embeddings: 10 million bigram and trigram embeddings at layer 2, which improve model quality without adding compute overhead.
  • Gated residual connections: 4-branch design with rank-256 bottleneck, which helps stabilize training and information flow.
  • Multi-step training (MTP): A 1-layer auxiliary head trained with multi-step objectives, improving reasoning consistency.

The model's token vocabulary is 248,320 (padded), and it maintains a hidden dimension of 2048 throughout.

Context and efficiency

The native 1,048,576-token context window is achieved through the combination of linear attention (which scales linearly) and sparse attention (which limits the computation budget). The model card notes that this design delivers "faster inference and a drastically reduced cache footprint" compared to standard dense attention, though specific latency or memory benchmarks are not provided in the documentation.

Thinking and reasoning

Qwen4-35B-A3B supports controlled reasoning via two parameters:

  • reasoning_effort: Controls how much internal reasoning the model performs before responding. Options are xhigh (for complex tasks), high (default), low (fast responses), and off (no thinking).
  • preserve_thinking: Controls whether internal reasoning tokens are included in the output.

The model may skip thinking entirely on tasks it judges simple enough to answer directly, even at non-off reasoning effort levels. The documentation cautions that in multi-turn agentic tasks, lower reasoning effort does not always reduce total completion time—insufficient analysis can lead to failures and retries that increase overall latency and token consumption.

How to try it

The model is available in Hugging Face Transformers format and compatible with multiple inference frameworks. For details on installation and configuration, check the README at https://huggingface.co/Qwen/Qwen4-35B-A3B.

Serving options

For production workloads, the documentation recommends dedicated serving engines:

For local deployment, the Qwen4 architecture is supported by llama.cpp, Ollama, Unsloth, mlx-vlm, and LiteRT-LM.

Tokenizer

The model includes a reference Qwen4 Tokenizer/Processor that requires trust_remote_code=True and depends on tiktoken. A Jinja chat template is provided in tokenizer-compat/ for backward compatibility, though it may produce different token IDs. See README-tokenizer.md for details.

Sampling parameters

The documentation recommends:

  • Thinking mode: temperature=1.0, top_p=0.95, top_k=20, min_p=0.0, presence_penalty=0.0, repetition_penalty=1.0
  • Non-thinking mode: temperature=0.7, top_p=0.80, top_k=20, min_p=0.0, presence_penalty=1.5, repetition_penalty=1.0

Support for these parameters varies by inference framework.

Managed API

For users who prefer not to self-host, Qwen4-35B-A3B is served via Qwen Cloud under the model name qwen4-35b-a3b, with production features like built-in tools.

Who it's for (and limits)

Qwen4-35B-A3B is designed for:

  • Long-context workflows: Tasks requiring sustained reasoning over many turns or large reference materials (codebases, documents, conversation history).
  • Agentic applications: Multi-step problem-solving, planning, and tool use over extended interactions.
  • Specialized domains: Frontend development, 3D modeling, game development, and other creative or technical work.
  • Cost-conscious deployments: The sparse activation model reduces inference cost compared to dense 35B or larger models.

Limitations to note:

  • The model card does not provide specific latency, throughput, or memory benchmarks for different hardware or batch sizes.
  • Inference efficiency varies significantly across frameworks; the documentation recommends using the latest versions.
  • The model may perform internal reasoning even when you request fast responses, depending on task complexity.
  • Exact performance on standard benchmarks (MMLU, coding, vision tasks) is not detailed in the provided material; check the README or Artificial Analysis for benchmark scores.

The day's GitHub and Hugging Face picks side by side.

ProjectSource★Language / Type
elementalsouls/Claude-BugHunterGitHub34,657Python
HKUDS/CLI-AnythingGitHub70,670Python
jingyaogong/minimindGitHub75,385Python
openvinotoolkit/openvinoGitHub13,771C++
cathrynlavery/diagram-designGitHub78,700HTML
Amazon-FMR/ErgoHugging Face2,062text-generation
baidu/Unlimited-SVGHugging Face1,627image-text-to-text
Qwen/Qwen4-35B-A3BHugging Face1,367image-text-to-text
thinkingmachines/Inkling-2-MiniHugging Face4,056image-text-to-text
prism-ml/Ternary-Bonsai-2.5-27B-GGUFHugging Face1,179text-generation