Qwen 3.5: 397B MoE, 17B Active, 262K Context (2026 Guide)

Qwen 3.5 is Alibaba's 397B-A17B MoE (17B active per token), released February 2026 under Apache 2.0 with a native 262K context. Real architecture, SWE-bench 76.4, the quantization traps people hit, tool-calling footguns, and how to run it on Morph's API.

July 12, 2026 · 1 min read

Last updated July 2026.

Qwen 3.5 is Alibaba's February 2026 open-weight (Apache 2.0) MoE family. The flagship Qwen3.5-397B-A17B activates 17B of its 397B parameters per token, runs a hybrid Gated DeltaNet + full-attention stack, and ships a native 262,144-token context. It answers in thinking mode by default. On Alibaba's own scaffold it posts 76.4 on SWE-bench Verified and 91.3 on AIME 2026.

30% → ~70%
An INT4 quant of Qwen 3.5 with reasoning on truncated roughly 70% of AIME25 answers by hitting the 32K output limit, versus about 30% for the full model. The weights barely lost accuracy; they just started thinking too much to finish.
The Kaitchup, Qwen3.5 quantization evals (2026)

That is the finding people miss. Qwen 3.5's benchmark line is strong, but its real-world failure mode is length, not knowledge: the moment you quantize it and leave reasoning on, it out-thinks its own output budget. Below is the confirmed architecture, the scores, the traps (quantization, thinking-mode toggles, tool-calling parsers), and how to run it on Morph at 16-bit fidelity.

397B / 17B
Total / active parameters
262,144
Native context (≈1M with YaRN)
76.4
SWE-bench Verified (Qwen scaffold)
Apache 2.0
License, open weights on HF

What Is Qwen 3.5?

Qwen 3.5 is an open-weight mixture-of-experts LLM family from Alibaba's Qwen team, released February 2026 under Apache 2.0. It spans nine sizes from 0.8B to the flagship 397B, with native multimodal training and support for 201 languages. The model this page is about is Qwen3.5-397B-A17B: 397 billion total parameters, 17 billion active per token, and a native 262,144-token context window.

It is the successor to Qwen3, Qwen3-Coder, and Qwen3-Next. The lineage matters because the architecture is not a scaled-up dense transformer; it inherits Qwen3-Next's sparse-MoE-plus-linear-attention direction and pushes it further. If you are looking for the Qwen Code command-line tool rather than the model, see Qwen CLI (Qwen Code) instead, which is a separate piece of software that can run on top of this model.

Weights, including official FP8 and GPTQ-Int4 quantizations, are on Hugging Face (Qwen/Qwen3.5-397B-A17B). Apache 2.0 permits commercial use and fine-tuning outright, no access-terms click-through, which is a real advantage over gated releases when you need to ship a derivative model.

Architecture: 397B-A17B, Hybrid Attention

Qwen3.5-397B-A17B is a 60-layer sparse MoE with 512 experts (10 routed plus 1 shared active per token) and a 4096 hidden dimension. What makes it distinctive is the attention: instead of full softmax attention on every layer, it interleaves Gated DeltaNet linear-attention layers with periodic full-attention layers, roughly 75% linear to 25% full. That is the mechanism that keeps a 262K-token context cheap to serve.

The Hugging Face model card names the exact repeating block: 15 × (3 × (Gated DeltaNet → MoE) → 1 × (Gated Attention → MoE)). So three linear-attention MoE blocks, then one full-attention MoE block, repeated 15 times for 60 layers. The linear layers use 64 heads for V and 16 for QK; the full layers use 32 query heads and 2 KV heads (GQA) with a 64-dimension RoPE slice.

Qwen3.5-397B-A17B confirmed architecture (Hugging Face model card)
ComponentValue
Total parameters397B
Active parameters per token17B
Layers60
Experts512 (10 routed + 1 shared active)
Expert intermediate dim1,024
Hidden dimension4,096
Attention pattern3 × Gated DeltaNet → 1 × Gated Attention, ×15
Linear-attention heads64 V / 16 QK, head dim 128
Full-attention heads32 Q / 2 KV (GQA), head dim 256, RoPE dim 64
Native context262,144 tokens
Extended context (YaRN)≈1,010,000 tokens
Default modeThinking (<think>…</think>) on
LicenseApache 2.0
Why the hybrid attention matters

