- Qwen3.8-Flash-Next is Alibaba’s new AI model, out in August 2026. It reads text and images and writes text back, tuned for writing code and running multi-step work on your behalf.
- Anyone can download the model files, live since 24 August. The license is not fully permissive though, so read it before shipping it in a product.
- The real story: Alibaba shipped this as a dry run for the next big release, Qwen4. The identifier inside the model files literally says
qwen4_exp, as in “Qwen4 experimental”. - It is 125B parameters in size, but only 6B of them run for any given word. Big-model knowledge, small-model bill.
- It reads about 750,000 words in one go (1M tokens), and at that length it is 8x faster than its much larger sibling.
- Training it cost roughly 1/9 of the 397B Qwen3.7-Plus, and it still beats that model on coding and office work.
- It is cheap to run: $0.16 in / $0.47 out per million tokens. The flagship in the same family costs 12x that.
When Alibaba shipped Qwen3-Next, the pitch was: this is not a finished product, it is next generation’s architecture released early so the community can poke at it. That architecture then carried the whole Qwen3.5 through Qwen3.8 line.
Qwen3.8-Flash-Next is the same move again. The model is usable today and it is remarkably cheap, but what Alibaba is really shipping is the architecture Qwen4 will sit on top of. They did not even hide it: the model_type in the Hugging Face repo is qwen4_exp.
So let us look at the thing that beats a 397B model with 6B active parameters. 👇🏻
What Qwen3.8-Flash-Next Actually Is
A downloadable mixture-of-experts model that reads text and images, writes text, and is tuned for coding and agent work.
The numbers:
| Qwen3.8-Flash-Next | |
|---|---|
| Total parameters | 125B |
| Active per token | 6B (10 routed + 1 shared expert) |
| N-gram embedding | 51B (separate) |
| MTP module | 4B |
| Layers | 48 |
| Expert pool | 512 |
| Context | 262,144 tokens, ~1M with YaRN |
| Input | Text + images |
| License | qwen-community-1.0 |
The line that matters is the second one: 6B active parameters. In an MoE model the total is a marketing number; what sets your bill and your latency is how many parameters fire per token. Here that is about 5% of the 125B.
The comparison makes it sharper. Alibaba’s own 397B Qwen3.7-Plus activates 17B per token. Flash-Next runs on less than a third of that and still beats it on coding and office benchmarks, having cost roughly one ninth as much to train.
Because those parameters are never multiplied, only looked up. A normal embedding table maps a single token to a vector. An n-gram embedding maps the pattern formed by the current token plus a few preceding ones, giving the model a ready-made memory for common phrases and local patterns.
Since the lookup addresses can be computed ahead of time, that table does not have to sit in VRAM: it can live in host memory and be prefetched asynchronously while the GPU computes. Capacity grows by 51B parameters, per-token compute barely moves.
What Changed in the Architecture 🧠
Alibaba lists four changes: attention, residual, embedding, optimization.

1. Attention: GDN + QSA
Classic full attention compares every new token against every previous one. As context grows, both compute and KV cache traffic blow up.
Flash-Next splits the job. Three of every four layers use Gated DeltaNet (GDN), which compresses history into a fixed-size state: it remembers. The remaining layer does global attention: it retrieves precisely from anywhere in the context.
The new part is inside that global layer: Qwen Sparse Attention (QSA). Sparse attention is not a new idea, DeepSeek’s DSA does something similar. The difference is in the indexer. DSA scores importance at token level, and as context grows the indexer itself turns into a real cost line.
QSA compresses that step: a lightweight indexer aggregates the sequence into micro-blocks, estimates importance per block, then attends only to the winning regions. That cuts both the attention cost and the cost of deciding where to look. Each layer also compresses independently, unlike approaches that share indices across layers, which suits a hybrid stack where GDN and attention layers alternate.
Short version: GDN remembers, QSA retrieves.
2. Residual: a four-lane road
In a normal Transformer every layer reads from and writes to the same residual stream. The deeper the network, the more early features get diluted by everything written after them.
Gated Residual (GR) widens that single lane into four parallel branches, with an element-wise dynamic gate deciding how much each layer reads from and writes to each branch. In Alibaba’s analysis one branch naturally becomes a long-range highway, wiring the first attention layer straight into the middle and later layers. The residual state can also be stored in FP8, cutting memory traffic further.
3. Optimization: Muon, and the end of batch warmup
The model is trained with the Muon optimizer. Weights that genuinely act as 2D linear maps (attention, GDN, MoE experts) go to Muon; embeddings and the MoE router stay on AdamW.
One practical finding stands out: batch size warmup turned out to be unnecessary. Ramping from a small batch to the target did not improve the final result and cost 18.8% more optimizer steps. The final recipe starts at the target batch size.
How Fast Is It at Long Context? ⚡
This is the actual pitch.

