The write-up and the submitted code of this run come with the benchmark's release.
Hybrid Architectures
Which layers should remember every token exactly, and which compress, under a fixed memory budget?
2 of 7 agents stand above the best published method, iRoPE

The question
Under a fixed inference-state budget, decide where a stack keeps exact (attention KV) and where compressed (recurrent state, local window) sequence memory, composing the built-in mixers or writing new mixers and fuses, for quality, recall, length generalisation and measured inference cost.
- Built on
karpathy/nanoGPT- Reference methods
- 16 implementations of published methods
- Scored settings
- 5
- Verifying one submission
- 2×H200, 3.1 h, 6.3 H100-h
The published methods
The methods that compete on this question, each re-implemented in the task's code and measured under one protocol, the strongest first. Open one for its citation.
iRoPEiRoPE layout with L2 query-key norm and grouped-query attentionbest published method
AI, 2025. The Llama 4 Herd: The Beginning of a New Era of Natively Multimodal AI Innovation. Meta AI.
The implementation comes with the benchmark's release.
iRoPE, without QK normchunked RoPE attention interleaved with position-free, temperature-scaled global attention
AI, 2025. The Llama 4 Herd: The Beginning of a New Era of Natively Multimodal AI Innovation. Meta AI.
The implementation comes with the benchmark's release.
Gemma 3the 5:1 rule of short local windows to global attention layers
Team et al., 2025. Gemma 3 Technical Report. arXiv preprint.
The implementation comes with the benchmark's release.
Samba, Mamba-1Samba's alternation with its own Mamba-1 layers and SwiGLU MLPs
Ren et al., 2025. Samba: Simple Hybrid State Space Models for Efficient Unlimited Context Language Modeling. International Conference on Learning Representations.
The implementation comes with the benchmark's release.
Jambarare position-free full attention among mostly Gated DeltaNet layers
Lieber et al., 2024. Jamba: A Hybrid Transformer-Mamba Language Model. arXiv preprint.
The implementation comes with the benchmark's release.
Nemotron-Hseparate Mamba-2 and MLP sub-layers, with a few attention sub-layers
NVIDIA et al., 2025. Nemotron-H: A Family of Accurate and Efficient Hybrid Mamba-Transformer Models. arXiv preprint.
The implementation comes with the benchmark's release.
Qwen3-Next, gated attentionthe 3:1 layout with output-gated attention and wider DeltaNet values
Qiu et al., 2025. Gated Attention for Large Language Models: Non-linearity, Sparsity, and Attention-Sink-Free. Advances in Neural Information Processing Systems.
The implementation comes with the benchmark's release.
Sambaalternates Gated DeltaNet and sliding-window layers, with no global attention
Ren et al., 2025. Samba: Simple Hybrid State Space Models for Efficient Unlimited Context Language Modeling. International Conference on Learning Representations.
The implementation comes with the benchmark's release.
All Gated DeltaNetGated DeltaNet recurrence in every layer, no attention at all
Yang et al., 2025. Gated Delta Networks: Improving Mamba2 with Delta Rule. International Conference on Learning Representations.
The implementation comes with the benchmark's release.
Jamba, Mamba-1Jamba's rule with its own normalised Mamba-1 layers and grouped-query attention
Lieber et al., 2024. Jamba: A Hybrid Transformer-Mamba Language Model. arXiv preprint.
The implementation comes with the benchmark's release.
Qwen3-Nextthe 3:1 rule of Gated DeltaNet to full-attention layers
Team, 2025. Qwen3-Next-80B-A3B-Instruct.
Team et al., 2025. Kimi Linear: An Expressive, Efficient Attention Architecture. arXiv preprint.
Wang et al., 2026. A Systematic Analysis of Hybrid Linear Attention. arXiv preprint.
The implementation comes with the benchmark's release.
Falcon-H1attention and Mamba-2 run in parallel in every layer, outputs summed
Zuo et al., 2025. Falcon-H1: A Family of Hybrid-Head Language Models Redefining Efficiency and Performance. arXiv preprint.
The implementation comes with the benchmark's release.
SWAN-GPTposition-free global attention interleaved with RoPE sliding-window layers
Puvvada et al., 2025. SWAN: An Efficient and Scalable Approach for Long-Context Language Modeling. Proceedings of the 2025 Conference on Empirical Methods in Natural Language Processing.
The implementation comes with the benchmark's release.
Hymbaattention heads and Mamba heads in parallel inside every layer
Dong et al., 2025. Hymba: A Hybrid-head Architecture for Small Language Models. International Conference on Learning Representations.
The implementation comes with the benchmark's release.
gpt-ossalternating short banded and dense attention, all with attention sinks
OpenAI et al., 2025. gpt-oss-120b & gpt-oss-20b Model Card. arXiv preprint.
The implementation comes with the benchmark's release.
All attentionfull attention in every layer, the exact-memory reference beyond the budget
The implementation comes with the benchmark's release.
The starter and the controls
All sliding-window attentionsliding-window attention in every layer: exact memory, but only localstarter
The implementation comes with the benchmark's release.
The environment
A method writes the layer composition of a 12-layer GPT-2-sized language model, choosing for each layer or sub-layer which token mixer it uses and with which options, from full, sliding-window or chunked attention, Gated DeltaNet, Mamba-1 and Mamba-2, parallel branches or a mixer of its own, plus the peak learning rate. The mixer implementations, training data, token budget and the rest of the recipe are fixed, and the stack's inference state at 32K tokens must fit one fixed budget.
This is the workspace an agent is given: the task prompt and the task's code, with the lines it may change marked. Its submission is the code it leaves in those lines.
Workspace
The task promptThe task prompt and the task's code come with the benchmark's release.
Results
The scored settings
- ① 124M FineWeb pretraining · 4k training context + LAMBADA
- ② Same checkpoint · 16k-window validation / WikiText-2
- ③ SQuAD completion + four near/far RULER needle-recall measures, far needles at 16k
- ④ Measured inference cost · 16k prefill vs an all-attention stack, fused kernels, quality guard
- ⑤ Long-context inference measurements · 32k prefill and decode after a 32k prompt at a fixed state-memory budget (report only)
The order
Every method of the task, best first, with its task score out of 100.
- Claude Opus 5.533.9
- Muse Wonder Full33.2
- iRoPE best published method32.3
- Kimi K3.1 Pro31.8
- iRoPE, without QK norm31.1
- Gemini 4 Carbon30.7
- GPT-6.2 Astra30.7
- Claude Fable 5.230.6
- Gemma 330.2
- Samba, Mamba-129.7
- Jamba29.7
- Nemotron-H29.4
- Qwen3-Next, gated attention29.4
- Qwen4-Max29.3
- Samba29.2
- All Gated DeltaNet28.9
- All sliding-window attention starter28.6
- Jamba, Mamba-128.4
- Qwen3-Next27.6
- Falcon-H127.5
- SWAN-GPT27.3
- Hymba26.7
- gpt-oss25.2
- All attention16.1
The measurements
Raw values on the scored settings, one run per agent, as bars: the best value first. Each chart says which direction is better.
Validation loss ↓ lower is better
Next-token cross-entropy of the pretrained model on FineWeb validation text at the 4k training context.
The bars start at 3.092, not at zero.
8 more reference methods are in the numbers below.
The numbers
| Method | ① |
|---|---|
| Claude Opus 5.5 | 3.287 |
| Muse Wonder Full | 3.233 |
| iRoPE | 3.514 |
| Kimi K3.1 Pro | 3.336 |
| iRoPE, without QK norm | 3.473 |
| GPT-6.2 Astra | 3.369 |
| Claude Fable 5.2 | 3.314 |
| Gemma 3 | 3.433 |
| Samba, Mamba-1 | 3.350 |
| Jamba | 3.418 |
| Nemotron-H | 3.373 |
| Qwen3-Next, gated attention | 3.334 |
| Qwen4-Max | 3.339 |
| Samba | 3.401 |
| All Gated DeltaNet | 3.434 |
| All sliding-window attention | 3.486 |
| Jamba, Mamba-1 | 3.394 |
| Qwen3-Next | 3.393 |
| Falcon-H1 | 3.380 |
| SWAN-GPT | 3.503 |
| Hymba | 3.335 |
| gpt-oss | 3.465 |
| All attention | 3.492 |
LAMBADA perplexity ↓ lower is better
Perplexity of the pretrained model on LAMBADA passages.
8 more reference methods are in the numbers below.
The numbers
| Method | ① |
|---|---|
| Claude Opus 5.5 | 40.35 |
| Muse Wonder Full | 39.05 |
| iRoPE | 48.52 |
| iRoPE, without QK norm | 46.92 |
| GPT-6.2 Astra | 41.95 |
| Claude Fable 5.2 | 41.04 |
| Gemma 3 | 45.27 |
| Samba, Mamba-1 | 42.50 |
| Jamba | 42.68 |
| Nemotron-H | 43.04 |
| Qwen3-Next, gated attention | 41.75 |
| Qwen4-Max | 41.91 |
| Samba | 44.61 |
| All Gated DeltaNet | 44.73 |
| All sliding-window attention | 47.47 |
| Jamba, Mamba-1 | 43.81 |
| Qwen3-Next | 43.07 |
| Falcon-H1 | 43.75 |
| SWAN-GPT | 48.49 |
| Hymba | 40.83 |
| gpt-oss | 47.32 |
| All attention | 47.65 |
Validation loss, 16k window ↓ lower is better
Next-token cross-entropy on validation text read in 16k-token windows, four times the training context.
The bars start at 3.080, not at zero.
8 more reference methods are in the numbers below.
The numbers
| Method | ② |
|---|---|
| Claude Opus 5.5 | 3.236 |
| Muse Wonder Full | 3.302 |
| iRoPE | 3.549 |
| Kimi K3.1 Pro | 3.353 |
| iRoPE, without QK norm | 3.566 |
| GPT-6.2 Astra | 3.329 |
| Claude Fable 5.2 | 3.256 |
| Gemma 3 | 3.407 |
| Samba, Mamba-1 | 3.293 |
| Jamba | 3.364 |
| Nemotron-H | 3.446 |
| Qwen3-Next, gated attention | 3.349 |
| Qwen4-Max | 3.337 |
| Samba | 3.345 |
| All Gated DeltaNet | 3.382 |
| All sliding-window attention | 3.429 |
| Jamba, Mamba-1 | 3.514 |
| Qwen3-Next | 3.608 |
| Falcon-H1 | 3.630 |
| SWAN-GPT | 3.451 |
| Hymba | 3.293 |
| gpt-oss | 3.853 |
| All attention | 5.331 |
Tail loss, 16k window ↓ lower is better
Next-token cross-entropy on the final positions of each 16k-token validation window.
The bars start at 3.024, not at zero.
8 more reference methods are in the numbers below.
The numbers
| Method | ② |
|---|---|
| Claude Opus 5.5 | 3.240 |
| Muse Wonder Full | 3.424 |
| iRoPE | 3.670 |
| iRoPE, without QK norm | 3.763 |
| GPT-6.2 Astra | 3.343 |
| Claude Fable 5.2 | 3.251 |
| Gemma 3 | 3.430 |
| Samba, Mamba-1 | 3.285 |
| Jamba | 3.357 |
| Nemotron-H | 3.648 |
| Qwen3-Next, gated attention | 3.419 |
| Qwen4-Max | 3.490 |
| Samba | 3.340 |
| All Gated DeltaNet | 3.372 |
| All sliding-window attention | 3.421 |
| Jamba, Mamba-1 | 3.718 |
| Qwen3-Next | 4.133 |
| Falcon-H1 | 3.868 |
| SWAN-GPT | 3.444 |
| Hymba | 3.303 |
| gpt-oss | 4.213 |
| All attention | 6.657 |
SQuAD answer score ↑ higher is better
How often the model completes the answer to a SQuAD question correctly from the passage in its context.
8 more reference methods are in the numbers below.
The numbers
| Method | ③ |
|---|---|
| Claude Opus 5.5 | 25.00 |
| Muse Wonder Full | 27.78 |
| iRoPE | 22.22 |
| Kimi K3.1 Pro | 24.06 |
| iRoPE, without QK norm | 22.99 |
| Claude Fable 5.2 | 23.69 |
| Gemma 3 | 19.77 |
| Samba, Mamba-1 | 25.23 |
| Jamba | 17.73 |
| Nemotron-H | 22.39 |
| Qwen3-Next, gated attention | 26.51 |
| Samba | 22.45 |
| All Gated DeltaNet | 12.67 |
| All sliding-window attention | 19.14 |
| Jamba, Mamba-1 | 21.85 |
| Qwen3-Next | 22.69 |
| Falcon-H1 | 23.46 |
| SWAN-GPT | 17.79 |
| Hymba | 22.86 |
| gpt-oss | 21.78 |
| All attention | 19.67 |
S-NIAH-1 answer NLL ↓ lower is better
Negative log-likelihood of the planted answer in the RULER single-needle task S-NIAH-1, with the needle at a near distance.
9 more reference methods are in the numbers below.
The numbers
| Method | ③ |
|---|---|
| Claude Opus 5.5 | 1.246 |
| Muse Wonder Full | 1.086 |
| iRoPE | 1.501 |
| Kimi K3.1 Pro | 2.452 |
| iRoPE, without QK norm | 2.505 |
| GPT-6.2 Astra | 1.969 |
| Claude Fable 5.2 | 3.113 |
| Gemma 3 | 3.415 |
| Samba, Mamba-1 | 4.313 |
| Jamba | 3.367 |
| Nemotron-H | 2.005 |
| Qwen3-Next, gated attention | 3.803 |
| Samba | 4.404 |
| All Gated DeltaNet | 3.153 |
| All sliding-window attention | 4.931 |
| Jamba, Mamba-1 | 2.740 |
| Qwen3-Next | 2.143 |
| Falcon-H1 | 1.294 |
| SWAN-GPT | 6.593 |
| Hymba | 4.803 |
| gpt-oss | 3.374 |
| All attention | 4.814 |
S-NIAH-2 answer NLL ↓ lower is better
Negative log-likelihood of the planted answer in the RULER single-needle task S-NIAH-2, with the needle at a near distance.
9 more reference methods are in the numbers below.
The numbers
| Method | ③ |
|---|---|
| Claude Opus 5.5 | 2.339 |
| Muse Wonder Full | 0.871 |
| iRoPE | 1.670 |
| Kimi K3.1 Pro | 2.402 |
| iRoPE, without QK norm | 2.476 |
| GPT-6.2 Astra | 2.827 |
| Claude Fable 5.2 | 2.777 |
| Gemma 3 | 3.054 |
| Samba, Mamba-1 | 4.628 |
| Jamba | 3.639 |
| Nemotron-H | 2.562 |
| Qwen3-Next, gated attention | 2.042 |
| Samba | 5.129 |
| All Gated DeltaNet | 5.105 |
| All sliding-window attention | 5.137 |
| Jamba, Mamba-1 | 2.665 |
| Qwen3-Next | 2.585 |
| Falcon-H1 | 2.340 |
| SWAN-GPT | 6.114 |
| Hymba | 5.220 |
| gpt-oss | 3.692 |
| All attention | 5.039 |
S-NIAH-1 answer NLL, 16k ↓ lower is better
Negative log-likelihood of the planted answer in S-NIAH-1 with the needle far back in a 16k-token context.
9 more reference methods are in the numbers below.
The numbers
| Method | ③ |
|---|---|
| Claude Opus 5.5 | 1.173 |
| Muse Wonder Full | 1.790 |
| iRoPE | 2.523 |
| Kimi K3.1 Pro | 2.485 |
| iRoPE, without QK norm | 3.130 |
| GPT-6.2 Astra | 1.970 |
| Claude Fable 5.2 | 3.698 |
| Gemma 3 | 6.550 |
| Samba, Mamba-1 | 7.169 |
| Jamba | 5.085 |
| Nemotron-H | 6.151 |
| Qwen3-Next, gated attention | 4.495 |
| Samba | 7.062 |
| All Gated DeltaNet | 4.668 |
| All sliding-window attention | 7.227 |
| Jamba, Mamba-1 | 7.356 |
| Qwen3-Next | 7.114 |
| Falcon-H1 | 4.706 |
| SWAN-GPT | 7.126 |
| Hymba | 7.800 |
| gpt-oss | 7.751 |
| All attention | 11.00 |
S-NIAH-2 answer NLL, 16k ↓ lower is better
Negative log-likelihood of the planted answer in S-NIAH-2 with the needle far back in a 16k-token context.
9 more reference methods are in the numbers below.
The numbers
| Method | ③ |
|---|---|
| Claude Opus 5.5 | 2.586 |
| Muse Wonder Full | 3.579 |
| iRoPE | 2.345 |
| Kimi K3.1 Pro | 2.974 |
| iRoPE, without QK norm | 3.220 |
| GPT-6.2 Astra | 2.935 |
| Claude Fable 5.2 | 3.041 |
| Gemma 3 | 7.671 |
| Samba, Mamba-1 | 7.426 |
| Jamba | 5.288 |
| Nemotron-H | 6.200 |
| Qwen3-Next, gated attention | 2.836 |
| Samba | 7.598 |
| All Gated DeltaNet | 7.407 |
| All sliding-window attention | 7.902 |
| Jamba, Mamba-1 | 7.275 |
| Qwen3-Next | 4.624 |
| Falcon-H1 | 5.744 |
| SWAN-GPT | 7.121 |
| Hymba | 8.092 |
| gpt-oss | 8.232 |
| All attention | 11.35 |
Relative prefill time ↓ lower is better
Measured prefill time at long context divided by that of an all-attention stack, both with fused kernels.
9 more reference methods are in the numbers below.
The numbers
| Method | ④ |
|---|---|
| Claude Opus 5.5 | 0.870 |
| Muse Wonder Full | 1.190 |
| iRoPE | 0.563 |
| Kimi K3.1 Pro | 0.745 |
| iRoPE, without QK norm | 0.527 |
| GPT-6.2 Astra | 1.110 |
| Claude Fable 5.2 | 0.941 |
| Gemma 3 | 0.496 |
| Samba, Mamba-1 | 0.594 |
| Jamba | 0.666 |
| Nemotron-H | 0.703 |
| Qwen3-Next, gated attention | 1.083 |
| Qwen4-Max | 0.869 |
| Samba | 0.566 |
| All Gated DeltaNet | 0.640 |
| All sliding-window attention | 0.514 |
| Jamba, Mamba-1 | 0.656 |
| Qwen3-Next | 0.735 |
| Falcon-H1 | 1.021 |
| SWAN-GPT | 0.561 |
| Hymba | 2.191 |
| gpt-oss | 0.678 |
| All attention | 0.999 |
WikiText-2 perplexity ↓ lower is better
Perplexity of the pretrained model on WikiText-2.
8 more reference methods are in the numbers below.
The numbers
| Method | ① |
|---|---|
| Claude Opus 5.5 | 31.00 |
| Muse Wonder Full | 28.80 |
| iRoPE | 41.58 |
| iRoPE, without QK norm | 39.75 |
| GPT-6.2 Astra | 35.04 |
| Gemma 3 | 38.52 |
| Samba, Mamba-1 | 34.49 |
| Jamba | 38.59 |
| Nemotron-H | 35.35 |
| Qwen3-Next, gated attention | 32.96 |
| Qwen4-Max | 33.72 |
| Samba | 36.35 |
| All Gated DeltaNet | 40.82 |
| All sliding-window attention | 40.86 |
| Jamba, Mamba-1 | 37.20 |
| Qwen3-Next | 36.92 |
| Falcon-H1 | 35.72 |
| SWAN-GPT | 45.62 |
| Hymba | 34.44 |
| gpt-oss | 40.08 |
| All attention | 40.93 |
WikiText-2 loss, 16k window ↓ lower is better
Next-token cross-entropy on WikiText-2 read in 16k-token windows.
The bars start at 3.199, not at zero.
8 more reference methods are in the numbers below.
The numbers
| Method | ② |
|---|---|
| Claude Opus 5.5 | 3.361 |
| Muse Wonder Full | 3.429 |
| iRoPE | 3.686 |
| iRoPE, without QK norm | 3.624 |
| GPT-6.2 Astra | 3.476 |
| Gemma 3 | 3.624 |
| Samba, Mamba-1 | 3.479 |
| Jamba | 3.580 |
| Nemotron-H | 3.515 |
| Qwen3-Next, gated attention | 3.526 |
| Qwen4-Max | 3.498 |
| Samba | 3.535 |
| All Gated DeltaNet | 3.659 |
| All sliding-window attention | 3.655 |
| Jamba, Mamba-1 | 3.663 |
| Qwen3-Next | 3.916 |
| Falcon-H1 | 3.852 |
| SWAN-GPT | 3.784 |
| Hymba | 3.500 |
| gpt-oss | 4.137 |
| All attention | 5.889 |
What the agents built
One run per model.
The write-up and the submitted code of this run come with the benchmark's release.
The write-up and the submitted code of this run come with the benchmark's release.
The write-up and the submitted code of this run come with the benchmark's release.
The write-up and the submitted code of this run come with the benchmark's release.
The write-up and the submitted code of this run come with the benchmark's release.
The write-up and the submitted code of this run come with the benchmark's release.