Gemma-4-31B

Google

Parameters

31.0B

Architecture

Dense Causal Transformer

Released

12.03.2026

License

Apache License 2.0

Open Weights Commercial Use Multimodal BF16 Gemma-4 en multi

Input Modalities

text image

Output Modalities

text

Context (native)

262,144 tokens

Context (extended)

262,144 tokens

Openness Index Score 100.0/100

About

Gemma-4-31B (google/gemma-4-31B) is the largest dense model of the Gemma 4 family of open models built by Google DeepMind - multimodal models handling text and image input (audio on the E2B/E4B/12B siblings) and generating text, with multilingual support in over 140 languages. The Gemma 4 release includes both pre-trained and instruction-tuned variants in five sizes (E2B, E4B, 12B, 26B A4B MoE, 31B), deployable from high-end phones to laptops and servers.

Its hybrid attention mechanism interleaves local Sliding-Window Attention (SWA) with full global attention (50 sliding layers with window 1024 and 10 global layers in the 31B; the final layer is always global), delivering the speed and low memory footprint of a lightweight model without sacrificing long-context awareness. To optimize long-context memory, global layers use unified Keys and Values (K=V, 4 global KV heads, head dim 512) and apply Proportional RoPE (p-RoPE) (theta 1M, partial rotary 0.25 on global layers; 10k on sliding). The 31B has 30.7B parameters, 60 layers, a 262,144-token context window, 262K vocabulary, and a ~550M vision encoder (27-layer ViT, 280 soft tokens per image, variable aspect ratio and resolution).

Gemma 4 introduces configurable thinking modes, native function calling for agentic workflows, native system role support, and enhanced coding capability. Pre-training data spans web documents, code, mathematics and images (cutoff January 2025) in over 140 languages, with CSAM and sensitive-data filtering. Smaller siblings use Per-Layer Embeddings (PLE) for parameter efficiency; the 12B "Unified" sibling is encoder-free. Released March 12, 2026 under Apache 2.0.

Training Data Pre-trained on a large-scale multimodal corpus (web documents, code, mathematics, images; 140+ languages; data cutoff January 2025) with CSAM and sensitive-data filtering. Instruction-tuned variants released separately.

Benchmark Scores

Benchmark Score Date Standing
Terminal-Bench 2.1 (Terminus-2)
coding_agent
31.12%
19.08.2026
#40/44
better than 7%
SWE-bench Verified
coding_agent
59.17%
19.08.2026
#46/60
better than 22%
SWE-bench Multilingual
coding_agent
55.27%
19.08.2026
#40/48
better than 15%
NL2Repo
coding_agent
8.00%
19.08.2026
#38/41
better than 5%
Humanity's Last Exam
stem_reasoning
32.95%
19.08.2026
#50/71
better than 29%
HLE (with tools)
stem_reasoning
22.46%
19.08.2026
#46/49
better than 6%
GPQA Diamond
stem_reasoning
81.09%
19.08.2026
#50/80
better than 34%
Toolathlon Verified
general_agent
25.95%
19.08.2026
#32/35
better than 9%
WideSearch
general_agent
37.18%
19.08.2026
#21/24
better than 13%
WildClawBench
coding_agent
64.71%
19.08.2026
#7/20
better than 68%

Hardware Requirements

Estimated VRAM per quantization at 4,096 tokens context

Quantization Weights KV Cache Total VRAM On your hardware
FP16 — 16-bit 62.0 GB 4.8 GB 69.9 GB Which GPUs can run it? Calculate on your GPU
INT8 — 8-bit 31.0 GB 2.4 GB 35.0 GB Which GPUs can run it? Calculate on your GPU
INT4 — 4-bit 15.5 GB 1.2 GB 17.5 GB Which GPUs can run it? Calculate on your GPU
FP4 — 4-bit 15.5 GB 1.2 GB 17.5 GB Which GPUs can run it? Calculate on your GPU

Only datacenter GPUs — FP16 needs 69.9 GB. For consumer hardware, choose the INT4 build with a multi-GPU setup.

Consumer GPUs that fit this model with a single card (INT4):

Architecture

Decoder Block ×60 input Embedding vocab 262K · d 5376 Sliding Window Attn Hybrid 32:16 · dₕ 256 · win 1024 ×50 Full Attention Hybrid 32:16 · dₕ 256 · win 1024 ×10 Dense FFN SwiGLU · d 22K Final RMSNorm LM Head tied with embedding output
Attention
Hybrid Attention (32:16)
Layers
60
Hidden size
5376
Context
262K tokens
Parameters
31000M

Source: Hugging Face config.json · Gemma4ForConditionalGeneration · exact layer pattern · model repo

Type: Dense hybrid-attention multimodal (Gemma 4): 50 SWA + 10 full-attention layers, final layer global
Attention: Interleaved local SWA (window 1024; 32 Q / 16 KV GQA) with full global attention (10 layers; unified K=V, 4 global KV heads, head dim 512); Proportional RoPE (p-RoPE) theta 1M partial 0.25 on global / 10k on sliding; final logit softcapping 30.0
Decoder: Dense decoder-only hybrid (SWA + full attention)

Training Pipeline

  1. 1
    pretraining

    Multimodal pre-training (cutoff January 2025)

    Web documents, code, mathematics and images in 140+ languages; CSAM and sensitive-data filtering; evaluation decontamination.

Training & Evaluation Datasets

NameRoleSizeModalitiesCollection
Web documents (140+ languages) pretraining — —
Code pretraining — —
Mathematics pretraining — —
Images pretraining — —

Comments (0)

No comments yet

Be the first to share your thoughts!

What now?

You have read the full card for Gemma-4-31B — here is where to go next.