The official figures:
- At 1M tokens the QSA kernel is 7.6x faster on prefill and 4.9x on decode.
- In a setup meant to mirror online serving (90% prefix cache hit rate), at 1M tokens of context it delivers 8.6x the prefill throughput of Qwen3.7-Plus.
Prefill is the phase where the model reads your input before it writes a single token back. In a long-context agent loop, that is where most of the waiting happens. If you want to know how many tokens your own file is, paste it into our token counter.
Benchmarks 📊
All scores are Alibaba’s own runs. Columns: Flash-Next, the dense 27B Qwen3.8-27B, the 397B Qwen3.7-Plus, DeepSeek-V4-Flash-0731 and Claude Opus 4.6 (Max).
Coding:
| Benchmark | Flash-Next | 3.8-27B | 3.7-Plus | DeepSeek-V4-Flash | Opus 4.6 |
|---|---|---|---|---|---|
| DeepSWE 1.1 | 58.7 | 42.2 | 16.5 | 54.4 | – |
| SWE-bench Pro | 62.5 | 61.7 | 55.8 | 56.0 | 53.4 |
| SWE-bench Multilingual | 81.0 | 73.8 | 75.8 | – | 77.5 |
| NL2Repo-Bench | 48.1 | 42.3 | 41.1 | 54.2 | 47.6 |
| LiveCodeBench v6 | 91.9 | 90.3 | 89.6 | 90.6 | 88.8 |
Agent and general:
| Benchmark | Flash-Next | 3.8-27B | 3.7-Plus | DeepSeek-V4-Flash | Opus 4.6 |
|---|---|---|---|---|---|
| CoWorkBench (long-horizon office work) | 73.9 | 70.7 | 65.1 | 45.1 | 68.2 |
| JobBench (professional tasks) | 55.7 | 33.4 | 27.6 | 41.3 | 36.6 |
| Toolathlon Verified (tool use) | 73.5 | 67.1 | 50.6 | 70.3 | – |
| IFBench (instruction following) | 81.3 | 79.5 | 79.1 | 79.2 | 62.5 |
| GPQA Diamond | 91.7 | 89.2 | 90.3 | 90.8 | 91.3 |
| HLE | 35.9 | 30.8 | 34.7 | 33.8 | 40.0 |
On the vision side it posts 84.5 on AndroidWorld, 76.6 on LVBench (long video), 88.5 on RealWorldQA and 90.6 on MathVision (95.7 with a code interpreter). Computer use is the weak spot everyone shares: OSWorld 2.0 gives 52.3 partial credit but only 19.4 fully completed tasks.
Every number here was produced by Alibaba, and vendors pick benchmarks they look good on. The difference in this case: the weights are public, so these scores can be reproduced independently instead of taken on faith.
Also note that benchmarks like SWE-bench Pro were run through the Claude Code harness. The score belongs to the model plus that scaffold, not the model alone.
The base model
Before post-training the picture is similar: Flash-Next-Base leads on 8 of 14 benchmarks, including MMLU-Pro (73.23), SuperGPQA (51.36), BBH (90.87), EvalPlus (78.76) and SWEBench-Pretrain (50.99), and stays close to the 397B Qwen3.7-Plus-Base on the rest. Not bad for 6B active parameters.
Pricing 💸
The production version is served on QwenCloud as qwen3.8-flash, with 1M context by default and official built-in tools.
| Item | Per 1M tokens |
|---|---|
| Input | $0.16 |
| Output | $0.47 |
For context, the flagship Qwen3.8-Max charges $2 and $6. That makes Flash-Next roughly 12x cheaper on input and 13x on output, which is the entire point for high-volume tool-calling agents that run for hours.
Our LLM cost calculator puts those numbers next to Claude and GPT pricing for your own workload.
Using It
The API speaks both OpenAI and Anthropic protocols. Grab a key from QwenCloud:
from openai import OpenAI
import os
client = OpenAI(
api_key=os.environ.get("DASHSCOPE_API_KEY"),
base_url="https://dashscope-intl.aliyuncs.com/compatible-mode/v1",
)
completion = client.chat.completions.create(
model="qwen3.8-flash",
messages=[{"role": "user", "content": "Write a Python function to merge two sorted linked lists."}],
extra_body={"enable_thinking": True},
reasoning_effort="xhigh", # xhigh, medium or low
stream=True,
)
Endpoints are available in Beijing, Singapore (dashscope-intl) and US Virginia.
With Claude Code: since the Qwen API supports the Anthropic protocol, three environment variables are all it takes:
export ANTHROPIC_MODEL="qwen3.8-flash"
export ANTHROPIC_SMALL_FAST_MODEL="qwen3.8-flash"
export ANTHROPIC_BASE_URL=https://dashscope-intl.aliyuncs.com/apps/anthropic
export ANTHROPIC_AUTH_TOKEN=<your_api_key>
claude
Codex (via the OpenAI Responses protocol), Qoder CLI, Qwen Code and OpenClaw are supported too. Alibaba also runs the new “Standard” mode of its QwenWork productivity platform on this model.
Self-hosting
Weights are on Hugging Face and ModelScope. With vLLM:
vllm serve Qwen/Qwen3.8-Flash-Next \
--tensor-parallel-size 4 \
--max-model-len 262144 \
--enable-auto-tool-choice --tool-call-parser qwen3_coder
SGLang and TokenSpeed take the same flags. For a quick local run, transformers serve exposes an OpenAI-compatible endpoint, and llama.cpp and Unsloth are listed as local options.
Sampling: thinking mode wants temperature=1.0, top_p=0.95, top_k=20; instruct mode temperature=0.7, top_p=0.80, top_k=20, presence_penalty=1.5.
Do not let the 6B active count fool you: all of the weights still have to be loaded. The 125B backbone at 4-bit quantization is roughly 65-70 GB, before the 51B n-gram table and the KV cache.
The good news is that the n-gram table does not need to be in VRAM, so it can sit in system RAM. Even so, this is not a single 24 GB card model. If local single-GPU inference is your goal, the Apache 2.0 licensed Qwen3.8-27B is the one to grab.
License
The license is not Apache 2.0, it is qwen-community-1.0. If you are used to the Apache 2.0 freedom of the smaller Qwen models, read the terms before shipping this one in a product.
Who Should Care
- High-volume tool-calling agents: cheap tokens plus long-context throughput is this model’s whole reason to exist, and the Toolathlon and CoWorkBench scores back it up.
- Long-context coding assistants: 1M tokens of context, 81.0 on SWE-bench Multilingual, and cents per million tokens.
- Researchers watching architecture: you can study what Qwen4 will be built on right now. That is exactly why it shipped.
- Anyone wanting single-GPU local inference: not this one. Look at Qwen3.8-27B instead.
Frequently Asked Questions
Q: When was Qwen3.8-Flash-Next released? A: August 2026. The weights went up on Hugging Face and ModelScope on 24 August 2026.
Q: How many parameters does it have? A: 125B total with 6B active per token, plus a separate 51B n-gram embedding table and a 4B MTP module. The n-gram table is looked up rather than multiplied, so it does not add per-token compute.
Q: When is Qwen4 coming? A: Alibaba gave no date. What it did say is that Qwen3.8-Flash-Next is an early release of the architecture the Qwen4 family will be built on, published so the community can evaluate it first.
Q: Is it open source? Can I download it? A: The weights are downloadable, but the license is qwen-community-1.0, not Apache 2.0. The accurate term is open-weight: model files were released, training data was not.
Q: What does it cost? A: On QwenCloud it is $0.16 per million input tokens and $0.47 per million output tokens under the name qwen3.8-flash. Self-hosting has no API fee, just hardware.
Q: How long is the context window? A: 262,144 tokens natively, extensible to about 1M with RoPE scaling methods such as YaRN. The hosted production version already defaults to 1M.
Q: How much VRAM do I need? A: Roughly 65-70 GB for the 125B backbone at 4-bit, plus KV cache. The 51B n-gram table can be offloaded to system RAM. This is not a comfortable single consumer GPU model.
Q: Does it work with Ollama or llama.cpp? A: The repo lists llama.cpp and Unsloth as local options, with ready-made commands for SGLang, vLLM and TokenSpeed on the server side. It is a new architecture, so stay on current tool versions.
Q: Flash-Next or Qwen3.8-27B? A: For local single-GPU use, the dense Apache 2.0 27B. For cheap API tokens, 1M context and long-horizon agent work, Flash-Next, which also leads on most published benchmarks.
Q: Can I use it with Claude Code? A: Yes. Point ANTHROPIC_BASE_URL at https://dashscope-intl.aliyuncs.com/apps/anthropic and set ANTHROPIC_MODEL=qwen3.8-flash. Codex, Qoder CLI, Qwen Code and OpenClaw work as well.
Stay well… 🙂
