Paper Breakdowns  /  Qwen4-Coder
Paper 106~8 min readQwen · 2026 · Apache-2.0
Paper Breakdown

Qwen4-Coder,
explained.

Passing 80% on SWE-Verified used to mean a frontier API and a data-center bill. Qwen4-Coder does it — reportedly ~82% — as an open, Apache-2.0 model on a MacBook. The magic isn't a bigger model; it's a smarter shape. A mixture-of-experts stores 32 billion parameters but wakes only 3 billion per token, and that one fact splits the two things everyone conflates: how much you must hold versus how fast you can run.

Video breakdown
The animated walkthrough is in production.
Read the full breakdown below in the meantime ↓
01

The shape: 32B stored, 3B awake

Qwen4-Coder is a mixture-of-experts, the coding-specialized successor to Qwen3: roughly 32B total parameters split across many experts, with a router that activates only about 3B per token — under 10%. Every token flows through the shared layers plus a handful of routed experts; the other experts sit dormant for that token.

That's the entire trick behind "a strong coder on a laptop." A dense 32B model would need 32B of everything — memory and compute — on every token. The MoE keeps the 32B of knowledge but pays roughly 3B of compute. To see why that fits a Mac, you have to separate two costs people usually lump together.

02

The decoupling: storage ≠ speed

Running a model locally has two independent bills. Storage: every weight must live in memory, because the router might pick any expert on any token — so you hold all 32B. Speed: decoding is memory-bandwidth bound, and per token the hardware only reads the weights it actually uses — the active ~3B. A dense model ties these together; an MoE cuts the knot.

All experts resident · only a few compute
32B params
all experts
RAM holds ALL
storage = total
|
Router picks few
~3B active
Speed = active
decode reads 3B
RAM ∝ total params  ·  decode tokens/sec ∝ bandwidth / active params

You buy the RAM for a 32B model and get the throughput of a 3B one. That asymmetry is the whole product.

03

Does it fit? The napkin math

Storage is just arithmetic: bytes = parameters × bits ÷ 8. In 4-bit, 32B parameters weigh about 16 GB — which slides into a 24 GB Mac's unified memory with room for the KV cache and the OS. In 16-bit it would be 64 GB and wouldn't fit; quantization is what makes it a laptop model.

store = params · bits/8  →  32e9 · 4/8 = 16 GB (4-bit)  vs  64 GB (fp16)

Fits ⟺ store ≤ VRAM/unified RAM. Speed is a separate line: bandwidth ÷ active-bytes, so it's the 3B — not the 32B — that sets tokens/sec.

The key idea

"Can I run it?" is really two questions. Does it fit? is answered by total params and your quant level. Is it fast enough? is answered by active params and your memory bandwidth. An MoE is engineered to make the second answer far better than the first would suggest.

04

82% on SWE-Verified — locally

SWE-Verified is the hard one: real GitHub issues where a patch counts only if it applies and turns the failing tests green without breaking the passing ones. Reaching ~82% on it is frontier-class agentic coding — and Qwen4-Coder is reported as the first open, Mac-runnable model to clear 80% there.

The significance isn't the two-point benchmark bump; it's where the capability now lives. A genuinely useful coding agent that runs offline, with open weights and an Apache-2.0 licence, changes who can build with it and under what constraints — no per-token API meter, no data leaving the machine.

05

Why it matters

Qwen4-Coder is the clearest proof yet that the sparse-MoE recipe has made local-first coding agents real. The playbook it validates is exactly the one in the local LLM stack and on-device AI handbooks: pick an MoE so RAM sizing and speed decouple, quantize to fit, and you get a capable model without a data center.

It also sharpens a mental model worth keeping: for any local model, compute the two numbers separately. Total × bits ÷ 8 tells you if it loads; active params vs your bandwidth tells you if it's usable. Dense models make those two move together; every strong on-device release from here will be an MoE precisely to pull them apart.

Read next

The line it continues: Qwen3. The stack it powers: Local LLM Stack. The fit math in depth: On-Device AI.

RUN IT YOURSELF

Two bills: does it fit, and is it fast?

"Can I run this MoE?" is two separate calculations, and both are one-liners. Storage is total params × bits ÷ 8 — that's what has to fit in RAM. Speed is bandwidth ÷ active-bytes — and it depends on the ~3B active experts, not the 32B stored. Watch a 32B model fit a 24 GB Mac at 4-bit while decoding at the speed of a 3B one, and watch fp16 blow the budget. Change the total, active, bit-width, RAM, and bandwidth.

CPython · WebAssembly
Frequently asked

Quick answers

What is Qwen4-Coder?

An open, Apache-2.0 coding MoE (~32B total / ~3B active per token) reported at ~82% on SWE-Verified — the first open, MacBook-runnable model past 80% there — using the mixture-of-experts shape to store big while computing small.

How does a 32B model fit a laptop?

Quantized to 4-bit, 32B params ≈ 16 GB (32e9×4÷8), which fits a 24 GB Mac. You need RAM for all the weights, but per-token compute is set by the ~3B active experts.

Why does speed track active, not total?

Decode is memory-bandwidth bound — each token reads only the weights it uses, and an MoE uses just its active experts (~3B). So throughput is governed by active params; RAM by total.

How does it relate to Qwen3?

It's the coding-specialized successor, pushing the same sparse-MoE efficiency toward a concrete goal: a capable, open, locally-runnable software-engineering agent.

Qwen4-Coder · Qwen Team · 2026 · Apache-2.0 · reported figures from the model release · Vibe Engines · 2026
Finished this one? 0 / 108 Paper Breakdowns done

Explore the topic

See this alongside everything else on the same subject — handbooks, system designs, challenges and tools, in one place.

More Paper Breakdowns