Qwen3-Next-80B-A3B-Instruct layer_types Explained
Jump to 3 sections
Qwen3-Next-80B-A3B-Instruct has 48 layers. Every fourth layer uses full attention. The other 36 use linear attention. The model configuration stores the interval, so searching the file for a literal list can miss the answer. Qwen model configuration
Which layer numbers use full attention?
Count layers from one and the full-attention layers are 4, 8, 12, through 48. Count indices from zero and the list is:
3, 7, 11, 15, 19, 23, 27, 31, 35, 39, 43, 47
Transformers adds one to the index before testing divisibility. Applying the interval to the raw index would incorrectly label the first layer as full attention. Transformers Qwen3NextConfig implementation
Inspect a downloaded config
Run this Python snippet beside the checkpoint’s config.json. It uses an explicit layer list when present and derives the list otherwise.
import json
from collections import Counter
from pathlib import Path
config = json.loads(Path("config.json").read_text())
layers = config.get("layer_types")
if layers is None:
interval = config["full_attention_interval"]
layers = [
"full_attention" if (index + 1) % interval == 0 else "linear_attention"
for index in range(config["num_hidden_layers"])
]
print(dict(Counter(layers)))
print([i for i, kind in enumerate(layers) if kind == "full_attention"])
For the official Instruct checkpoint, expect 36 entries labeled linear_attention and 12 labeled full_attention. Use the checkpoint’s own configuration when inspecting a derivative.
Why does the Qwen3-Next config omit layer_types?
Qwen supplies a full_attention_interval of 4. Transformers uses that interval to build the layer_types list when the list is absent.
Every part I would buy today, by budget.
GPUs, Macs, RAM, and full rigs, with current prices.
Open the gear list →