Glossary · The shape of a model

Transformer block

Also: decoder blocklayerdecoder-only transformer

Read it at the depth you need: one sentence · a paragraph · the math · in the models here

1In one sentence

The unit a language model repeats L times: an attention layer, then a feed-forward layer, each wrapped in a norm and a residual connection.

2In a paragraph

Every model on this site is a decoder-only transformer: a stack of identical blocks between an embedding table at the bottom and an output head at the top. Each token enters as a vector of d numbers (the hidden size) and keeps that width all the way up. In every block it first gathers information from earlier tokens (attention), then processes what it gathered on its own (the feed-forward network). "A 32-layer model" means 32 of these blocks.

3The math, shapes and parameters

With pre-norm (what almost every current model uses), one block computes:

h = x + Attention(Norm(x))
out = h + FFN(Norm(h))

The additions are residual connections: each sublayer adds a correction to the running vector rather than replacing it, which is what lets a hundred blocks train. Gemma 2 and 3 add a second norm after each sublayer (four per block); OLMo 2 puts its norms only after.

Nearly all of a model's parameters sit in the blocks: about 4d² (attention, with full heads) + 3d·f (a gated FFN) per block, so the total grows as L × d². The rest is the embedding and output head, V × d each, which only matter for small models.

4In the 96 models on this site

The largest model of each series: how many blocks, how wide, and the share of parameters inside the blocks.

ModelBlocks (L)Width (d)ParametersIn the blocks
SmolLM3 3B362,0483.08B91.5%
Llama 2 7B324,0966.74B96.1%
Granite 3.3 8B404,0968.17B97.5%
Falcon3 10B403,07210.3B92.2%
Gemma 3 27B625,37627B94.8%
Gemma 2 27B464,60827.2B95.7%
Gemma 4 31B605,37630.7B95.4%
OLMo 3 32B645,12032.2B96.8%
OLMo 2 32B645,12032.2B96.8%
Seed-OSS 36B645,12036.2B95.6%
Phi-3.5 MoE324,09641.9B99.4%
DeepSeek-R1-Distill-Llama-70B808,19270.6B97.0%
Qwen2.5 72B808,19272.7B96.6%
Qwen3-Next 80B-A3B482,04879.7B99.2%
gpt-oss-120b362,880117B99.0%
Mixtral 8x22B566,144141B99.7%
MiniMax M2623,072229B99.5%
Qwen3 235B-A22B944,096235B99.5%
GLM-4.5925,120353B99.6%
Qwen3.5 397B-A17B604,096396B99.5%
Llama 4 Maverick (17B-128E)485,120401B99.5%
Llama 3.1 405B12616,384406B99.0%
Nemotron 3 Ultra 550B-A55B1088,192549B99.6%
DeepSeek-V3.2617,168672B99.7%
GLM-5.2786,144743B99.7%
Inkling666,144947B99.7%
Ling-1T808,1921000B99.7%
Kimi K2617,1681.03T99.8%

Introduced in Vaswani et al., “Attention Is All You Need” (2017).

Related

Self-attention · Feed-forward network (FFN) · RMSNorm · Embedding and output head · every term