A pure full-attention model pays quadratic cost in sequence length, so a 262K context gets expensive fast. Gated DeltaNet is a linear-attention variant whose cost grows linearly, so putting 75% of the layers on it and reserving full attention for 1 layer in 4 keeps long-context serving affordable while retaining enough exact-recall capacity to stay accurate. The trade-off shows up under quantization, covered below: those linear layers are the ones you must not compress aggressively.

Benchmarks: SWE-bench, LiveCodeBench, AIME

On Alibaba's own agent scaffold, Qwen3.5-397B-A17B posts 76.4 on SWE-bench Verified, 83.6 on LiveCodeBench v6, 91.3 on AIME 2026, and 88.4 on GPQA Diamond. Alibaba claims the model beats GPT-5.2, Claude Opus 4.5, and Gemini 3 Pro on 80% of evaluated categories. Read these as vendor-run numbers: they use Qwen's internal bash-plus-file-edit scaffold, and independent reproductions outside that harness are still thin.

Qwen3.5-397B-A17B reported scores (Alibaba scaffold, Feb 2026)
BenchmarkScoreWhat it measures
SWE-bench Verified76.4Real GitHub issue fixes, agentic
LiveCodeBench v683.6Contamination-controlled competitive coding
AIME 202691.3Hard competition math
GPQA Diamond88.4Graduate-level science QA
Terminal-Bench 252.5End-to-end terminal task completion
BFCL v472.9Function/tool-calling accuracy
MMLU-Pro87.8Broad reasoning
BrowseComp78.6Web-browsing agentic tasks

The coding numbers are the interesting ones for agent builders. SWE-bench Verified at 76.4 puts Qwen 3.5 in the same band as the strong open-weight coders of 2026 (DeepSeek V4, GLM-5.x, Kimi K2.6) rather than clearly ahead of them. Terminal-Bench 2 at 52.5 is the more honest agentic signal, since it measures whether the model actually finishes a multi-step terminal task, and every model in this class scores lower there than on SWE-bench. For how much vendor scaffolds inflate scores, see our SWE-bench Pro breakdown.

Run Qwen 3.5 on Morph

Morph serves Qwen 3.5 as morph-qwen35-397b through an OpenAI-compatible API at https://api.morphllm.com/v1, at the full native 262,144-token context with a 131,072-token max output. Pricing is $0.50 per million input tokens, $3.50 per million output, and $0.30 per million cached input tokens. It is one of Morph's fast general coding models, served on custom inference kernels.

$0.50 / M
Input tokens
$3.50 / M
Output tokens
$0.30 / M
Cached input

The reason to run it hosted rather than self-host: the 397B model needs roughly 8 GPUs to serve the full context, and most serverless hosts quantize activations to fp8 to cut that cost, which, per the section below, is exactly where Qwen 3.5 gets fragile. A call from the OpenAI SDK:

from openai import OpenAI

client = OpenAI(
    base_url="https://api.morphllm.com/v1",
    api_key="$MORPH_API_KEY",
)

resp = client.chat.completions.create(
    model="morph-qwen35-397b",
    messages=[
        {"role": "user", "content": "Refactor this function to be pure and add tests."},
    ],
)
print(resp.choices[0].message.content)

See pricing for the full model list, and Open Source Models for the rest of the fast general coding lineup (Qwen 3.6, MiniMax, GLM-5.2, DeepSeek V4 Flash).

The Quantization Trap

Qwen 3.5 quantizes cleanly with thinking off and badly with thinking on. Community evals across GPTQ INT4, FP8, AutoRound INT4, NVFP4, and AWQ found that non-reasoning quality stays close to the full model, but with reasoning enabled the quantized models think more, which makes them far likelier to hit the 32K output limit. On AIME25, an INT4 model truncated about 70% of responses versus about 30% for the original. Same weights, roughly same accuracy per finished answer, but many fewer answers finish.

Quantizes fine
  • Non-thinking chat and coding: INT4/FP8 stay near full quality
  • Qwen3.5-27B INT4 is robust to quantization overall
  • Official FP8 uses fine-grained block-128 quant, a safe default
  • Linear-attention layers are fine when generation stays short
