# Gemma 4 (E2B)

> Smallest Gemma 4 edge model keeps the family's hybrid attention stack and adds native audio on a phone-scale multimodal footprint. Uses per-layer embeddings, which add small layer-specific token vectors without scaling the full compute path, so its compute footprint is closer to 2.3B than a full 5.1B dense model.

| Property | Value |
| --- | --- |
| Lab | Google (United States) |
| Released | 2026-04-02 |
| Decoder type | Dense |
| Family | Dense |
| Scale | 5.1B parameters (2.3B effective) |
| Context window | 128,000 tokens |
| Attention | Multi-query attention with QK-Norm, unified K/V on global layers, p-RoPE on global layers, and 4:1 sliding-window/global attention |
| Layer mix | 28 sliding-window + 7 global |
| KV cache / token (bf16) | 35 KiB (Low) |
| License | Apache License 2.0 |

**Key detail:** Uses a double-wide GELU MLP plus a single KV head to stay light enough for offline edge deployments.

## Architecture concepts

- [QK-Norm (QK-Norm)](https://llm-atlas-7or.pages.dev/concepts/qk-norm.md): RMSNorm applied to queries and keys before attention to keep logits well-behaved.
- [Sliding Window Attention (SWA)](https://llm-atlas-7or.pages.dev/concepts/swa.md): Some layers only attend to a local window of recent tokens instead of the whole context.
- [Cross-Layer KV Sharing (KV sharing)](https://llm-atlas-7or.pages.dev/concepts/kv-sharing.md): Later layers reuse key/value states produced by earlier layers.
- [Per-Layer Embeddings (PLE)](https://llm-atlas-7or.pages.dev/concepts/per-layer-embeddings.md): Each layer gets its own token-specific embedding signal from a large lookup table.

## Benchmark (Artificial Analysis Intelligence Index)

- AA Intelligence Index v4.3.2: total 6.5 (Scientific 2.4)

## Links

- Architecture diagram: https://sebastianraschka.com/llm-architecture-gallery/images/architectures/gemma-4-e2b.webp
- View in article: https://magazine.sebastianraschka.com/p/recent-developments-in-llm-architectures#%C2%A71-reusing-kv-tensors-across-layers-to-shrink-the-cache-gemma-4
- From scratch: https://github.com/rasbt/LLMs-from-scratch/blob/main/ch05/17_gemma4/standalone-gemma4-plus-kvcache.ipynb
- config.json: https://huggingface.co/google/gemma-4-E2B-it/blob/main/config.json
- Tech report: https://ai.google.dev/gemma/docs/core/model_card_4
- Source card (source of truth): https://sebastianraschka.com/llm-architecture-gallery/#card-gemma-4-e2b
- Web page: https://llm-atlas-7or.pages.dev/models/gemma-4-e2b/
- JSON: https://llm-atlas-7or.pages.dev/api/models/gemma-4-e2b.json

_Data from Sebastian Raschka's LLM Architecture Gallery (https://sebastianraschka.com/llm-architecture-gallery/). Synced 2026-11-04._
