Skip to main content
Back

Alibaba's Qwen3-235B Beats Claude and o4-mini at a Fraction of the Cost

Alibaba's Qwen team open-weighted a 235B mixture-of-experts model with a togglable thinking mode, 22B active parameters, and Apache 2.0 licensing.

Pro

  • Qwen released Qwen3-235B-A22B, a 235B MoE model with 22B active parameters under Apache 2.0.
  • Single model toggles between thinking and non-thinking modes via enable_thinking or /think tags.
  • 128 experts, 8 activated, 94 layers, 32K native context, 131K with YaRN scaling.
  • Trained on 36T tokens across 119 languages in a three-stage pretraining pipeline.
  • Scores 85.7 on AIME'24 and 2056 CodeForces rating, competitive with DeepSeek-R1 and o1.
  • Hosted pricing around $0.455/M input, $1.82/M output; runs on vLLM, SGLang, Ollama.

Alibaba's Qwen team released Qwen3-235B-A22B, the flagship of the Qwen3 family, and it arrives as one of the most capable open-weight models available under Apache 2.0. The headline number is 235 billion total parameters, with only 22 billion active per forward pass thanks to a mixture-of-experts (MoE) design. The more interesting design choice: one set of weights that can flip between step-by-step reasoning and fast conversational replies on a per-turn basis.

One model, two brains

Most vendors ship reasoning models and chat models separately. Qwen3 collapses both into the same checkpoint. Thinking mode has the model reason step by step before delivering an answer; non-thinking mode gives cheap, direct replies. You toggle it with a single flag in the chat template:

text = tokenizer.apply_chat_template(
    messages,
    tokenize=False,
    add_generation_prompt=True,
    enable_thinking=True  # or False for fast mode
)

There is also a soft switch. Adding /think or /no_think inside a user message flips the mode for that turn, and the model respects the most recent instruction across multi-turn conversations. In thinking mode, output is wrapped in a <think>...</think> block followed by the final answer, which makes it trivial to strip reasoning traces before showing users a response.

What is actually inside

The architecture is an aggressively sparse MoE. Key specs from the model card:

  • 235B total parameters with 22B activated, 94 layers, GQA with 64 query heads and 4 KV heads, 128 experts with 8 activated, and 32,768 native context extended to 131,072 tokens with YaRN
  • Apache 2.0 license, BF16 weights, drop-in qwen3_moe class in Transformers 4.51+
  • Supported by vLLM, SGLang, Ollama, LM Studio, MLX-LM, llama.cpp, and KTransformers

The 22B active parameter count is what matters for cost. Inference compute and memory bandwidth scale with active parameters rather than total, so serving costs are closer to a 22B dense model than a 235B one, while quality benefits from the full expert pool.

How it was trained

The Qwen3 technical report details a three-stage pretraining pipeline on a much larger corpus than its predecessor. Where Qwen2.5 used 18 trillion tokens, Qwen3 uses roughly 36 trillion covering 119 languages and dialects. To reach that volume, the team pulled data from the web and from PDF-like documents, using Qwen2.5-VL to extract text and Qwen2.5 to clean it, then leaned on Qwen2.5-Math and Qwen2.5-Coder to generate synthetic math and code data.

The three pretraining stages break down as follows:

  1. Stage 1 (S1): pretrained on over 30 trillion tokens at 4K context, building basic language skills and general knowledge
  2. Stage 2 (S2): the dataset shifts toward knowledge-intensive STEM, coding, and reasoning content, adding another 5 trillion tokens
  3. Stage 3: high-quality long-context data extends the window to 32K tokens

Post-training then does the heavy lifting to fuse the two modes. The flagship runs through a four-stage process: the first two stages develop reasoning ability, and the next two integrate strong non-thinking behavior. The result is a single set of weights that can be pushed toward either mode at inference time, with a token budget knob for controlling how much reasoning to spend.

Where it lands on benchmarks

Qwen positions this as a frontier-competitive release, reporting results in coding, math, and general capabilities against DeepSeek-R1, o1, o3-mini, Grok-3, and Gemini-2.5-Pro. Independent numbers back up the math story in particular. Qwen3 235B ranks #3 on Math500, #5 on AIME, and #3 on MGSM, and its thinking mode beats Claude 3.7 Sonnet and o4-mini on mathematical reasoning tasks.

Reported scores from the technical report on standard benchmarks:

BenchmarkQwen3-235B-A22BQwen2.5-72B-Instruct
ArenaHard95.681.2
AIME'2485.718.9
AIME'2581.515.0
LiveCodeBench v570.730.7
CodeForces (rating)2056859
LiveBench77.151.4
BFCLv3 (tool use)70.863.4

The jump on AIME from 18.9 to 85.7 against last year's Qwen2.5-72B is the clearest signal that thinking mode is doing real work on hard reasoning problems.

Weak spots show up on domain-specific private benchmarks. Qwen3 ranks #29 out of 43 models evaluated on TaxEval. Agentic tool-use is uneven too: on Tau2-Bench Telecom, the base 235B variant scores 27%, roughly on par with Llama 3.3 70B and behind smaller Qwen3 thinking variants.

Pricing and how to run it

On hosted APIs, the base Qwen3-235B-A22B is priced at $0.455 per million input tokens and $1.82 per million output tokens, with a 131,072 token context window and 8,192 max output tokens. That is roughly an order of magnitude cheaper than the frontier closed models it competes with on math and coding.

Self-hosting is straightforward if you have the GPUs. For an OpenAI-compatible endpoint:

vllm serve Qwen/Qwen3-235B-A22B --enable-reasoning --reasoning-parser deepseek_r1
# or
python -m sglang.launch_server --model-path Qwen/Qwen3-235B-A22B --reasoning-parser qwen3 --tp 8

For long-context workloads, YaRN scaling can be enabled via a rope_scaling field in config.json or a CLI flag, pushing the effective window to 131K tokens. The team specifically warns against turning YaRN on for shorter inputs, since static YaRN can degrade performance on prompts inside the native 32K window.

Gotchas worth knowing

A few settings that will save debugging time:

  • In thinking mode, use Temperature=0.6, TopP=0.95, TopK=20. Greedy decoding is explicitly discouraged because it causes endless repetitions.
  • In non-thinking mode, use Temperature=0.7, TopP=0.8, TopK=20.
  • Recommended max output is 32,768 tokens for normal queries and 38,912 for math and coding competition problems.
  • In multi-turn history, strip the <think> content from prior assistant turns. The provided Jinja2 chat template already handles this, but custom pipelines need to do it explicitly.

Why this release matters

The open-weights race has been running hot, and Qwen3-235B-A22B collapses three trends into one artifact: sparse MoE for cheap inference, unified thinking and non-thinking behavior in a single checkpoint, and a permissive license. For teams building agents, the combination of strong tool-calling, a 128K effective context, and a native Qwen-Agent framework with MCP support means you can prototype a reasoning agent locally and ship it without paying per token to a closed provider. The dense base models also match Qwen2.5 base models with far more parameters (Qwen3-1.7B/4B/8B/14B/32B tracking Qwen2.5-3B/7B/14B/32B/72B respectively), which suggests the same training recipe is squeezing meaningfully more capability out of the same parameter budget across the whole family.