{
  "slug": "gemma-4-31b",
  "order": 35,
  "name": "Gemma 4 (31B)",
  "baseTitle": "Gemma 4 31B",
  "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": "50 sliding-window + 10 global",
  "scale": "30.7B parameters",
  "totalParams": 30700000000,
  "activeParams": 30700000000,
  "context": "256,000",
  "contextTokens": 256000,
  "license": "Apache License 2.0",
  "kvCacheText": "840 KiB",
  "kvCacheKiB": 840,
  "kvCacheLevel": "Very high",
  "summary": "Dense Gemma 4 scales the family to a 256K-context multimodal checkpoint without changing the core local-global recipe much.",
  "keyDetail": "Carries Gemma's unusual pre/post-norm stack into a larger 31B dense model with 256K context.",
  "image": {
    "full": "https://sebastianraschka.com/llm-architecture-gallery/images/architectures/gemma-4-31b.webp",
    "thumb": "https://sebastianraschka.com/llm-architecture-gallery/images/architectures/thumbnails/gemma-4-31b.webp",
    "alt": "Figure 58: Gemma 4 31B",
    "width": 918,
    "height": 960
  },
  "articleUrl": "https://magazine.sebastianraschka.com/p/the-big-llm-architecture-comparison#%C2%A723-gemma-4",
  "links": [
    {
      "label": "View in article",
      "href": "https://magazine.sebastianraschka.com/p/the-big-llm-architecture-comparison#%C2%A723-gemma-4",
      "title": null
    },
    {
      "label": "config.json",
      "href": "https://huggingface.co/google/gemma-4-31B-it/blob/main/config.json",
      "title": "google/gemma-4-31B-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": "gqa",
      "label": "GQA",
      "name": "Grouped-Query Attention",
      "url": "https://llm-atlas-7or.pages.dev/concepts/gqa/"
    },
    {
      "slug": "swa",
      "label": "SWA",
      "name": "Sliding Window Attention",
      "url": "https://llm-atlas-7or.pages.dev/concepts/swa/"
    }
  ],
  "aai": {
    "v4": {
      "label": "AA Intelligence Index v4.3.2",
      "total": 13.9,
      "profile": {
        "Scientific": 5.9
      },
      "url": "https://artificialanalysis.ai/models/gemma-4-31b-non-reasoning"
    }
  },
  "sourceUrl": "https://sebastianraschka.com/llm-architecture-gallery/#card-gemma-4-31b",
  "family": "dense",
  "url": "https://llm-atlas-7or.pages.dev/models/gemma-4-31b/",
  "markdownUrl": "https://llm-atlas-7or.pages.dev/models/gemma-4-31b.md"
}