The Rabbit Hole / AI / Model architectures
Google DeepMind · Architecture mapGemma 3n
A model built to run on phones: per-layer embeddings and shared key/value caches shrink what must stay in fast memory.
Gemma 3n, 2025 · Gemma release timeline
Inside Gemma 3n
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) · 16 repetitions
- Sliding-window attention over 512 tokens, then a dense gated feed-forward network 8,192 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 8,192 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) · 8 repetitions
- Sliding-window attention over 512 tokens, then a dense gated feed-forward network 8,192 wide. Keys and values come from an earlier layer; this layer computes none of its own.
- Reuses keys and values of layer 19
- Layers 21 to 30 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) · 2 repetitions
- Full attention over the context, then a dense gated feed-forward network 8,192 wide. Keys and values come from an earlier layer; this layer computes none of its own.
- Reuses keys and values of layer 20
- Layers 21 to 30 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 share 2 key/value heads, each 256 wide. Every fifth layer is global; the others look back 512 tokens. The last 10 layers reuse key/value caches from earlier layers instead of computing their own.
- Memory
- 2 keys and 2 values of 256 values per token, only for the first 20 layers. The last 10 layers reuse them.
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) · 16 repetitions
- Sliding-window attention over 512 tokens, then a dense gated feed-forward network 16,384 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 16,384 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) · 12 repetitions
- Sliding-window attention over 512 tokens, then a dense gated feed-forward network 16,384 wide. Keys and values come from an earlier layer; this layer computes none of its own.
- Reuses keys and values of layer 19
- Layers 21 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) · 3 repetitions
- Full attention over the context, then a dense gated feed-forward network 16,384 wide. Keys and values come from an earlier layer; this layer computes none of its own.
- Reuses keys and values of layer 20
- Layers 21 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 share 2 key/value heads, each 256 wide. Every fifth layer is global; the others look back 512 tokens. The last 15 layers reuse key/value caches from earlier layers instead of computing their own.
- Memory
- 2 keys and 2 values of 256 values per token, only for the first 20 layers. The last 15 layers reuse them.
What changes between E2B and E4B
- E2B has 30 layers; E4B has 35. Both repeat four local layers followed by one global layer, with a 512-token local window.
- The final 10 layers in E2B and 15 in E4B reuse an earlier same-type layer’s keys and values.
- Per-layer token embeddings have 256 coordinates. The four-stream AltUp residual also includes a rank-64 LAuReL attention branch.
- Final logits are soft-capped at 30.
Both include vision and audio encoders and a 32,768-token input context. The effective parameter counts exclude embeddings that can be kept off the accelerator.
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 3n E2B InstructE2B | 5 | AA Index 4.3.2Published checkpoint |
| Gemma 3n E4B InstructE4B | 5 | AA Index 4.3.2Published checkpoint |
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
- Hyper-connections: more than one residual stream
- Per-layer embeddings (PLE): could each layer look up the token again?
- Sliding-window attention (SWA): a cache that stops growing
- Grouped-query attention (GQA): sharing keys and values in groups
- The KV cache: why LLMs remember every key and value
- Vision encoders: how can image patches join the text?
- KV sharing across layers: could later layers reuse an earlier cache?
- LAuReL: a small learned branch beside attentioncoming soonA small low-rank branch that runs beside attention and adds to its output.
- Audio inputs: how can a language model listen?
- Attention, from scratch
- RoPE: position as a rotation
- Transformer layers: attention is only half of what you need