# Gemma 4 (31B)

> Dense Gemma 4 scales the family to a 256K-context multimodal checkpoint without changing the core local-global recipe much.

| Property | Value |
| --- | --- |
| Lab | Google (United States) |
| Released | 2026-04-02 |
| Decoder type | Dense |
| Family | Dense |
| Scale | 30.7B parameters |
| Context window | 256,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 | 50 sliding-window + 10 global |
| KV cache / token (bf16) | 840 KiB (Very high) |
| License | Apache License 2.0 |

**Key detail:** Carries Gemma's unusual pre/post-norm stack into a larger 31B dense model with 256K context.

## 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.
- [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.
- [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.

## Benchmark (Artificial Analysis Intelligence Index)

- AA Intelligence Index v4.3.2: total 13.9 (Scientific 5.9)

## Links

- Architecture diagram: https://sebastianraschka.com/llm-architecture-gallery/images/architectures/gemma-4-31b.webp
- View in article: https://magazine.sebastianraschka.com/p/the-big-llm-architecture-comparison#%C2%A723-gemma-4
- config.json: https://huggingface.co/google/gemma-4-31B-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-31b
- Web page: https://llm-atlas-7or.pages.dev/models/gemma-4-31b/
- JSON: https://llm-atlas-7or.pages.dev/api/models/gemma-4-31b.json

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