← Open-Weight LLM Parts Atlas home

Gemma 4 31B

31B (dense) developers: Google (Gemma) published: 2026-03-11 Apache-2.0 · Commercial use OK ↗ max context: 256K KV(BF16): 40.0 KiB/tok multimodal (text backbone shown)

window 1,024 5 layers + Full attention 1 layers (K=V shared)

Sliding-window attention 5 layers with full attention 1 layer inserted, in that order, and the last layer is full attention. Only the full-attention layers have KV heads to 4 (reduced), K and V made identical, and position uses proportional RoPE (rotating only 25% of head dims, a partial RoPE).

Interactive structure diagram · simulator (open) →

layers60 = window 50 + full 10
d5,376
window1,024 token
AttentionQ 32 heads. Window layers: KV 16 heads · head 256 / full layers: KV 4 heads · head 512 · K=V
Positionwindow: RoPE (θ=10k) / full: Proportional RoPE (Partial RoPE variant · 25% rotated only, θ=1M)
FFNdense, intermediate 21,504
vocab262,144
context262,144
OtherLogit soft-capping 30
KV calculation basisfull 10 layers×1(K=V)×4 heads×512d×2B = 40.0 KiB (window 50 layers keep only the latest 1,024 tokens (capped) · no growth with long context)
Supported inferencevLLM / SGLang / llama.cpp / Transformers

Source:Hugging Face: google/gemma-4-31B-it