Reference From the Gemma 4 technical report

Features &
Technical Capabilities

The implementation detail: attention layout, positional encoding, the encoder-free projections, MoE routing, the speculative-decoding drafter, and how quantisation-aware training gets a 2B model into 800 MB. Written as a spec sheet, not a pitch.

For what it does day to day, see capabilities & performance

At a glance
ArchitectureDecoder-only Transformer
NormalisationRMSNorm, pre + post, QKNorm
Vocabulary262,144 SentencePiece
AttentionLocal:global 5:1 (4:1 on E2B)
Positionalpp-RoPE p=0.25 on global
Data cutoffJanuary 2025
Trained on TPUv5p and TPUv6e ยท JAX, GSPMD, Pathways
Core design

The base transformer

Conventional in outline, with a handful of deliberate choices that show up later as memory savings.

๐Ÿงฑ

Decoder-only

A standard decoder-only Transformer stack. No encoder-decoder split, no recurrence - unlike RecurrentGemma, which used a Griffin architecture.

๐Ÿ“

Pre-norm and post-norm

RMSNorm applied both before and after each block, rather than one or the other. Combined with QKNorm on the attention queries and keys, this is what keeps training stable at scale.

๐Ÿ”ค

262,144-entry vocabulary

SentencePiece with split digits, preserved whitespace and byte-level fallback - so arbitrary bytes always encode, and numbers tokenise digit-by-digit rather than in arbitrary chunks.

๐Ÿ”ข
Split digits matter more than they sound. Tokenising 1234 as four separate digit tokens rather than one or two merged chunks gives the model a consistent positional view of numbers. It's a small vocabulary decision that shows up directly in arithmetic reliability - and Gemma 4 scores 89.2 on AIME. Preserved whitespace matters for the same reason in code, where indentation is semantic.
Attention & context

How 256K is made affordable

Long context is mostly a memory problem, not a modelling one. Three separate tricks attack it.

๐Ÿ”€

Interleaved local and global layers

5:1, or 4:1 on E2B

Most layers attend only within a local window; one in every five or six attends globally across the full sequence. Local layers cost far less memory per token, so the expensive global attention is paid for only where it's needed.

E2B uses a denser 4:1 ratio - proportionally more global layers - which helps a very small model retain coherence.

๐Ÿ“

pp-RoPE on global layers

p = 0.25

Global layers use pp-RoPE with p=0.25; local layers use standard RoPE. The base frequencies differ too - 1M for global layers and 10k for local ones, so each layer type is tuned for the range it actually attends over.

โ™ป๏ธ

Keys reused as values

โˆ’37.5% global KV cache

In the global attention layers, the key tensors are reused as values rather than storing both. That single change cuts the global KV cache footprint by 37.5% - the specific reason a 256K context is practical on hardware you can afford.

๐Ÿ—œ๏ธ

KV cache sharing across layers

Edge models

The edge models share KV cache between layers at fixed ratios - 20/35 on E2B and 18/42 on E4B. Fewer distinct caches means less memory held during generation, which is what lets E2B run in 676 MB on a phone GPU.

๐Ÿ’พ
These compound. Interleaving reduces how many layers need a global cache at all; reusing keys as values cuts each of those caches by more than a third; and cache sharing reduces the count again on edge models. None of it is exotic - it's three cheap engineering decisions that together turn a nominal 256K context into a usable one.
Encoders

How images and audio get in

This is where the family genuinely diverges. Three different approaches sit inside one model generation.

ModelVision pathAudio path
31B ยท 26B A4B 550M ViT encoderNo audio input
12B Unified 35M projection - no encoder Raw projection - no encoder
E4B ยท E2B 150M ViT encoder, patch size 16305M audio encoder
๐Ÿ–ผ๏ธ

The 12B's encoder-free vision

550M โ†’ 35M

Instead of a vision transformer, the 12B takes 48ร—48ร—3 RGB patches and pushes them through a single 35M-parameter projection with 2D positional embeddings. That replaces a 550M encoder with something roughly one-fifteenth the size.

This is the main reason the 12B approaches 26B quality on less than half the memory - a large fraction of the saving is simply not carrying a vision encoder.

๐ŸŽ™๏ธ

The 12B's encoder-free audio

No encoder at all

Audio bypasses encoding entirely. Raw 40 ms chunks at 16 kHz become 640-dimensional vectors projected directly into the same embedding space as text tokens. There is no intermediate audio representation.

Which is why the 12B posts the family's best transcription result - 0.063 average word error rate on FLEURS - despite not being the largest model.

๐ŸŽง
The edge models kept a real audio encoder, but halved it. E2B and E4B use a 305M encoder derived from the Universal Speech Model - two downsampling convolution layers followed by twelve Conformer layers, taking Mel filterbank inputs in 40 ms chunks. That's 55% smaller than the previous generation's 680M encoder, and it still improved transcription by 12โ€“17% over Gemma 3n.
Mixture of experts

