{
  "slug": "gemma-4-e4b",
  "order": 59,
  "name": "Gemma 4 (E4B)",
  "baseTitle": "Gemma 4 E4B",
  "company": "Google",
  "country": "United States",
  "flag": "🇺🇸",
  "date": "2026-04-02",
  "decoderType": "Dense",
  "attention": "GQA with QK-Norm, unified K/V on global layers, p-RoPE on global layers, and 5:1 sliding-window/global attention",
  "layerMix": "35 sliding-window + 7 global",
  "scale": "8B parameters (4.5B effective)",
  "totalParams": 8000000000,
  "activeParams": 8000000000,
  "context": "128,000",
  "contextTokens": 128000,
  "license": "Apache License 2.0",
  "kvCacheText": "84 KiB",
  "kvCacheKiB": 84,
  "kvCacheLevel": "Moderate",
  "summary": "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.",
  "keyDetail": "Steps up to a 42-layer stack with 2 KV heads while keeping the same edge-oriented local/global template.",
  "image": {
    "full": "https://sebastianraschka.com/llm-architecture-gallery/images/architectures/gemma-4-e4b.webp",
    "thumb": "https://sebastianraschka.com/llm-architecture-gallery/images/architectures/thumbnails/gemma-4-e4b.webp",
    "alt": "Figure 2: Gemma 4 E4B",
    "width": 918,
    "height": 960
  },
  "articleUrl": "https://magazine.sebastianraschka.com/p/recent-developments-in-llm-architectures#%C2%A71-reusing-kv-tensors-across-layers-to-shrink-the-cache-gemma-4",
  "links": [
    {
      "label": "View in article",
      "href": "https://magazine.sebastianraschka.com/p/recent-developments-in-llm-architectures#%C2%A71-reusing-kv-tensors-across-layers-to-shrink-the-cache-gemma-4",
      "title": null
    },
    {
      "label": "From scratch",
      "href": "https://github.com/rasbt/LLMs-from-scratch/blob/main/ch05/17_gemma4/standalone-gemma4-plus-kvcache.ipynb",
      "title": null
    },
    {
      "label": "config.json",
      "href": "https://huggingface.co/google/gemma-4-E4B-it/blob/main/config.json",
      "title": "google/gemma-4-E4B-it"
    },
    {
      "label": "Tech report",
      "href": "https://ai.google.dev/gemma/docs/core/model_card_4",
      "title": null
    }
  ],
  "concepts": [
    {
      "slug": "gqa",
      "label": "GQA",
      "name": "Grouped-Query Attention",
      "url": "https://llm-atlas-7or.pages.dev/concepts/gqa/"
    },
    {
      "slug": "qk-norm",
      "label": "QK-Norm",
      "name": "QK-Norm",
      "url": "https://llm-atlas-7or.pages.dev/concepts/qk-norm/"
    },
    {
      "slug": "swa",
      "label": "SWA",
      "name": "Sliding Window Attention",
      "url": "https://llm-atlas-7or.pages.dev/concepts/swa/"
    },
    {
      "slug": "kv-sharing",
      "label": "KV Sharing",
      "name": "Cross-Layer KV Sharing",
      "url": "https://llm-atlas-7or.pages.dev/concepts/kv-sharing/"
    },
    {
      "slug": "per-layer-embeddings",
      "label": "PLE",
      "name": "Per-Layer Embeddings",
      "url": "https://llm-atlas-7or.pages.dev/concepts/per-layer-embeddings/"
    }
  ],
  "aai": {
    "v4": {
      "label": "AA Intelligence Index v4.3.2",
      "total": 7.5,
      "profile": {
        "Scientific": 2.6
      },
      "url": "https://artificialanalysis.ai/models/gemma-4-e4b-non-reasoning"
    }
  },
  "sourceUrl": "https://sebastianraschka.com/llm-architecture-gallery/#card-gemma-4-e4b",
  "family": "dense",
  "url": "https://llm-atlas-7or.pages.dev/models/gemma-4-e4b/",
  "markdownUrl": "https://llm-atlas-7or.pages.dev/models/gemma-4-e4b.md"
}