# Gemma 4 (E4B)

> Larger Gemma 4 edge variant keeps the same multimodal hybrid recipe but doubles width and KV heads for a stronger 128K mobile checkpoint. Uses per-layer embeddings, which add small layer-specific token vectors without scaling the full compute path, so its compute footprint is closer to 4.5B than a full 8B dense model.

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

**Key detail:** Steps up to a 42-layer stack with 2 KV heads while keeping the same edge-oriented local/global template.

## Architecture concepts

- [Grouped-Query Attention (GQA)](https://llm-atlas-7or.pages.dev/concepts/gqa.md): Several query heads share one key/value head, shrinking the KV cache with little quality loss.
- [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 7.5 (Scientific 2.6)

## Links

- Architecture diagram: https://sebastianraschka.com/llm-architecture-gallery/images/architectures/gemma-4-e4b.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-E4B-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-e4b
- Web page: https://llm-atlas-7or.pages.dev/models/gemma-4-e4b/
- JSON: https://llm-atlas-7or.pages.dev/api/models/gemma-4-e4b.json

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