The Rabbit Hole / AI / Model architectures
Google DeepMind · Architecture mapGemma 4 E4B
A Gemma 3 style local and global stack that adds wider global heads and shared keys and values, plus per-layer embeddings.
Gemma 4 E4B, April 2026 · Gemma release timeline
Inside Gemma 4 E4B
Inside grouped-query attention · Local layers (own keys and values)
Earlier context dimmed · current token bright · dashed regions contain cached entries.
Inside grouped-query attention · Global layers (own keys and values)
Earlier context dimmed · current token bright · dashed regions contain cached entries.
Inside grouped-query attention · Local layers (shared keys and values)
Earlier context dimmed · current token bright · dashed regions contain cached entries.
Inside grouped-query attention · Global layers (shared keys and values)
Earlier context dimmed · current token bright · dashed regions contain cached entries.
Model-specific details
- Local layers (own keys and values) · 20 repetitions
- Sliding-window attention over 512 tokens, then a dense gated feed-forward network 10,240 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) · 4 repetitions
- Full attention over the context, then a dense gated feed-forward network 10,240 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) · 15 repetitions
- Sliding-window attention over 512 tokens, then a dense gated feed-forward network 10,240 wide. Keys and values come from an earlier layer; this layer computes none of its own.
- Reuses keys and values of layer 23
- Layers 25 to 42 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) · 3 repetitions
- Full attention over the context, then a dense gated feed-forward network 10,240 wide. Keys and values come from an earlier layer; this layer computes none of its own.
- Reuses keys and values of layer 24
- Layers 25 to 42 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 2 key/value heads of 256 values over a 512-token window. Global layers use 512-wide heads, also with 2 key/value heads and their own value projection. Global layers rotate only a quarter of each head. The last 18 layers compute no keys or values of their own.
- Memory
- Local layers: keys and values for 2 heads of 256 values over the last 512 tokens. Global layers: 2 heads of 512 values. Layers 25 to 42 hold no cache: they read the keys and values of layer 23 (local) and layer 24 (global), so only 24 layers keep one.
What changes from E2B
E4B has 42 layers, with one global layer in every six. The final 18 layers reuse keys and values from layer 23 for local attention and layer 24 for global attention.
Eight query heads share two key/value heads: width 256 locally, 512 globally. Per-layer embeddings remain 256-wide, and final logits are capped at 30.
The checkpoint has about 8B parameters including embeddings, 4.5B 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 / size | Result | Evaluation |
|---|---|---|
| Gemma 4 E4B | 9 | AA Index 4.3.2Best evaluated setting |
Developer reported
| Checkpoint / size | Result | Evaluation |
|---|---|---|
| Gemma 4 E4B | 57.88% | GPQA Diamond Liquid LFM3 launch runLiquid AI BF16 run; temperature 0.6, top_p 0.95; full model context |
| Gemma 4 E4B | 0.5% | SWE-bench Verified Liquid LFM3 launch · OpenCodeLiquid AI OpenCode run; up to 250 turns |
| Gemma 4 E4B | 48.25% | BFCL 4 · Liquid LFM3 launchLiquid AI BF16 run; greedy, up to 32768 output tokens |
Explore the components
- Embeddings: giving every token a meaning
- Residual connections: when more layers made things worse
- A whole LLM, layer by layer
- RMSNorm: keeping a token's scale under control
- Grouped-query attention (GQA): sharing keys and values in groups
- Sliding-window attention (SWA): a cache that stops growing
- QK normalisation (QK-Norm) and soft-capping
- RoPE: position as a rotation
- Transformer layers: attention is only half of what you need
- Vision encoders: how can image patches join the text?
- Per-layer embeddings (PLE): could each layer look up the token again?
- The KV cache: why LLMs remember every key and value
- KV sharing across layers: could later layers reuse an earlier cache?
- Audio inputs: how can a language model listen?
- Attention, from scratch