---
title: "What Is Qwen Sparse Attention? How Qwen4-Max Reads 1M Tokens"
url: "https://goremy.ai/blog/articles/qwen4-max-sparse-attention-architecture-explained"
author: Luis Chavez-Mattos
editor: Luis Chavez-Mattos
editor_title: Director, Product
published: "2026-11-22T23:40:22.614Z"
updated: "2026-11-22T23:40:22.614Z"
topic: AI Models & Industry
description: Qwen4-Max has 2.4T parameters but uses about 71B per token. Here is how Qwen Sparse Attention, Gated DeltaNet and gated residuals work, in plain language.
---

# What Is Qwen Sparse Attention? How Qwen4-Max Reads 1M Tokens

> Qwen4-Max has 2.4T parameters but uses about 71B per token. Here is how Qwen Sparse Attention, Gated DeltaNet and gated residuals work, in plain language.

Edited by Luis Chavez-Mattos, Director, Product · Published 2026-11-22

## What is Qwen Sparse Attention (QSA)?

Qwen Sparse Attention, or QSA, is the attention method Qwen4-Max uses so it does not have to compare every word in a long document with every other word. A lightweight indexer scans the earlier text, scores small chunks (Qwen calls them micro blocks) by how relevant they are to the current token, and keeps only the best ones. The model then runs its full attention on just those chunks. It works like using the index at the back of a book instead of rereading every page.

## TL;DR

- Qwen4-Max has **2.4 trillion parameters in total, but only about 71 billion are active** for any given token, roughly 3%.
- Its context window is **1 million tokens**, which is only practical because the model avoids checking every token against every other token.
- The attention pattern repeats **three Gated DeltaNet (GDN) layers, then one QSA layer**. GDN keeps a compact running summary, and QSA looks things up when the summary is not enough.
- Instead of one shared lane of information running through the model, it uses **four parallel lanes with read and write gates**, which Qwen says improves information flow and training stability.
- An **N-gram embedding** treats common phrases like "New York" as a unit and adds 328 billion parameters of capacity with little extra computation.
- Qwen has **not disclosed several details**, including the number of experts, the micro block size, how scoring works, and how many blocks QSA picks.

## Why is long text so expensive for AI models?

Start with attention. A language model reads text as tokens, which are small pieces of words. To understand each new token, the model uses attention: the token looks back at every token that came before it. That is powerful, but the cost climbs fast.

With six tokens, there are 15 links between pairs. Double the text and the number of links grows roughly four times. Double it again and it happens again. At a million tokens, the count reaches about half a trillion links.

That is the problem QSA targets. A 1M-token window is roughly a pile of long reports, a large codebase, or a few books. If every token has to check every other token, that gets very costly. The rest of the architecture is a set of tricks to make that affordable.

## How does a mixture of experts get 2.4 trillion parameters down to 71 billion?

A parameter is one of the adjustable numbers inside a model. More parameters usually means more capacity to store knowledge and skill. The catch is that a model which uses all its parameters on every token is slow and costly to run.

A mixture of experts (MoE) design gets around this. Instead of one giant block that fires completely for every token, the model holds a large number of specialists called experts. A small router picks just a few of them for each token. The rest sit idle for that token.

That is how Qwen4-Max can hold 2.4 trillion parameters in total yet use only about 71 billion for each token. Think of a big hospital: it employs thousands of specialists, but your visit involves only the few relevant to your problem.

Qwen has not said how many experts there are. Diagrams of MoE designs often show a small number (16, for instance), but that is only an illustration. The idea holds regardless of the exact count.

## How does the 3:1 attention pattern work?

Qwen4-Max does not use the same kind of attention in every layer. It repeats a pattern: three Gated DeltaNet layers, then one QSA layer. Every one of those layers also has its own mixture of experts.

A simple way to picture it: three layers keep a compact summary, then one layer looks things up directly. This repeats up the whole model.

### What does Gated DeltaNet (GDN) do?

Qwen says GDN layers compress history into fixed-size states. Picture a notebook with a fixed number of cells. Every new token updates the notebook, but the notebook never gets bigger, no matter how long the text runs.

That is the main appeal. Full attention keeps every token around, so its memory keeps growing with the text. A fixed-size summary stays cheap. The downside is built in: a small notebook cannot hold everything. Details can get squeezed out.

### What does QSA add on top?

QSA covers the notebook's weakness. Full attention checks every earlier token. QSA works in two steps:

1. A lightweight indexer quickly scans the history and scores which micro blocks matter for the current token.
2. The model keeps only the most relevant blocks and runs real attention on just those.

Qwen says this cuts both the attention cost and the indexing cost on long sequences. So the model gets cheap summaries most of the time, and precise lookups when it needs an exact detail from far back.

| Layer type | What it does | Analogy | Main tradeoff |
|---|---|---|---|
| Gated DeltaNet (GDN) | Compresses history into a fixed-size state | A notebook with a fixed number of cells | Cheap, but cannot hold everything |
| QSA | Scores chunks, then runs full attention on the best ones | The index at the back of a book | More precise, but needs an indexer |
| Full attention (for comparison) | Checks every earlier token | Rereading every page | Memory keeps growing |