The 26B A4B configuration

26B
Total parameters, all of which must be resident in memory. MoE saves bandwidth, not capacity.
3.8B
Activated per token - about 15% of the model. This is what makes it fast.
4.4ร—
Measured speedup over the dense 31B at concurrency 1, for roughly a two-to-three-point accuracy difference.
๐Ÿง 
The distinction people get wrong. "26B with 3.8B active" does not mean it behaves like a 3.8B model in memory. You still load all 26B - 57.7 GB at BF16, 14.4 GB at 4-bit. What you save is memory bandwidth: only a fraction of the weights are read per token, and single-stream decoding is bandwidth-bound. So it's a 26B-sized model that runs at roughly 4B-model speed.
Speculative decoding

The Multi-Token Prediction drafter

Not a separate draft model - a small head bolted onto the main one, which is what makes it practical to deploy.

โšก

Architecture

4 layers, cross-attending to the main model

The drafter is a 4-layer Transformer that cross-attends to the main model's KV cache, so it shares state rather than duplicating it. Model dimension is 256 on E2B and E4B, and 1024 on the 26B A4B and 31B.

Because it reads the target model's own keys and values, the drafts it proposes are well aligned with what the full model would produce - which is what keeps acceptance rates high.

๐Ÿ—œ๏ธ

The vocabulary projection trick

262k โ†’ 4,096

A naive drafter would need a dร—262,144 output projection - enormous relative to a 4-layer head. The efficient variant clusters the vocabulary and projects to dร—4,096 instead, roughly a 64ร— reduction in that layer.

Without this the drafter's own cost would eat much of the speedup it exists to deliver.

๐Ÿ“ˆ
What it buys. Measured on an H100 at concurrency 1: the dense 31B goes from 40.3 to 125.3 tokens/sec, a 3.11ร— speedup. The 26B MoE gains less - 177.1 to 264.2, or 1.49ร— - because it was already reading far fewer weights per token and had less bandwidth waste to reclaim. MTP checkpoints shipped on April 16, 2026 for E2B, E4B, 26B A4B and 31B.
Quantisation

Quantisation-aware training

Google trains the quantised models rather than compressing them afterwards, and the per-component detail is unusually granular.

ComponentPrecisionResult
Mobile weightsint2 / int4 weights, int8 activations Mixed per layer - text-only footprint down to ~0.8 GB on E2B
Q4_0 checkpointsBlockwise 4-bit The published GGUF format - 2.9 GB for E2B, 17.5 GB for 31B
Vision encoder 150MW8A8 2ร— smaller forward pass, 44% lower on-device latency
Audio encoder 305MW{2,4,8}/A8, varying by layer 390 MB โ†’ 87 MB on disk, a 78% reduction
๐ŸŽฏ
Why the official QAT checkpoints beat community quants. Post-hoc quantisation takes a model trained in BF16 and rounds the weights, so the model never learned to tolerate the error. Quantisation-aware training exposes the model to that rounding during training, letting it adapt. The per-layer mixed precision in the audio encoder - some layers at 2-bit, others at 8 - is the kind of tuning only achievable when quantisation is part of the training loop. If a Google -qat-q4_0-gguf repo exists for your model, use it.
Training

Infrastructure and data

๐Ÿ—๏ธ

Infrastructure

Google's own silicon and stack

Trained on TPUv5p and TPUv6e, with optimiser state sharded using a ZeRO-3 style implementation across 16 data shards. Multi-pod coordination uses the Pathways approach with single-controller JAX, the GSPMD partitioner and the MegaScale XLA compiler.

๐Ÿ“š

Pre-training data

Cutoff January 2025

Web documents, code, images and audio across a wide range of domains. Filtered for benchmark decontamination and for removal of personal information and other sensitive data.

The January 2025 cutoff is why AIME 2026 is a meaningful test - those problems postdate training, so contamination isn't a plausible explanation for the 89.2.

๐ŸŽ“
Post-training is where the generation gap came from. The instruction-tuning approach follows Gemma 3's, with the addition of thinking mode - reasoning traces emitted before the answer. Data is filtered for personal information, unsafe or toxic outputs, duplicated examples, and notably for mistaken self-identification data, so the model doesn't learn to claim it's a different assistant. Given the models are similar in size to Gemma 3, almost all of the jump from 20.8 to 89.2 on AIME comes from this stage rather than from scale.
Responsibility

Safety approach

Relevant if you're deploying this, because open weights mean the safety work is yours to extend.

๐Ÿ›ก๏ธ

Policy areas

