Dense transformer
- Attention
- Full attention in every layer
- FFN
- One dense feed-forward network
GPT-2, Llama 2
KV cache and FLOPs grow with context.
Work through the math inside a transformer, then compare current models and find benchmarks that match your task.
What can “lantern” learn before it sees “glows”?
Step 1 of 4Every column keeps the same token from projection to output.
Each hidden vector is projected by three learned matrices. For token 2, multiply [1, 2] by the query matrix’s columns [1, 0] and [−1, 1] to get query [1, 1]. The three keys are [1, 0], [1, 1], and [2, 1]. Their values are [2, 0], [0, 2], and [2, 2].
Take the dot product of the query with each key: 1, 2, and 3. Divide all three by the square root of the key dimension, 2, to get about 0.71, 1.41, and 2.12. These are pre-softmax logits.
Token 3 is in the future for query 2. Set its logit to negative infinity before softmax, so it gets weight zero even though its raw score was highest. Exponentiate the remaining logits and divide each by their sum: the weights are about 0.33 and 0.67.
Multiply the value vectors by their weights and add: 0.33 × [2, 0] + 0.67 × [0, 2] + 0 × [2, 2] gives about [0.66, 1.34]. That is this head’s output for token 2. The model combines the outputs of all heads through a learned output projection.
Change the mask, route a token, grow the context, or give a block another pass.
| Q ↓ / K → | The | cat | sat | on | the | mat |
|---|---|---|---|---|---|---|
| Visible | Masked | Masked | Masked | Masked | Masked | |
| Visible | Visible | Masked | Masked | Masked | Masked | |
| Visible | Visible | Visible | Masked | Masked | Masked | |
| Visible | Visible | Visible | Visible | Masked | Masked | |
| Visible | Visible | Visible | Visible | Visible | Masked | |
| Visible | Visible | Visible | Visible | Visible | Visible |
Choose an attention mask, then select a query on the left side of the grid.
4 of 6 keys visible“on” can see “The”, “cat”, “sat”, “on”.
GPT-2, Llama 2
KV cache and FLOPs grow with context.
DeepSeek-V3, gpt-oss
Attention is still quadratic; all-to-all becomes the new cost.
Kimi K3, DeepSeek V4, Qwen3.5, Nemotron 3
Lossy memory, routing complexity, immature kernels.
Select a component to follow its inputs and outputs.
The input sequence, including any masked positions. Position information is added with the token and segment embeddings before the stack.
Practice this componentBERT-style stack. Every position can see every other position, so the block builds a representation of the whole input rather than predicting one next token.
Open the architecture labCompare the layer mix, active parameters, context, and recurrent depth across 14 models.
Each mark is one layer, grouped by type.
Z.ai’s vision-capable flagship revisits the same 28-layer block before producing logits.
A separate learned gate on each pass controls how much of the candidate update is written back for each token. Z.ai reports a more conservative first pass and a larger update on the second.
The second pass reuses the first pass’s sparse attention indices and selected keys and values. It also keeps a local window of its own fresh KV. A position can contribute through both streams.
The same middle weights refine a hidden state twice. That gives 56 executions inside the shared portion, with only 28 distinct layers there. The second pass still runs the block even when it reuses the sparse shortlist.
Note. Z.ai describes the 750B-scale backbone and the 28 shared layers. The complete layer recipe and active parameter count are undisclosed in the release. The published 30B ablation is a separate checkpoint.
| Model | Maker & Family | Parameters (Active) | Context | Architecture summary |
|---|---|---|---|---|
| GLM-5.4 | Z.ai · Looped transformers | ~750B backbone · active Undisclosed | 1M | Z.ai’s vision-capable flagship revisits the same 28-layer block before producing logits. |
| Kimi K3 | Moonshot AI · Frontier MoE | 2.8T · active 104B | 1M | A 2.8T-parameter MoE where three of every four attention layers are linear. Full attention survives only in 24 gated-MLA layers, and RoPE is gone entirely. |
| Kimi K3.1 Pro | Moonshot AI · Frontier MoE | 2.8T · active 104B | 1M | The K3 skeleton with one architectural change: the 24 full-attention layers become Gated DSA, where a small indexer keeps only the top 2,048 tokens for exact attention. |
| DeepSeek V4 Pro | DeepSeek · Frontier MoE | 1.6T · active 49B | 1M | A 1.6T MoE that treats long context as a compression problem: two attention variants, a wider residual path, and the Muon optimizer. |
| GLM-5.3 | Z.ai · Frontier MoE | 744B · active 40B | 1M | The same base model as GLM-5.2, with every gain coming from post-training. Its architectural interest is DSA plus IndexShare, which reuses one indexer across four sparse layers. |
| Qwen3.5-122B-A10B | Alibaba Qwen · Hybrid linear | 122B · active 10B | 262K native · 1.01M extended | A 3:1 hybrid: three Gated DeltaNet layers for every gated-attention layer, with a 256-expert MoE on every block. |
| Nemotron 3 Ultra | NVIDIA · Hybrid linear | 550B · active 55B | 1M advertised · 262K in config | Not a transformer with a few linear layers: 48 Mamba-2 blocks and 12 attention blocks, every one followed by a 512-expert LatentMoE. |
| Kimi Linear 48B-A3B | Moonshot AI · Hybrid linear | 48B · active 3B | 1M | The first 3:1 KDA/full-MLA stack, and the clearest place to see the recipe before it scaled to K3. |
| gpt-oss-120b | OpenAI · Efficient open | 117B · active 5.1B | 131K | The readable baseline for the 2026 stack: alternating sliding-window and full attention, attention sinks, and a 128-expert MoE. |
| DeepSeek V4.1 Flash 1017 | DeepSeek · Frontier MoE | 552B backbone · active 8B in / 16B out | 1M | A vision-capable MoE using a causal encoder-decoder with different active compute on input and output. |
| Qwen4-Max | Alibaba · Other frontier | 2.4T · active Undisclosed | 1M | A hosted flagship with native vision, designed for long-running tasks that use tools and produce deliverables. |
| ARLoop-1.2B | OSU NLP · Looped transformers | 1.2B · active Dense | 4,096 | A fully open base model that shares its entire transformer stack across three passes and attends to recent residual blocks along depth. |
| Ouro-1.4B | ByteDance · Looped transformers | 1.4B · active Dense | 4K / 64K extended | A small research checkpoint with a shared decoder stack and four passes by default. |
| Huginn-3.5B | University of Maryland · Looped transformers | 3.5B · active Dense | 4,096 | An open recurrent-depth research model with a four-layer core between two input and two output layers. |
Compare published runs within each benchmark and check the evaluation setup before choosing.
Where to start Among the atlas models tested by ModelDial, Kimi K3.1 Pro and Qwen4-Max lead on frontend work. GLM-5.4 is worth testing on backend work, where its score is closer to Kimi’s. The private suite is one signal for model selection.
ModelDial Coding v3 subscore · Higher is better
Follow the data flow, then open the implementation details.
A fixed-size memory that can overwrite, not just accumulate.
Think of a notebook with a fixed number of lines. Plain linear attention keeps adding sticky notes. The delta rule erases the part of the line that is already wrong before writing the correction.
Full attention stores a key and value for every token, so the cache grows with context and every new token pays for all previous ones. Linear attention replaces that cache with a fixed-size state, but a plain additive state cannot forget a stale association: write the same key twice and the state holds both values.
Use the delta rule. Before writing a new key-value pair, read what the state already predicts for that key and write only the error. Add a per-channel decay so each feature dimension can forget at its own rate.
For each step: decay the state S by a diagonal gate, read the prediction kᵀS, compute the error v − prediction, write S ← S + β k errorᵀ, then read the output qᵀS. KDA refines Gated DeltaNet with a finer-grained diagonal gate, a short convolution and a chunked kernel. The lab implements the single-head recurrence without the kernel.
The state is a compressed associative memory. The delta rule is gradient descent on the stored association: it removes the component the state already explains, so a repeated key replaces rather than superposes. Per-channel decay lets the model keep some features for a long time and forget others quickly.
Original model entries checked November 23, 2026. New entries and benchmark snapshot checked December 2, 2026.