Rúben GalvãoThe Rabbit Hole

The Rabbit Hole / AI / Model architectures

Google DeepMind · Architecture map

Gemma 4 12B

A unified multimodal decoder: raw image patches and audio chunks enter through light projections, alongside a local/global attention stack.

Gemma 4 12B Unified, June 2026 (date from a news search result, not confirmed from an official page) · Gemma release timeline

Inside Gemma 4 12B

Parameters
11.95B
Layers
48
Width
3,840
Mixer
Grouped-query
Select a component to explore it. Layer colours match the execution-order strip.
The complete Gemma 4 12B architectureInput IDs select embeddings. Layer types execute in the order strip; dotted lines connect the type examples below. 16 query heads. Local layers use 8 key/value heads of 256 values over a 1,024-token window. Global layers use 512-wide heads with 1 key/value head, and keys double as values (attention_k_eq_v). Global layers rotate only a quarter of each head. Local layers: keys and values for 8 heads of 256 values over the last 1,024 tokens. Global layers: 1 head of 512 values, with keys reused as values. Final normalisation and output weights produce vocabulary scores and the next-token distribution.Text becomes token IDs.Text → tokens → IDstheoldrabbitsleepsEmbedding lookup262,1443,840Input token vectorsCL3,840Execution order · 48 layersLayer 1: Local layers (all except every 6th)Layer 2: Local layers (all except every 6th)Layer 3: Local layers (all except every 6th)Layer 4: Local layers (all except every 6th)Layer 5: Local layers (all except every 6th)Layer 6: Global layers (6, 12, 18, 24, 30, 36, 42, 48)Layer 7: Local layers (all except every 6th)Layer 8: Local layers (all except every 6th)Layer 9: Local layers (all except every 6th)Layer 10: Local layers (all except every 6th)Layer 11: Local layers (all except every 6th)Layer 12: Global layers (6, 12, 18, 24, 30, 36, 42, 48)Layer 13: Local layers (all except every 6th)Layer 14: Local layers (all except every 6th)Layer 15: Local layers (all except every 6th)Layer 16: Local layers (all except every 6th)Layer 17: Local layers (all except every 6th)Layer 18: Global layers (6, 12, 18, 24, 30, 36, 42, 48)Layer 19: Local layers (all except every 6th)Layer 20: Local layers (all except every 6th)Layer 21: Local layers (all except every 6th)Layer 22: Local layers (all except every 6th)Layer 23: Local layers (all except every 6th)Layer 24: Global layers (6, 12, 18, 24, 30, 36, 42, 48)Layer 25: Local layers (all except every 6th)Layer 26: Local layers (all except every 6th)Layer 27: Local layers (all except every 6th)Layer 28: Local layers (all except every 6th)Layer 29: Local layers (all except every 6th)Layer 30: Global layers (6, 12, 18, 24, 30, 36, 42, 48)Layer 31: Local layers (all except every 6th)Layer 32: Local layers (all except every 6th)Layer 33: Local layers (all except every 6th)Layer 34: Local layers (all except every 6th)Layer 35: Local layers (all except every 6th)Layer 36: Global layers (6, 12, 18, 24, 30, 36, 42, 48)Layer 37: Local layers (all except every 6th)Layer 38: Local layers (all except every 6th)Layer 39: Local layers (all except every 6th)Layer 40: Local layers (all except every 6th)Layer 41: Local layers (all except every 6th)Layer 42: Global layers (6, 12, 18, 24, 30, 36, 42, 48)Layer 43: Local layers (all except every 6th)Layer 44: Local layers (all except every 6th)Layer 45: Local layers (all except every 6th)Layer 46: Local layers (all except every 6th)Layer 47: Local layers (all except every 6th)Layer 48: Global layers (6, 12, 18, 24, 30, 36, 42, 48)Local layers (all except every 6th) · matches this colour in the execution-order barLocal layers (all except every 6th)Local layers (all except every 6th) · 40 repetitions40 layers · one layer shown40RMSNorm before this operation.RMSNormGrouped-query attention: Sliding-window attention, then a dense feed-forward network 15,360 wide.Grouped-queryattentionRotate query and key position components before attention scores; values are unchanged. Sliding-window attention, then a dense feed-forward network 15,360 wide.RoPENormalise queries and keys before attention scores. 16 query heads. Local layers use 8 key/value heads of 256 values over a 1,024-token window. Global layers use 512-wide heads with 1 key/value head, and keys double as values (attention_k_eq_v). Global layers rotate only a quarter of each head.QK-normSliding-window attention over 1,024 tokens.1,02416 query heads. Local layers use 8 key/value heads of 256 values over a 1,024-token window. Global layers use 512-wide heads with 1 key/value head, and keys double as values (attention_k_eq_v). Global layers rotate only a quarter of each head.Value normNormalise the branch output before the residual update.RMSNormAdd the branch output to the original stream. +RMSNorm before this operation.RMSNormGeGLU: Sliding-window attention, then a dense feed-forward network 15,360 wide.GeGLUNormalise the branch output before the residual update.RMSNormAdd the branch output to the original stream. +Layer type · execution order aboveGlobal layers (6, 12, 18, 24, 30, 36, 42, 48) · matches this colour in the execution-order barGlobal layers (6, 12, 18, 24, 30, 3…Global layers (6, 12, 18, 24, 30, 36, 42, 48) · 8 repetitions8 layers · one layer shown8RMSNorm before this operation.RMSNormGrouped-query attention: Full attention, then a dense feed-forward network 15,360 wide.Grouped-queryattentionRotate query and key position components before attention scores; values are unchanged. Full attention, then a dense feed-forward network 15,360 wide.RoPENormalise queries and keys before attention scores. 16 query heads. Local layers use 8 key/value heads of 256 values over a 1,024-token window. Global layers use 512-wide heads with 1 key/value head, and keys double as values (attention_k_eq_v). Global layers rotate only a quarter of each head.QK-norm16 query heads. Local layers use 8 key/value heads of 256 values over a 1,024-token window. Global layers use 512-wide heads with 1 key/value head, and keys double as values (attention_k_eq_v). Global layers rotate only a quarter of each head.Value normNormalise the branch output before the residual update.RMSNormAdd the branch output to the original stream. +RMSNorm before this operation.RMSNormGeGLU: Full attention, then a dense feed-forward network 15,360 wide.GeGLUNormalise the branch output before the residual update.RMSNormAdd the branch output to the original stream. +Layer type · execution order aboveAfter all 48 layer executionsResidual streamLast columnCL3,840Final RMSNormReuses the embedding table, transposed.Tied output weights3,840262,144Vocabulary scoresSoftmax262,144Next-token probabilities
Inside grouped-query attention · Local layers (all except every 6th)
2 query heads per group × 8 K/V groups.

Earlier context dimmed · current token bright · dashed regions contain cached entries.

Gemma 4 12B: Local layers (all except every 6th) · grouped-query attention16 query heads. Local layers use 8 key/value heads of 256 values over a 1,024-token window. Global layers use 512-wide heads with 1 key/value head, and keys double as values (attention_k_eq_v). Global layers rotate only a quarter of each head. Local layers: keys and values for 8 heads of 256 values over the last 1,024 tokens. Global layers: 1 head of 512 values, with keys reused as values.8 KV groups; the front face shows one representative.8 KV groups2 heads / group; the front face shows one representative.2 heads / groupAttention input. 16 query heads. Local layers use 8 key/value heads of 256 values over a 1,024-token window. Global layers use 512-wide heads with 1 key/value head, and keys double as values (attention_k_eq_v). Global layers rotate only a quarter of each head.Earlier context is dimmed; outlined columns are current.Current token computation.Attention input3,840CLWq. 16 query heads. Local layers use 8 key/value heads of 256 values over a 1,024-token window. Global layers use 512-wide heads with 1 key/value head, and keys double as values (attention_k_eq_v). Global layers rotate only a quarter of each head.Wq3,840256Wk. 16 query heads. Local layers use 8 key/value heads of 256 values over a 1,024-token window. Global layers use 512-wide heads with 1 key/value head, and keys double as values (attention_k_eq_v). Global layers rotate only a quarter of each head.Wk3,840256Wv. 16 query heads. Local layers use 8 key/value heads of 256 values over a 1,024-token window. Global layers use 512-wide heads with 1 key/value head, and keys double as values (attention_k_eq_v). Global layers rotate only a quarter of each head.Wv3,840256RMSNorm. 16 query heads. Local layers use 8 key/value heads of 256 values over a 1,024-token window. Global layers use 512-wide heads with 1 key/value head, and keys double as values (attention_k_eq_v). Global layers rotate only a quarter of each head.RMSNormRoPE. 16 query heads. Local layers use 8 key/value heads of 256 values over a 1,024-token window. Global layers use 512-wide heads with 1 key/value head, and keys double as values (attention_k_eq_v). Global layers rotate only a quarter of each head.RoPERMSNorm. 16 query heads. Local layers use 8 key/value heads of 256 values over a 1,024-token window. Global layers use 512-wide heads with 1 key/value head, and keys double as values (attention_k_eq_v). Global layers rotate only a quarter of each head.RMSNormRoPE. 16 query heads. Local layers use 8 key/value heads of 256 values over a 1,024-token window. Global layers use 512-wide heads with 1 key/value head, and keys double as values (attention_k_eq_v). Global layers rotate only a quarter of each head.RoPEValue norm. 16 query heads. Local layers use 8 key/value heads of 256 values over a 1,024-token window. Global layers use 512-wide heads with 1 key/value head, and keys double as values (attention_k_eq_v). Global layers rotate only a quarter of each head.Value normK cache. 16 query heads. Local layers use 8 key/value heads of 256 values over a 1,024-token window. Global layers use 512-wide heads with 1 key/value head, and keys double as values (attention_k_eq_v). Global layers rotate only a quarter of each head.Earlier columns are cached; outlined columns are newly computed.Cached positions from earlier decoding steps.Current token computation.K cache256≤ 1024V cache. 16 query heads. Local layers use 8 key/value heads of 256 values over a 1,024-token window. Global layers use 512-wide heads with 1 key/value head, and keys double as values (attention_k_eq_v). Global layers rotate only a quarter of each head.Earlier columns are cached; outlined columns are newly computed.Cached positions from earlier decoding steps.Current token computation.V cache256≤ 1024Q context. 16 query heads. Local layers use 8 key/value heads of 256 values over a 1,024-token window. Global layers use 512-wide heads with 1 key/value head, and keys double as values (attention_k_eq_v). Global layers rotate only a quarter of each head.Earlier context is dimmed; outlined columns are current.Current token computation.Q context256CLScaled query–key scores, masking and softmax. 16 query heads. Local layers use 8 key/value heads of 256 values over a 1,024-token window. Global layers use 512-wide heads with 1 key/value head, and keys double as values (attention_k_eq_v). Global layers rotate only a quarter of each head.16 query heads. Local layers use 8 key/value heads of 256 values over a 1,024-token window. Global layers use 512-wide heads with 1 key/value head, and keys double as values (attention_k_eq_v). Global layers rotate only a quarter of each head.Window 1,024CLCL×. 16 query heads. Local layers use 8 key/value heads of 256 values over a 1,024-token window. Global layers use 512-wide heads with 1 key/value head, and keys double as values (attention_k_eq_v). Global layers rotate only a quarter of each head.×Joined heads. 16 query heads. Local layers use 8 key/value heads of 256 values over a 1,024-token window. Global layers use 512-wide heads with 1 key/value head, and keys double as values (attention_k_eq_v). Global layers rotate only a quarter of each head.16Wo. 16 query heads. Local layers use 8 key/value heads of 256 values over a 1,024-token window. Global layers use 512-wide heads with 1 key/value head, and keys double as values (attention_k_eq_v). Global layers rotate only a quarter of each head.Wo4,0963,840Attention output. 16 query heads. Local layers use 8 key/value heads of 256 values over a 1,024-token window. Global layers use 512-wide heads with 1 key/value head, and keys double as values (attention_k_eq_v). Global layers rotate only a quarter of each head.Earlier context is dimmed; outlined columns are current.Current token computation.Attention output3,840CL
Inside multi-query attention · Global layers (6, 12, 18, 24, 30, 36, 42, 48)
16 query heads per group × 1 K/V groups.

Earlier context dimmed · current token bright · dashed regions contain cached entries.

Gemma 4 12B: Global layers (6, 12, 18, 24, 30, 36, 42, 48) · multi-query attention16 query heads. Local layers use 8 key/value heads of 256 values over a 1,024-token window. Global layers use 512-wide heads with 1 key/value head, and keys double as values (attention_k_eq_v). Global layers rotate only a quarter of each head. Local layers: keys and values for 8 heads of 256 values over the last 1,024 tokens. Global layers: 1 head of 512 values, with keys reused as values.1 KV groups; the front face shows one representative.1 KV groups16 heads / group; the front face shows one representative.16 heads / groupAttention input. 16 query heads. Local layers use 8 key/value heads of 256 values over a 1,024-token window. Global layers use 512-wide heads with 1 key/value head, and keys double as values (attention_k_eq_v). Global layers rotate only a quarter of each head.Earlier context is dimmed; outlined columns are current.Current token computation.Attention input3,840CLWq. 16 query heads. Local layers use 8 key/value heads of 256 values over a 1,024-token window. Global layers use 512-wide heads with 1 key/value head, and keys double as values (attention_k_eq_v). Global layers rotate only a quarter of each head.Wq3,840512Wkv. 16 query heads. Local layers use 8 key/value heads of 256 values over a 1,024-token window. Global layers use 512-wide heads with 1 key/value head, and keys double as values (attention_k_eq_v). Global layers rotate only a quarter of each head.Wkv3,840512RMSNorm. 16 query heads. Local layers use 8 key/value heads of 256 values over a 1,024-token window. Global layers use 512-wide heads with 1 key/value head, and keys double as values (attention_k_eq_v). Global layers rotate only a quarter of each head.RMSNormRoPE 128. 16 query heads. Local layers use 8 key/value heads of 256 values over a 1,024-token window. Global layers use 512-wide heads with 1 key/value head, and keys double as values (attention_k_eq_v). Global layers rotate only a quarter of each head.RoPE 128RMSNorm. 16 query heads. Local layers use 8 key/value heads of 256 values over a 1,024-token window. Global layers use 512-wide heads with 1 key/value head, and keys double as values (attention_k_eq_v). Global layers rotate only a quarter of each head.RMSNormRoPE 128. 16 query heads. Local layers use 8 key/value heads of 256 values over a 1,024-token window. Global layers use 512-wide heads with 1 key/value head, and keys double as values (attention_k_eq_v). Global layers rotate only a quarter of each head.RoPE 128Value norm. 16 query heads. Local layers use 8 key/value heads of 256 values over a 1,024-token window. Global layers use 512-wide heads with 1 key/value head, and keys double as values (attention_k_eq_v). Global layers rotate only a quarter of each head.Value normK cache. 16 query heads. Local layers use 8 key/value heads of 256 values over a 1,024-token window. Global layers use 512-wide heads with 1 key/value head, and keys double as values (attention_k_eq_v). Global layers rotate only a quarter of each head.Earlier columns are cached; outlined columns are newly computed.Cached positions from earlier decoding steps.Current token computation.K cache512CLV cache. 16 query heads. Local layers use 8 key/value heads of 256 values over a 1,024-token window. Global layers use 512-wide heads with 1 key/value head, and keys double as values (attention_k_eq_v). Global layers rotate only a quarter of each head.Earlier columns are cached; outlined columns are newly computed.Cached positions from earlier decoding steps.Current token computation.V cache512CLQ context. 16 query heads. Local layers use 8 key/value heads of 256 values over a 1,024-token window. Global layers use 512-wide heads with 1 key/value head, and keys double as values (attention_k_eq_v). Global layers rotate only a quarter of each head.Earlier context is dimmed; outlined columns are current.Current token computation.Q context512CLScaled query–key scores, masking and softmax. 16 query heads. Local layers use 8 key/value heads of 256 values over a 1,024-token window. Global layers use 512-wide heads with 1 key/value head, and keys double as values (attention_k_eq_v). Global layers rotate only a quarter of each head.CLCL×. 16 query heads. Local layers use 8 key/value heads of 256 values over a 1,024-token window. Global layers use 512-wide heads with 1 key/value head, and keys double as values (attention_k_eq_v). Global layers rotate only a quarter of each head.×Joined heads. 16 query heads. Local layers use 8 key/value heads of 256 values over a 1,024-token window. Global layers use 512-wide heads with 1 key/value head, and keys double as values (attention_k_eq_v). Global layers rotate only a quarter of each head.16Wo. 16 query heads. Local layers use 8 key/value heads of 256 values over a 1,024-token window. Global layers use 512-wide heads with 1 key/value head, and keys double as values (attention_k_eq_v). Global layers rotate only a quarter of each head.Wo8,1923,840Attention output. 16 query heads. Local layers use 8 key/value heads of 256 values over a 1,024-token window. Global layers use 512-wide heads with 1 key/value head, and keys double as values (attention_k_eq_v). Global layers rotate only a quarter of each head.Earlier context is dimmed; outlined columns are current.Current token computation.Attention output3,840CL
Model-specific details
Local layers (all except every 6th) · 40 repetitions
Sliding-window attention, then a dense feed-forward network 15,360 wide.
Global layers (6, 12, 18, 24, 30, 36, 42, 48) · 8 repetitions
Full attention, then a dense feed-forward network 15,360 wide.
Attention and positions
16 query heads. Local layers use 8 key/value heads of 256 values over a 1,024-token window. Global layers use 512-wide heads with 1 key/value head, and keys double as values (attention_k_eq_v). Global layers rotate only a quarter of each head.
Memory
Local layers: keys and values for 8 heads of 256 values over the last 1,024 tokens. Global layers: 1 head of 512 values, with keys reused as values.

Direct multimodal inputs

Image patches and audio chunks are projected directly into the 48-layer decoder, without separate encoder towers. The text stream has width 3,840.

How it scores

AA Intelligence Index

Version 4.3.2 · higher is better · checked 2026-11-01. Separate from Epoch ECI.

Checkpoint / sizeResultEvaluation
Gemma 4 12B14AA Index 4.3.2Best evaluated setting
AA Index distributionBest checkpoint per model variant among 97 scored variants in this atlas. Gemma 4 12B scores 14; its bin is highlighted. Known estimates are excluded.Model variants0.0–3.0: 0 variants3.0–6.0: 15 variants6.0–9.0: 21 variants9.0–12.0: 13 variants12.0–15.0: 9 variants15.0–18.0: 5 variants18.0–21.0: 5 variants21.0–24.0: 6 variants24.0–27.0: 4 variants27.0–30.0: 2 variants30.0–33.0: 2 variants33.0–36.0: 2 variants36.0–39.0: 2 variants39.0–42.0: 3 variants42.0–45.0: 4 variants45.0–48.0: 3 variants48.0–51.0: 0 variants51.0–54.0: 0 variants54.0–57.0: 1 variants57.0–60.0: 0 variants21003060AA Index 4.3.2 →
Gemma 4 12B: 14. Distribution of 97 scored variants in this atlas, using each variant’s best checkpoint. Known estimates excluded.

Explore the components

Sources for this map