Rúben GalvãoThe Rabbit Hole

The Rabbit Hole / AI / Model architectures

Google DeepMind · Architecture map

Gemma 4 E2B

A Gemma 3 style local and global stack that adds wider global heads and shared keys and values, plus per-layer embeddings.

Gemma 4 E2B, April 2026 · Gemma release timeline

Inside Gemma 4 E2B

Parameters
2.3B effective · 5.1B total
Layers
35
Width
1,536
Mixer
Multi-query
Select a component to explore it. Layer colours match the execution-order strip.
The complete Gemma 4 E2B architectureInput IDs select embeddings. Layer types execute in the order strip; dotted lines connect the type examples below. 8 query heads. Local layers use 1 key/value head of 256 values over a 512-token window. Global layers use 512-wide heads, also with 1 key/value head and their own value projection (keys are not reused as values). Global layers rotate only a quarter of each head. The last 20 layers compute no keys or values of their own. Local layers: keys and values for 1 head of 256 values over the last 512 tokens. Global layers: 1 head of 512 values. Layers 16 to 35 hold no cache: they read the keys and values of layer 14 (local) and layer 15 (global), so only 15 layers keep one. Final normalisation and output weights produce vocabulary scores and the next-token distribution.Text becomes token IDs.Text → tokens → IDstheoldrabbitsleepsEmbedding lookup262,1441,536Input token vectorsCL1,53616-layer vision transformer (width 768, patch 16, 3×3 pooling), 280 tokens per image by default; also takes video framesVision / videoencoder12-layer Conformer (width 1024), the same design as Gemma 3nAudioencoderExecution order · 35 layersLayer 1: Local layers (own keys and values)Layer 2: Local layers (own keys and values)Layer 3: Local layers (own keys and values)Layer 4: Local layers (own keys and values)Layer 5: Global layers (own keys and values)Layer 6: Local layers (own keys and values)Layer 7: Local layers (own keys and values)Layer 8: Local layers (own keys and values)Layer 9: Local layers (own keys and values)Layer 10: Global layers (own keys and values)Layer 11: Local layers (own keys and values)Layer 12: Local layers (own keys and values)Layer 13: Local layers (own keys and values)Layer 14: Local layers (own keys and values)Layer 15: Global layers (own keys and values)Layer 16: Local layers (shared keys and values)Layer 17: Local layers (shared keys and values)Layer 18: Local layers (shared keys and values)Layer 19: Local layers (shared keys and values)Layer 20: Global layers (shared keys and values)Layer 21: Local layers (shared keys and values)Layer 22: Local layers (shared keys and values)Layer 23: Local layers (shared keys and values)Layer 24: Local layers (shared keys and values)Layer 25: Global layers (shared keys and values)Layer 26: Local layers (shared keys and values)Layer 27: Local layers (shared keys and values)Layer 28: Local layers (shared keys and values)Layer 29: Local layers (shared keys and values)Layer 30: Global layers (shared keys and values)Layer 31: Local layers (shared keys and values)Layer 32: Local layers (shared keys and values)Layer 33: Local layers (shared keys and values)Layer 34: Local layers (shared keys and values)Layer 35: Global layers (shared keys and values)Local layers (own keys and values) · matches this colour in the execution-order barLocal layers (own keys and values)Local layers (own keys and values) · 12 repetitions12 layers · one layer shown12RMSNorm before this operation.RMSNormMulti-query attention: Sliding-window attention over 512 tokens, then a dense gated feed-forward network 6,144 wide.Multi-queryattentionRotate query and key position components before attention scores; values are unchanged. Sliding-window attention over 512 tokens, then a dense gated feed-forward network 6,144 wide.RoPENormalise queries and keys before attention scores. 8 query heads. Local layers use 1 key/value head of 256 values over a 512-token window. Global layers use 512-wide heads, also with 1 key/value head and their own value projection (keys are not reused as values). Global layers rotate only a quarter of each head. The last 20 layers compute no keys or values of their own.QK-normSliding-window attention over 512 tokens.5128 query heads. Local layers use 1 key/value head of 256 values over a 512-token window. Global layers use 512-wide heads, also with 1 key/value head and their own value projection (keys are not reused as values). Global layers rotate only a quarter of each head. The last 20 layers compute no keys or values of their own.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 over 512 tokens, then a dense gated feed-forward network 6,144 wide.GeGLUNormalise the branch output before the residual update.RMSNormAdd the branch output to the original stream. +A 256-wide vector looked up per token for this layer, gated, projected and added after the feed-forward network.Token ID, gate and projectionPer-layer embedding+Layer type · execution order aboveGlobal layers (own keys and values) · matches this colour in the execution-order barGlobal layers (own keys and values)Global layers (own keys and values) · 3 repetitions3 layers · one layer shown3RMSNorm before this operation.RMSNormMulti-query attention: Full attention over the context, then a dense gated feed-forward network 6,144 wide.Multi-queryattentionRotate query and key position components before attention scores; values are unchanged. Full attention over the context, then a dense gated feed-forward network 6,144 wide.RoPENormalise queries and keys before attention scores. 8 query heads. Local layers use 1 key/value head of 256 values over a 512-token window. Global layers use 512-wide heads, also with 1 key/value head and their own value projection (keys are not reused as values). Global layers rotate only a quarter of each head. The last 20 layers compute no keys or values of their own.QK-norm8 query heads. Local layers use 1 key/value head of 256 values over a 512-token window. Global layers use 512-wide heads, also with 1 key/value head and their own value projection (keys are not reused as values). Global layers rotate only a quarter of each head. The last 20 layers compute no keys or values of their own.Value normNormalise the branch output before the residual update.RMSNormAdd the branch output to the original stream. +RMSNorm before this operation.RMSNormGeGLU: Full attention over the context, then a dense gated feed-forward network 6,144 wide.GeGLUNormalise the branch output before the residual update.RMSNormAdd the branch output to the original stream. +A 256-wide vector looked up per token for this layer, gated, projected and added after the feed-forward network.Token ID, gate and projectionPer-layer embedding+Layer type · execution order aboveLocal layers (shared keys and values) · matches this colour in the execution-order barLocal layers (shared keys and value…Local layers (shared keys and values) · 16 repetitions16 layers · one layer shown16RMSNorm before this operation.RMSNormMulti-query attention: Sliding-window attention over 512 tokens, then a dense gated feed-forward network 12,288 wide (double width). Keys and values come from an earlier layer; this layer computes none of its own.Multi-queryattentionRotate query and key position components before attention scores; values are unchanged. Sliding-window attention over 512 tokens, then a dense gated feed-forward network 12,288 wide (double width). Keys and values come from an earlier layer; this layer computes none of its own.RoPENormalise queries and keys before attention scores. 8 query heads. Local layers use 1 key/value head of 256 values over a 512-token window. Global layers use 512-wide heads, also with 1 key/value head and their own value projection (keys are not reused as values). Global layers rotate only a quarter of each head. The last 20 layers compute no keys or values of their own.QK-normSliding-window attention over 512 tokens.5128 query heads. Local layers use 1 key/value head of 256 values over a 512-token window. Global layers use 512-wide heads, also with 1 key/value head and their own value projection (keys are not reused as values). Global layers rotate only a quarter of each head. The last 20 layers compute no keys or values of their own.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 over 512 tokens, then a dense gated feed-forward network 12,288 wide (double width). Keys and values come from an earlier layer; this layer computes none of its own.GeGLUNormalise the branch output before the residual update.RMSNormAdd the branch output to the original stream. +A 256-wide vector looked up per token for this layer, gated, projected and added after the feed-forward network.Token ID, gate and projectionPer-layer embedding+Layer type · execution order aboveGlobal layers (shared keys and values) · matches this colour in the execution-order barGlobal layers (shared keys and valu…Global layers (shared keys and values) · 4 repetitions4 layers · one layer shown4RMSNorm before this operation.RMSNormMulti-query attention: Full attention over the context, then a dense gated feed-forward network 12,288 wide (double width). Keys and values come from an earlier layer; this layer computes none of its own.Multi-queryattentionRotate query and key position components before attention scores; values are unchanged. Full attention over the context, then a dense gated feed-forward network 12,288 wide (double width). Keys and values come from an earlier layer; this layer computes none of its own.RoPENormalise queries and keys before attention scores. 8 query heads. Local layers use 1 key/value head of 256 values over a 512-token window. Global layers use 512-wide heads, also with 1 key/value head and their own value projection (keys are not reused as values). Global layers rotate only a quarter of each head. The last 20 layers compute no keys or values of their own.QK-norm8 query heads. Local layers use 1 key/value head of 256 values over a 512-token window. Global layers use 512-wide heads, also with 1 key/value head and their own value projection (keys are not reused as values). Global layers rotate only a quarter of each head. The last 20 layers compute no keys or values of their own.Value normNormalise the branch output before the residual update.RMSNormAdd the branch output to the original stream. +RMSNorm before this operation.RMSNormGeGLU: Full attention over the context, then a dense gated feed-forward network 12,288 wide (double width). Keys and values come from an earlier layer; this layer computes none of its own.GeGLUNormalise the branch output before the residual update.RMSNormAdd the branch output to the original stream. +A 256-wide vector looked up per token for this layer, gated, projected and added after the feed-forward network.Token ID, gate and projectionPer-layer embedding+Layer type · execution order aboveAfter all 35 layer executionsResidual streamLast columnCL1,536Final RMSNormReuses the embedding table, transposed.Tied output weights1,536262,144Vocabulary scoresSoftmax262,144Next-token probabilities
Inside multi-query attention · Local layers (own keys and values)
8 query heads per group × 1 K/V groups.

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

Gemma 4 E2B: Local layers (own keys and values) · multi-query attention8 query heads. Local layers use 1 key/value head of 256 values over a 512-token window. Global layers use 512-wide heads, also with 1 key/value head and their own value projection (keys are not reused as values). Global layers rotate only a quarter of each head. The last 20 layers compute no keys or values of their own. Local layers: keys and values for 1 head of 256 values over the last 512 tokens. Global layers: 1 head of 512 values. Layers 16 to 35 hold no cache: they read the keys and values of layer 14 (local) and layer 15 (global), so only 15 layers keep one.1 KV groups; the front face shows one representative.1 KV groups8 heads / group; the front face shows one representative.8 heads / groupAttention input. 8 query heads. Local layers use 1 key/value head of 256 values over a 512-token window. Global layers use 512-wide heads, also with 1 key/value head and their own value projection (keys are not reused as values). Global layers rotate only a quarter of each head. The last 20 layers compute no keys or values of their own.Earlier context is dimmed; outlined columns are current.Current token computation.Attention input1,536CLWq. 8 query heads. Local layers use 1 key/value head of 256 values over a 512-token window. Global layers use 512-wide heads, also with 1 key/value head and their own value projection (keys are not reused as values). Global layers rotate only a quarter of each head. The last 20 layers compute no keys or values of their own.Wq1,536256Wk. 8 query heads. Local layers use 1 key/value head of 256 values over a 512-token window. Global layers use 512-wide heads, also with 1 key/value head and their own value projection (keys are not reused as values). Global layers rotate only a quarter of each head. The last 20 layers compute no keys or values of their own.Wk1,536256Wv. 8 query heads. Local layers use 1 key/value head of 256 values over a 512-token window. Global layers use 512-wide heads, also with 1 key/value head and their own value projection (keys are not reused as values). Global layers rotate only a quarter of each head. The last 20 layers compute no keys or values of their own.Wv1,536256RMSNorm. 8 query heads. Local layers use 1 key/value head of 256 values over a 512-token window. Global layers use 512-wide heads, also with 1 key/value head and their own value projection (keys are not reused as values). Global layers rotate only a quarter of each head. The last 20 layers compute no keys or values of their own.RMSNormRoPE. 8 query heads. Local layers use 1 key/value head of 256 values over a 512-token window. Global layers use 512-wide heads, also with 1 key/value head and their own value projection (keys are not reused as values). Global layers rotate only a quarter of each head. The last 20 layers compute no keys or values of their own.RoPERMSNorm. 8 query heads. Local layers use 1 key/value head of 256 values over a 512-token window. Global layers use 512-wide heads, also with 1 key/value head and their own value projection (keys are not reused as values). Global layers rotate only a quarter of each head. The last 20 layers compute no keys or values of their own.RMSNormRoPE. 8 query heads. Local layers use 1 key/value head of 256 values over a 512-token window. Global layers use 512-wide heads, also with 1 key/value head and their own value projection (keys are not reused as values). Global layers rotate only a quarter of each head. The last 20 layers compute no keys or values of their own.RoPEValue norm. 8 query heads. Local layers use 1 key/value head of 256 values over a 512-token window. Global layers use 512-wide heads, also with 1 key/value head and their own value projection (keys are not reused as values). Global layers rotate only a quarter of each head. The last 20 layers compute no keys or values of their own.Value normK cache. 8 query heads. Local layers use 1 key/value head of 256 values over a 512-token window. Global layers use 512-wide heads, also with 1 key/value head and their own value projection (keys are not reused as values). Global layers rotate only a quarter of each head. The last 20 layers compute no keys or values of their own.Earlier columns are cached; outlined columns are newly computed.Cached positions from earlier decoding steps.Current token computation.K cache256≤ 512V cache. 8 query heads. Local layers use 1 key/value head of 256 values over a 512-token window. Global layers use 512-wide heads, also with 1 key/value head and their own value projection (keys are not reused as values). Global layers rotate only a quarter of each head. The last 20 layers compute no keys or values of their own.Earlier columns are cached; outlined columns are newly computed.Cached positions from earlier decoding steps.Current token computation.V cache256≤ 512Q context. 8 query heads. Local layers use 1 key/value head of 256 values over a 512-token window. Global layers use 512-wide heads, also with 1 key/value head and their own value projection (keys are not reused as values). Global layers rotate only a quarter of each head. The last 20 layers compute no keys or values of their own.Earlier context is dimmed; outlined columns are current.Current token computation.Q context256CLScaled query–key scores, masking and softmax. 8 query heads. Local layers use 1 key/value head of 256 values over a 512-token window. Global layers use 512-wide heads, also with 1 key/value head and their own value projection (keys are not reused as values). Global layers rotate only a quarter of each head. The last 20 layers compute no keys or values of their own.8 query heads. Local layers use 1 key/value head of 256 values over a 512-token window. Global layers use 512-wide heads, also with 1 key/value head and their own value projection (keys are not reused as values). Global layers rotate only a quarter of each head. The last 20 layers compute no keys or values of their own.Window 512CLCL×. 8 query heads. Local layers use 1 key/value head of 256 values over a 512-token window. Global layers use 512-wide heads, also with 1 key/value head and their own value projection (keys are not reused as values). Global layers rotate only a quarter of each head. The last 20 layers compute no keys or values of their own.×Joined heads. 8 query heads. Local layers use 1 key/value head of 256 values over a 512-token window. Global layers use 512-wide heads, also with 1 key/value head and their own value projection (keys are not reused as values). Global layers rotate only a quarter of each head. The last 20 layers compute no keys or values of their own.8Wo. 8 query heads. Local layers use 1 key/value head of 256 values over a 512-token window. Global layers use 512-wide heads, also with 1 key/value head and their own value projection (keys are not reused as values). Global layers rotate only a quarter of each head. The last 20 layers compute no keys or values of their own.Wo2,0481,536Attention output. 8 query heads. Local layers use 1 key/value head of 256 values over a 512-token window. Global layers use 512-wide heads, also with 1 key/value head and their own value projection (keys are not reused as values). Global layers rotate only a quarter of each head. The last 20 layers compute no keys or values of their own.Earlier context is dimmed; outlined columns are current.Current token computation.Attention output1,536CL
Inside multi-query attention · Global layers (own keys and values)
8 query heads per group × 1 K/V groups.

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

Gemma 4 E2B: Global layers (own keys and values) · multi-query attention8 query heads. Local layers use 1 key/value head of 256 values over a 512-token window. Global layers use 512-wide heads, also with 1 key/value head and their own value projection (keys are not reused as values). Global layers rotate only a quarter of each head. The last 20 layers compute no keys or values of their own. Local layers: keys and values for 1 head of 256 values over the last 512 tokens. Global layers: 1 head of 512 values. Layers 16 to 35 hold no cache: they read the keys and values of layer 14 (local) and layer 15 (global), so only 15 layers keep one.1 KV groups; the front face shows one representative.1 KV groups8 heads / group; the front face shows one representative.8 heads / groupAttention input. 8 query heads. Local layers use 1 key/value head of 256 values over a 512-token window. Global layers use 512-wide heads, also with 1 key/value head and their own value projection (keys are not reused as values). Global layers rotate only a quarter of each head. The last 20 layers compute no keys or values of their own.Earlier context is dimmed; outlined columns are current.Current token computation.Attention input1,536CLWq. 8 query heads. Local layers use 1 key/value head of 256 values over a 512-token window. Global layers use 512-wide heads, also with 1 key/value head and their own value projection (keys are not reused as values). Global layers rotate only a quarter of each head. The last 20 layers compute no keys or values of their own.Wq1,536512Wk. 8 query heads. Local layers use 1 key/value head of 256 values over a 512-token window. Global layers use 512-wide heads, also with 1 key/value head and their own value projection (keys are not reused as values). Global layers rotate only a quarter of each head. The last 20 layers compute no keys or values of their own.Wk1,536512Wv. 8 query heads. Local layers use 1 key/value head of 256 values over a 512-token window. Global layers use 512-wide heads, also with 1 key/value head and their own value projection (keys are not reused as values). Global layers rotate only a quarter of each head. The last 20 layers compute no keys or values of their own.Wv1,536512RMSNorm. 8 query heads. Local layers use 1 key/value head of 256 values over a 512-token window. Global layers use 512-wide heads, also with 1 key/value head and their own value projection (keys are not reused as values). Global layers rotate only a quarter of each head. The last 20 layers compute no keys or values of their own.RMSNormRoPE 128. 8 query heads. Local layers use 1 key/value head of 256 values over a 512-token window. Global layers use 512-wide heads, also with 1 key/value head and their own value projection (keys are not reused as values). Global layers rotate only a quarter of each head. The last 20 layers compute no keys or values of their own.RoPE 128RMSNorm. 8 query heads. Local layers use 1 key/value head of 256 values over a 512-token window. Global layers use 512-wide heads, also with 1 key/value head and their own value projection (keys are not reused as values). Global layers rotate only a quarter of each head. The last 20 layers compute no keys or values of their own.RMSNormRoPE 128. 8 query heads. Local layers use 1 key/value head of 256 values over a 512-token window. Global layers use 512-wide heads, also with 1 key/value head and their own value projection (keys are not reused as values). Global layers rotate only a quarter of each head. The last 20 layers compute no keys or values of their own.RoPE 128Value norm. 8 query heads. Local layers use 1 key/value head of 256 values over a 512-token window. Global layers use 512-wide heads, also with 1 key/value head and their own value projection (keys are not reused as values). Global layers rotate only a quarter of each head. The last 20 layers compute no keys or values of their own.Value normK cache. 8 query heads. Local layers use 1 key/value head of 256 values over a 512-token window. Global layers use 512-wide heads, also with 1 key/value head and their own value projection (keys are not reused as values). Global layers rotate only a quarter of each head. The last 20 layers compute no keys or values of their own.Earlier columns are cached; outlined columns are newly computed.Cached positions from earlier decoding steps.Current token computation.K cache512CLV cache. 8 query heads. Local layers use 1 key/value head of 256 values over a 512-token window. Global layers use 512-wide heads, also with 1 key/value head and their own value projection (keys are not reused as values). Global layers rotate only a quarter of each head. The last 20 layers compute no keys or values of their own.Earlier columns are cached; outlined columns are newly computed.Cached positions from earlier decoding steps.Current token computation.V cache512CLQ context. 8 query heads. Local layers use 1 key/value head of 256 values over a 512-token window. Global layers use 512-wide heads, also with 1 key/value head and their own value projection (keys are not reused as values). Global layers rotate only a quarter of each head. The last 20 layers compute no keys or values of their own.Earlier context is dimmed; outlined columns are current.Current token computation.Q context512CLScaled query–key scores, masking and softmax. 8 query heads. Local layers use 1 key/value head of 256 values over a 512-token window. Global layers use 512-wide heads, also with 1 key/value head and their own value projection (keys are not reused as values). Global layers rotate only a quarter of each head. The last 20 layers compute no keys or values of their own.CLCL×. 8 query heads. Local layers use 1 key/value head of 256 values over a 512-token window. Global layers use 512-wide heads, also with 1 key/value head and their own value projection (keys are not reused as values). Global layers rotate only a quarter of each head. The last 20 layers compute no keys or values of their own.×Joined heads. 8 query heads. Local layers use 1 key/value head of 256 values over a 512-token window. Global layers use 512-wide heads, also with 1 key/value head and their own value projection (keys are not reused as values). Global layers rotate only a quarter of each head. The last 20 layers compute no keys or values of their own.8Wo. 8 query heads. Local layers use 1 key/value head of 256 values over a 512-token window. Global layers use 512-wide heads, also with 1 key/value head and their own value projection (keys are not reused as values). Global layers rotate only a quarter of each head. The last 20 layers compute no keys or values of their own.Wo4,0961,536Attention output. 8 query heads. Local layers use 1 key/value head of 256 values over a 512-token window. Global layers use 512-wide heads, also with 1 key/value head and their own value projection (keys are not reused as values). Global layers rotate only a quarter of each head. The last 20 layers compute no keys or values of their own.Earlier context is dimmed; outlined columns are current.Current token computation.Attention output1,536CL
Inside multi-query attention · Local layers (shared keys and values)
8 query heads per group × 1 K/V groups.

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

Gemma 4 E2B: Local layers (shared keys and values) · multi-query attention8 query heads. Local layers use 1 key/value head of 256 values over a 512-token window. Global layers use 512-wide heads, also with 1 key/value head and their own value projection (keys are not reused as values). Global layers rotate only a quarter of each head. The last 20 layers compute no keys or values of their own. Local layers: keys and values for 1 head of 256 values over the last 512 tokens. Global layers: 1 head of 512 values. Layers 16 to 35 hold no cache: they read the keys and values of layer 14 (local) and layer 15 (global), so only 15 layers keep one.1 KV groups; the front face shows one representative.1 KV groups8 heads / group; the front face shows one representative.8 heads / groupAttention input. 8 query heads. Local layers use 1 key/value head of 256 values over a 512-token window. Global layers use 512-wide heads, also with 1 key/value head and their own value projection (keys are not reused as values). Global layers rotate only a quarter of each head. The last 20 layers compute no keys or values of their own.Earlier context is dimmed; outlined columns are current.Current token computation.Attention input1,536CLWq. 8 query heads. Local layers use 1 key/value head of 256 values over a 512-token window. Global layers use 512-wide heads, also with 1 key/value head and their own value projection (keys are not reused as values). Global layers rotate only a quarter of each head. The last 20 layers compute no keys or values of their own.Wq1,536256RMSNorm. 8 query heads. Local layers use 1 key/value head of 256 values over a 512-token window. Global layers use 512-wide heads, also with 1 key/value head and their own value projection (keys are not reused as values). Global layers rotate only a quarter of each head. The last 20 layers compute no keys or values of their own.RMSNormRoPE. 8 query heads. Local layers use 1 key/value head of 256 values over a 512-token window. Global layers use 512-wide heads, also with 1 key/value head and their own value projection (keys are not reused as values). Global layers rotate only a quarter of each head. The last 20 layers compute no keys or values of their own.RoPELocal layers (own keys and values)Earlier layerK cache. 8 query heads. Local layers use 1 key/value head of 256 values over a 512-token window. Global layers use 512-wide heads, also with 1 key/value head and their own value projection (keys are not reused as values). Global layers rotate only a quarter of each head. The last 20 layers compute no keys or values of their own.Earlier columns are cached; outlined columns are newly computed.Cached positions from earlier decoding steps.Current token computation.K cache256≤ 512V cache. 8 query heads. Local layers use 1 key/value head of 256 values over a 512-token window. Global layers use 512-wide heads, also with 1 key/value head and their own value projection (keys are not reused as values). Global layers rotate only a quarter of each head. The last 20 layers compute no keys or values of their own.Earlier columns are cached; outlined columns are newly computed.Cached positions from earlier decoding steps.Current token computation.V cache256≤ 512Q context. 8 query heads. Local layers use 1 key/value head of 256 values over a 512-token window. Global layers use 512-wide heads, also with 1 key/value head and their own value projection (keys are not reused as values). Global layers rotate only a quarter of each head. The last 20 layers compute no keys or values of their own.Earlier context is dimmed; outlined columns are current.Current token computation.Q context256CLScaled query–key scores, masking and softmax. 8 query heads. Local layers use 1 key/value head of 256 values over a 512-token window. Global layers use 512-wide heads, also with 1 key/value head and their own value projection (keys are not reused as values). Global layers rotate only a quarter of each head. The last 20 layers compute no keys or values of their own.8 query heads. Local layers use 1 key/value head of 256 values over a 512-token window. Global layers use 512-wide heads, also with 1 key/value head and their own value projection (keys are not reused as values). Global layers rotate only a quarter of each head. The last 20 layers compute no keys or values of their own.Window 512CLCL×. 8 query heads. Local layers use 1 key/value head of 256 values over a 512-token window. Global layers use 512-wide heads, also with 1 key/value head and their own value projection (keys are not reused as values). Global layers rotate only a quarter of each head. The last 20 layers compute no keys or values of their own.×Joined heads. 8 query heads. Local layers use 1 key/value head of 256 values over a 512-token window. Global layers use 512-wide heads, also with 1 key/value head and their own value projection (keys are not reused as values). Global layers rotate only a quarter of each head. The last 20 layers compute no keys or values of their own.8Wo. 8 query heads. Local layers use 1 key/value head of 256 values over a 512-token window. Global layers use 512-wide heads, also with 1 key/value head and their own value projection (keys are not reused as values). Global layers rotate only a quarter of each head. The last 20 layers compute no keys or values of their own.Wo2,0481,536Attention output. 8 query heads. Local layers use 1 key/value head of 256 values over a 512-token window. Global layers use 512-wide heads, also with 1 key/value head and their own value projection (keys are not reused as values). Global layers rotate only a quarter of each head. The last 20 layers compute no keys or values of their own.Earlier context is dimmed; outlined columns are current.Current token computation.Attention output1,536CL
Inside multi-query attention · Global layers (shared keys and values)
8 query heads per group × 1 K/V groups.

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

Gemma 4 E2B: Global layers (shared keys and values) · multi-query attention8 query heads. Local layers use 1 key/value head of 256 values over a 512-token window. Global layers use 512-wide heads, also with 1 key/value head and their own value projection (keys are not reused as values). Global layers rotate only a quarter of each head. The last 20 layers compute no keys or values of their own. Local layers: keys and values for 1 head of 256 values over the last 512 tokens. Global layers: 1 head of 512 values. Layers 16 to 35 hold no cache: they read the keys and values of layer 14 (local) and layer 15 (global), so only 15 layers keep one.1 KV groups; the front face shows one representative.1 KV groups8 heads / group; the front face shows one representative.8 heads / groupAttention input. 8 query heads. Local layers use 1 key/value head of 256 values over a 512-token window. Global layers use 512-wide heads, also with 1 key/value head and their own value projection (keys are not reused as values). Global layers rotate only a quarter of each head. The last 20 layers compute no keys or values of their own.Earlier context is dimmed; outlined columns are current.Current token computation.Attention input1,536CLWq. 8 query heads. Local layers use 1 key/value head of 256 values over a 512-token window. Global layers use 512-wide heads, also with 1 key/value head and their own value projection (keys are not reused as values). Global layers rotate only a quarter of each head. The last 20 layers compute no keys or values of their own.Wq1,536512RMSNorm. 8 query heads. Local layers use 1 key/value head of 256 values over a 512-token window. Global layers use 512-wide heads, also with 1 key/value head and their own value projection (keys are not reused as values). Global layers rotate only a quarter of each head. The last 20 layers compute no keys or values of their own.RMSNormRoPE 128. 8 query heads. Local layers use 1 key/value head of 256 values over a 512-token window. Global layers use 512-wide heads, also with 1 key/value head and their own value projection (keys are not reused as values). Global layers rotate only a quarter of each head. The last 20 layers compute no keys or values of their own.RoPE 128Global layers (own keys and values)Earlier layerK cache. 8 query heads. Local layers use 1 key/value head of 256 values over a 512-token window. Global layers use 512-wide heads, also with 1 key/value head and their own value projection (keys are not reused as values). Global layers rotate only a quarter of each head. The last 20 layers compute no keys or values of their own.Earlier columns are cached; outlined columns are newly computed.Cached positions from earlier decoding steps.Current token computation.K cache512CLV cache. 8 query heads. Local layers use 1 key/value head of 256 values over a 512-token window. Global layers use 512-wide heads, also with 1 key/value head and their own value projection (keys are not reused as values). Global layers rotate only a quarter of each head. The last 20 layers compute no keys or values of their own.Earlier columns are cached; outlined columns are newly computed.Cached positions from earlier decoding steps.Current token computation.V cache512CLQ context. 8 query heads. Local layers use 1 key/value head of 256 values over a 512-token window. Global layers use 512-wide heads, also with 1 key/value head and their own value projection (keys are not reused as values). Global layers rotate only a quarter of each head. The last 20 layers compute no keys or values of their own.Earlier context is dimmed; outlined columns are current.Current token computation.Q context512CLScaled query–key scores, masking and softmax. 8 query heads. Local layers use 1 key/value head of 256 values over a 512-token window. Global layers use 512-wide heads, also with 1 key/value head and their own value projection (keys are not reused as values). Global layers rotate only a quarter of each head. The last 20 layers compute no keys or values of their own.CLCL×. 8 query heads. Local layers use 1 key/value head of 256 values over a 512-token window. Global layers use 512-wide heads, also with 1 key/value head and their own value projection (keys are not reused as values). Global layers rotate only a quarter of each head. The last 20 layers compute no keys or values of their own.×Joined heads. 8 query heads. Local layers use 1 key/value head of 256 values over a 512-token window. Global layers use 512-wide heads, also with 1 key/value head and their own value projection (keys are not reused as values). Global layers rotate only a quarter of each head. The last 20 layers compute no keys or values of their own.8Wo. 8 query heads. Local layers use 1 key/value head of 256 values over a 512-token window. Global layers use 512-wide heads, also with 1 key/value head and their own value projection (keys are not reused as values). Global layers rotate only a quarter of each head. The last 20 layers compute no keys or values of their own.Wo4,0961,536Attention output. 8 query heads. Local layers use 1 key/value head of 256 values over a 512-token window. Global layers use 512-wide heads, also with 1 key/value head and their own value projection (keys are not reused as values). Global layers rotate only a quarter of each head. The last 20 layers compute no keys or values of their own.Earlier context is dimmed; outlined columns are current.Current token computation.Attention output1,536CL
Model-specific details
Local layers (own keys and values) · 12 repetitions
Sliding-window attention over 512 tokens, then a dense gated feed-forward network 6,144 wide.
Per-layer embedding
A 256-wide vector looked up per token for this layer, gated, projected and added after the feed-forward network.
Global layers (own keys and values) · 3 repetitions
Full attention over the context, then a dense gated feed-forward network 6,144 wide.
Per-layer embedding
A 256-wide vector looked up per token for this layer, gated, projected and added after the feed-forward network.
Local layers (shared keys and values) · 16 repetitions
Sliding-window attention over 512 tokens, then a dense gated feed-forward network 12,288 wide (double width). Keys and values come from an earlier layer; this layer computes none of its own.
Reuses keys and values of layer 14
Layers 16 to 35 compute no keys or values. They read those of the last earlier layer of the same type.
Per-layer embedding
A 256-wide vector looked up per token for this layer, gated, projected and added after the feed-forward network.
Global layers (shared keys and values) · 4 repetitions
Full attention over the context, then a dense gated feed-forward network 12,288 wide (double width). Keys and values come from an earlier layer; this layer computes none of its own.
Reuses keys and values of layer 15
Layers 16 to 35 compute no keys or values. They read those of the last earlier layer of the same type.
Per-layer embedding
A 256-wide vector looked up per token for this layer, gated, projected and added after the feed-forward network.
Attention and positions
8 query heads. Local layers use 1 key/value head of 256 values over a 512-token window. Global layers use 512-wide heads, also with 1 key/value head and their own value projection (keys are not reused as values). Global layers rotate only a quarter of each head. The last 20 layers compute no keys or values of their own.
Memory
Local layers: keys and values for 1 head of 256 values over the last 512 tokens. Global layers: 1 head of 512 values. Layers 16 to 35 hold no cache: they read the keys and values of layer 14 (local) and layer 15 (global), so only 15 layers keep one.

Shared caches in the small stack

The checkpoint has about 5.1B parameters including embeddings, 2.3B effective, and supports 131,072 tokens.

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 E2B8AA Index 4.3.2Best evaluated setting
AA Index distributionBest checkpoint per model variant among 97 scored variants in this atlas. Gemma 4 E2B scores 8; 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 E2B: 8. Distribution of 97 scored variants in this atlas, using each variant’s best checkpoint. Known estimates excluded.

Explore the components

Sources for this map