## What are gated residual lanes?

In a standard transformer, there is one shared lane running up through the model. Each layer reads from it and adds its output back onto it.

Qwen4-Max uses what is called a gated residual. Instead of one lane, there are four parallel lanes. Each layer uses dynamic gates: a read gate decides what to take from the lanes, and a write gate decides what to put back.

Qwen says this strengthens the flow of information across layers and improves training stability. In plain terms, the model has more room to route information to where it is needed, and the training process is less likely to go off the rails.

## What is an N-gram embedding?

Every model starts by turning tokens into numbers through a lookup, called an embedding. Qwen4 adds an N-gram embedding, which is a context-based lookup for short patterns of neighboring tokens. The example given is "New York" treated as one unit rather than two unrelated words. It is fed in at the second layer.

Think of it as a phrase book for common combinations. According to the walkthrough of Qwen's material, this adds an extra 328 billion parameters of capacity with little additional computation. That is possible because a lookup is cheap compared with running a large block of neural network.

## What did Qwen say about training results?

Qwen's pre-training chart shows the loss (the model's error on its training text) falling steadily with no loss spikes. Those are sudden jumps that can derail a training run. Qwen4-Max also continued training from the earlier preview model, rather than starting over.

On a measure called bits per byte, which tracks how well a model predicts text, the base model scored best among the five checkpoints Qwen compared. It did this while activating about a quarter fewer parameters than the previous Max base model. One caution: some models in that comparison were post-trained, so it is not a like-for-like test. Bits per byte also does not tell you how good the model is at your actual work.

## What has Qwen not disclosed?

Qwen published more than many labs do, but gaps remain:

- The number of experts in the mixture of experts.
- How big the micro blocks are.
- How the indexer scores blocks.
- How many blocks QSA selects for each token.
- Exactly where the multi-token prediction (MTP) modules shown at the top of Qwen's diagram fit in.

None of these change the overall picture. They do matter if you want to reproduce or fine-tune the design, or judge how well it holds up on very long inputs. According to the walkthrough of Qwen's material, Qwen is also going to release the model weights soon, which would let outside researchers check more of this themselves. Treat that as a stated plan, not a done deal.

## What does this mean for you?

You do not need to understand gated lanes to benefit from this. Here is what the design implies in practice.

**If you work with long documents** (contracts, research, policy manuals, meeting archives): a 1M-token window means you may be able to hand a model a very large body of text in one go. But a big window is not the same as reliable recall. The GDN layers compress, and QSA picks a subset. Test with your own material before trusting it.

**If you pay for AI usage or help choose tools:** the 2.4T versus 71B split is the headline cost story. Only a small slice of the model runs per token, so a very large model can be cheaper to serve than its total size suggests. Qwen has not given pricing in the material here, so compare real quotes.

**If you are evaluating vendors:** ask the same questions Qwen leaves open. How does the model perform at 100K tokens versus 900K? What happens when the answer sits in the middle of a huge document?

A practical test you can run on any long-context model:

```
Take a real 200-page document from your work.
Hide three specific facts in different places (early, middle, late).
Ask the model 10 questions, including 3 that need those facts.
Check each answer against the source, not against how confident it sounds.
```

## Can you build a long-document tool without waiting for a bigger context window?

Even with a huge context window, many teams find it more useful to search a document set and show the exact passages behind each answer. If your team keeps asking questions of the same policies, contracts or reports, you could build that as a small internal tool instead of pasting files into a chat each time. [Remy](https://goremy.ai) builds full-stack apps from a plain-English description, and apps it builds include managed document search with cited results, sign-in and roles, and access to nearly 400 AI models. You could describe a "policy question board" where staff upload documents, ask questions, and see sources, then pick the model that works best on your own test set.

## Frequently Asked Questions

### What does "71B active parameters" actually mean?

It means that for each token, the router picks a few experts and only those run, which adds up to about 71 billion parameters out of 2.4 trillion. That is roughly 3% of the model. The rest stay idle for that token but are available for others.

### Is QSA the same as full attention?

No. Full attention checks every earlier token. QSA first uses a lightweight indexer to score small chunks called micro blocks, then runs real attention only on the most relevant ones. It trades some exhaustiveness for much lower cost on long inputs.

### Why does Qwen4-Max use three GDN layers for every QSA layer?

Qwen has not explained the ratio in the material available here. The general logic is that GDN layers are cheap because they keep a fixed-size summary, while QSA layers are more precise lookups. Mixing them keeps most layers cheap while still allowing precise recall.

### Does a 1M-token context window mean the model remembers everything I give it?

Not necessarily. Part of the model compresses history into a fixed-size state, and QSA keeps only selected chunks. That is how it stays affordable, but it also means detail can be lost. Test with your own documents.

### Will the Qwen4-Max weights be public?

Qwen has said it plans to release the weights soon. No date was given in the material here, so check Qwen's own announcements before planning around it.