Where it breaks
  • Do NOT quantize the shared expert: substantial accuracy loss
  • With reasoning on, INT4 doubled AIME25 truncation (~30% → ~70%)
  • Linear-attention errors only surface during long generation
  • FP8 gives a larger memory footprint than INT4 with no accuracy win
Two rules if you self-host and quantize
  • Keep the shared expert in higher precision. It is active on every token, so its errors compound. One community AutoRound INT4 build underperformed Intel's official quant "by a significant margin," traced directly to a quantized shared expert.
  • Budget output length, not just context. A quant that thinks more needs a higher max_tokens ceiling or it truncates mid-reason. If you must cap output, prefer non-thinking mode over a quantized thinking model.

This is why serving fidelity matters. Morph runs Qwen 3.5 without the aggressive activation quantization that trips these failure modes, so the output tracks the published weights rather than a compressed approximation of them.

Thinking Mode Footguns

Qwen 3.5 generates a <think>…</think> block by default, and turning that off is more fragile than the docs suggest. On vLLM the switch works but has version traps; on SGLang, users reported it not working at all. If your app expects clean final answers, verify the toggle actually took effect before you ship.

Disabling thinking mode: what actually works (2026)
RuntimeHowGotcha
vLLM--default-chat-template-kwargs '{"enable_thinking": false}'Below 0.9.0 it is not honored; with --reasoning-parser qwen3, some builds route tokens to delta.reasoning not delta.content
SGLangchat_template_kwargs.enable_thinking=false in the requestReported not to disable thinking (issue #20573, opened Mar 2026); treat as unreliable
llama.cpp--chat-template-kwargs '{"enable_thinking":false}'Works; confirm your build parses the flag

Tool calling

Tool calling needs the right parser or the model's function calls come back as plain text. On vLLM use --enable-auto-tool-choice --tool-call-parser qwen3_coder; on SGLang use --tool-call-parser qwen3_coder. A full 397B serve command that gets tools and context right:

vllm serve Qwen/Qwen3.5-397B-A17B \
  --tensor-parallel-size 8 \
  --max-model-len 262144 \
  --reasoning-parser qwen3 \
  --enable-auto-tool-choice \
  --tool-call-parser qwen3_coder

Sampling and YaRN

The model card recommends temperature 0.6 / top_p 0.95 / top_k 20 for thinking mode and 0.7 / 0.8 / 20 for non-thinking. For long context, only enable YaRN when your inputs actually exceed 262K: static YaRN scaling degrades quality on shorter texts, so leaving it on by default costs you accuracy on the majority of requests that fit the native window.

Qwen 3.5 vs DeepSeek, GLM, Kimi

In community agentic-coding rankings, Qwen3.5-397B (reasoning) sits just behind the 2026 open-weight leaders rather than on top: DeepSeek V4 Pro leads, Kimi K2.6 is close, and Qwen 3.5 lands ahead of GLM-5.1. The differences that matter in practice are license, cost to self-host, and what each model is built for, not the last point of SWE-bench.

Open-weight coding models, 2026 (community rankings, adapt to your workload)
ModelSparsityLicensePractical edge
Qwen 3.5 (397B-A17B)397B / 17BApache 2.0Native multimodal, 262K ctx, permissive license
DeepSeek V4 Pro1.6T / 49BMITBest perf-per-cost self-host, broadest r/LocalLLaMA coverage
Kimi K2.6large MoEModified MITBuilt for sub-agent parallelism / harness pipelines
GLM-5.1large MoEMITEnterprise fine-tuning + commercial flexibility

The one consensus across every roundup: these models perform materially better inside a structured agent harness than in raw chat, and that scaffolding is not optional for production. Which is where code search comes in, a model with a 262K window is only as good as what you put in it. For head-to-head model comparisons, see best open-source coding models and DeepSeek V4.

Pros and Cons

Strengths
  • Apache 2.0: commercial use and fine-tuning with no gate
  • 397B/17B sparsity keeps inference cost low for the capability
  • Native 262K context, extensible to ~1M with YaRN
  • Strong reported coding + math (SWE-bench 76.4, AIME 91.3)
  • Native multimodal training, 201 languages, nine sizes to pick from
Limitations
  • Benchmark scores are Qwen's own scaffold; independent repros are thin
  • Quantized + thinking = truncation blowups (AIME25 ~70% vs ~30%)
  • Thinking-off toggle unreliable on SGLang (issue #20573)
  • Self-hosting the 397B needs ~8 GPUs for full context
  • Static YaRN hurts short-context accuracy if left on

When to Use It, When Not

Use Qwen 3.5 when you need a permissively licensed, long-context coding/reasoning model and want to control the deployment or fine-tune a derivative. The Apache 2.0 license and the 262K native window make it a strong base for agentic products and in-house fine-tunes, and the sparse MoE keeps per-token cost down relative to dense models of similar capability.

Skip it, or run it hosted at full precision, when you are quantizing aggressively and leaving reasoning on (the truncation trap), when you need SGLang with thinking reliably off (the toggle is unreliable there), or when you do not have the 8-GPU budget to serve the full context yourself. For most teams the pragmatic path is the Morph API: full 262K context, no quantization fragility, one OpenAI-compatible endpoint.

Frequently Asked Questions

What is Qwen 3.5?

An open-weight (Apache 2.0) MoE model family from Alibaba's Qwen team, released February 2026. The flagship Qwen3.5-397B-A17B has 397B total parameters, 17B active per token, 512 experts, 60 layers, a hybrid Gated DeltaNet + full-attention stack, and a native 262,144-token context. It runs in thinking mode by default.

What is Qwen 3.5's context window?

262,144 tokens native (256K), extensible to about 1,010,000 with YaRN. The model card warns static YaRN degrades short-context quality, so enable it only when your inputs exceed the native window. Morph serves the full 262,144-token context with a 131,072-token max output.

What are Qwen 3.5's benchmark scores?

On Alibaba's scaffold: SWE-bench Verified 76.4, LiveCodeBench v6 83.6, AIME 2026 91.3, GPQA Diamond 88.4, Terminal-Bench 2 52.5, BFCL v4 72.9. Alibaba claims it beats GPT-5.2, Claude Opus 4.5, and Gemini 3 Pro on 80% of categories; independent reproductions are limited.

Does quantizing Qwen 3.5 hurt quality?

With thinking off, INT4/FP8 stay close to the full model. With reasoning on, quantized models think more and truncate far more (AIME25 ~70% vs ~30%). Do not quantize the shared expert, and keep linear-attention layers in higher precision; their errors only show during long generation.

How do I turn off thinking mode?

vLLM: --default-chat-template-kwargs '{"enable_thinking": false}' (needs 0.9.0+, and watch the delta.reasoning routing bug). SGLang: users reported the toggle does not work (issue #20573), so verify output. llama.cpp: --chat-template-kwargs '{"enable_thinking":false}'.

How does Qwen 3.5 compare to DeepSeek and Kimi for coding?

Community rankings put DeepSeek V4 Pro ahead, Kimi K2.6 close, and Qwen3.5 (reasoning) just under, above GLM-5.1. DeepSeek is the cheapest self-host and best-documented, Kimi is built for sub-agent parallelism, and Qwen 3.5's edge is native multimodal training plus a permissive Apache 2.0 license.

Is Qwen 3.5 open source?

Yes, Apache 2.0 on Hugging Face (Qwen/Qwen3.5-397B-A17B) with official FP8 and GPTQ-Int4 quants. Commercial use and fine-tuning are permitted. The 397B model needs roughly 8 GPUs to serve at full context, so most teams use a hosted API.

Related Articles

Private deployments

The fastest endpoints are private deployments

Morph's top speeds come from dedicated deployments, not shared public endpoints: speculators trained on your traffic, caching tuned to your workload, and volume discounts over public per-token rates. Over 100 billion tokens per day run this way.

Talk to us about a private deployment

Fill Qwen 3.5's 262K window with the right code, not noise

WarpGrep is an agentic code search tool that works as an MCP server. Connect it to any Qwen 3.5-powered agent for high-precision codebase context, so the long context holds the code that matters. Free for 100k requests, then $1 per 1M.

Sources