{
  "slug": "gemma-4-e2b",
  "order": 58,
  "name": "Gemma 4 (E2B)",
  "baseTitle": "Gemma 4 E2B",
  "company": "Google",
  "country": "United States",
  "flag": "🇺🇸",
  "date": "2026-04-02",
  "decoderType": "Dense",
  "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",
  "layerMix": "28 sliding-window + 7 global",
  "scale": "5.1B parameters (2.3B effective)",
  "totalParams": 5100000000,
  "activeParams": 5100000000,
  "context": "128,000",
  "contextTokens": 128000,
  "license": "Apache License 2.0",
  "kvCacheText": "35 KiB",
  "kvCacheKiB": 35,
  "kvCacheLevel": "Low",
  "summary": "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.",
  "keyDetail": "Uses a double-wide GELU MLP plus a single KV head to stay light enough for offline edge deployments.",
  "image": {
    "full": "https://sebastianraschka.com/llm-architecture-gallery/images/architectures/gemma-4-e2b.webp",
    "thumb": "https://sebastianraschka.com/llm-architecture-gallery/images/architectures/thumbnails/gemma-4-e2b.webp",
    "alt": "Figure 2: Gemma 4 E2B",
    "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-E2B-it/blob/main/config.json",
      "title": "google/gemma-4-E2B-it"
    },
    {
      "label": "Tech report",
      "href": "https://ai.google.dev/gemma/docs/core/model_card_4",
      "title": null
    }
  ],
  "concepts": [
    {
      "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": 6.5,
      "profile": {
        "Scientific": 2.4
      },
      "url": "https://artificialanalysis.ai/models/gemma-4-e2b-non-reasoning"
    }
  },
  "sourceUrl": "https://sebastianraschka.com/llm-architecture-gallery/#card-gemma-4-e2b",
  "family": "dense",
  "url": "https://llm-atlas-7or.pages.dev/models/gemma-4-e2b/",
  "markdownUrl": "https://llm-atlas-7or.pages.dev/models/gemma-4-e2b.md"
}