Mitigations target child sexual abuse material and exploitation, dangerous content, sexually explicit content, hate speech and harassment.

๐Ÿงน

Data filtering

Training data is filtered to remove personal information and other sensitive data, alongside benchmark decontamination.

๐Ÿ“‹

Evaluation and governance

Automated and human evaluations run without safety filters in place, so the underlying model behaviour is measured rather than the filtered output. Governed under Google's Frontier Safety Framework.

โš ๏ธ
Open weights shift responsibility to you. A model you download has no server-side moderation between it and your users - whatever safety behaviour is baked into the weights is what you get, and fine-tuning can erode it. If you're deploying to end users, add your own input and output filtering. ShieldGemma 2 exists for exactly this and runs alongside the model as a classifier, though note it's still on the older Gemma Terms licence rather than Apache 2.0.
Reference

Complete technical specification

Everything published, in one table. Blank cells mean the figure isn't in the technical report - not that the value is zero.

Specification31B26B A4B12B E4BE2B
Total parameters31B26B 11.95B4.5B2.3B
Active per token31B3.8B 11.95B4.5B2.3B
ArchitectureDenseMoE UnifiedDenseDense
Context window256K256K 256K128K128K
Local:global attention5:15:1 5:15:14:1
Global positionalpp-RoPE, p = 0.25, base 1M
Local positionalStandard RoPE, base 10k
KV cache sharing-- -18/4220/35
Global KV reduction37.5% - keys reused as values
Vocabulary262,144 ยท SentencePiece, split digits, byte fallback
NormalisationRMSNorm pre + post, QKNorm
Vision encoder550M ViT550M ViT 35M proj.150M ViT150M ViT
Audio encoder-- none, raw305M305M
Audio chunk-- 40 ms @ 16 kHz40 ms40 ms
MTP drafter dim10241024 -256256
MTP drafter layers44 -44
Memory ยท BF1669.9 GB57.7 GB 26.7 GB17.9 GB11.4 GB
Memory ยท Q4_017.5 GB14.4 GB 6.7 GB4.5 GB2.9 GB
Mobile build-- -2.5 GB1.1 GB
LicenceApache 2.0
Data cutoffJanuary 2025
FAQ

Technical questions

What is pp-RoPE and why p = 0.25?

It's a variant of rotary positional embedding applied only to the global attention layers, with the local layers keeping standard RoPE. The base frequencies differ as well - 1M for global, 10k for local - so each layer type is tuned to the range it actually attends across. Google reports the configuration and the resulting KV cache reduction; the report doesn't derive why 0.25 specifically is optimal.

How does reusing keys as values actually save memory?

Normally each attention layer caches separate key and value tensors for every token. In Gemma 4's global layers the key tensor serves as the value too, so only one is stored instead of two. That's the 37.5% reduction in global KV cache - and since the KV cache, not the weights, is what grows with context length, it's the change that makes 256K affordable.

Is the 12B genuinely encoder-free, or is the projection just a small encoder?

Fair question, and the answer differs by modality. For vision there is still a learned projection - 35M parameters taking 48ร—48ร—3 patches with 2D positional embeddings - so it's better described as radically smaller rather than absent. That's still a fifteen-fold reduction from the 550M ViT.

For audio it's more literal: raw 40 ms chunks at 16 kHz become 640-dimensional vectors projected straight into the text embedding space, with no encoder stage at all.

Why does the MoE need all 26B in memory if only 3.8B activate?

Because routing is per token and unpredictable - any expert may be needed for the next token, so all of them must be resident. What you save is memory bandwidth, since only the selected experts are read for each token. Single-stream decoding is bandwidth-bound, which is why the saving translates into a 4.4ร— speedup despite the full model occupying 57.7 GB at BF16.

What's the 262k โ†’ 4,096 clustering in the MTP drafter?

A four-layer drafter would otherwise need an output projection of dimension ร— 262,144 to cover the full vocabulary - a layer far larger than the drafter itself. The efficient variant clusters the vocabulary so the projection targets 4,096 entries instead, roughly a 64ร— reduction. Without it, the drafter's own compute would consume much of the speedup it exists to provide.

How many layers do the models have?

The technical report gives the attention ratios, cache sharing ratios and drafter dimensions, but doesn't publish per-model layer counts or hidden dimensions in the material available here. The config files in each Hugging Face repository carry the exact values - check config.json rather than trusting a secondary source.

Does fine-tuning break the safety training?

It can. Safety behaviour lives in the weights, and further training on unfiltered data will erode it - this is a well-documented property of open models generally, not a Gemma-specific flaw. If you fine-tune and deploy to end users, re-evaluate safety behaviour afterwards and add independent input and output filtering rather than relying on the base model's training.

Specs are one view.

See how these design choices show up as behaviour, throughput and benchmark scores.