Transformer (base)
Google · Transformer · open weights · encoder-decoder
- MHA
- Post-LN
- Encoder-decoder
Facts and where they come from
| Released | 2017-06 | paperpaperarXiv v1, June 2017 |
|---|---|---|
| Licence | not disclosed | not disclosed |
| Total parameters | 65M | paperpaperTable 3: base model, 65 x 10^6 parameters |
| Active parameters | not disclosed | not disclosed |
| Context length | not disclosed | not disclosed |
| Norm placement | post-ln | codemodelling codeAttention Is All You Need §3.1: LayerNorm(x + Sublayer(x)) |
| Norm type | LayerNorm | codemodelling codeAttention Is All You Need §3.1: LayerNorm(x + Sublayer(x)) |
| QK-norm | no | codemodelling codeno q/k normalisation in the attention block |
| Positional encoding | sinusoidal | paperpaper§3.5: sinusoidal positional encodings |
| Parallel attention and MLP | no | codemodelling codeAttention Is All You Need §3.1: LayerNorm(x + Sublayer(x)) |
Architecture, drawn from the data
MHA 8q/8kv. Each column is one layer: its token mixer above, its feed-forward block below. Paler columns reuse another layer’s keys and values.
Modelled costs
From the cost model, batch size 1. Totals the lab states are in the table above; differences come from rounding, from what a lab counts, or from parts the model does not describe (listed on the about page).
| Parameters (modelled) | 63M |
|---|---|
| Active per token (modelled) | 63M |
| Without embeddings and output head | 44.1M total, 44.1M active |
| KV cache per token, BF16 (layers that grow with context) | 24 KiB |
| KV cache + state at 128K tokens, BF16 | 3 GiB |
| Decode FLOPs per token at 4K context | 227 MFLOP |
| Prefill FLOPs for a 4K prompt | 515 GFLOP |
KV cache against context
Every architecture field
| Field | Value | Source |
|---|---|---|
| d_model | 512 | paperpaperTable 3 (base): d_model 512 |
| vocab | 37,000 | paperpaper§5.1: shared source-target vocabulary of about 37000 tokens (EN-DE) |
| tied_embeddings | true | codemodelling codetransformers 5.18.0 t5: tie_word_embeddings default true |
| mixers.full.type | attn | codemodelling codeattention |
| mixers.full.heads | 8 | paperpaperTable 3 (base): h 8 |
| mixers.full.kv_heads | 8 | paperpaperTable 3 (base): h 8 |
| mixers.full.head_dim | 64 | paperpaperTable 3 (base): d_k = d_v = 64 |
| ffns.dense.type | dense | codemodelling codeMLP |
| ffns.dense.d_ff | 2,048 | paperpaperTable 3 (base): d_ff 2048 |
| ffns.dense.gated | false | codemodelling codefeed_forward_proj |
| layout | 6× full/dense | paperpaperTable 3 (base): N = 6 |
| encoder_layout | 6× full/dense | paperpaperTable 3 (base): N = 6 (encoder and decoder) |
| norms_per_layer | 2 | codemodelling codepre-norm RMSNorm |
Sources
- paper · Attention Is All You Need
- modelling code · transformers 5.18.0 modelling code, or the model repository's own modelling file at the pinned revision