archdb

LLM architectures and pretraining recipes, with sources.

Gemma-4-26B-A4B

Google DeepMind · base checkpoint

Open in the comparison table Hugging Face ↗ Paper ↗

KV calculations use one sequence at 131,072 tokens and 16-bit cache elements. They include bounded sliding-window caches. This is retained cache payload, not peak prefill memory. The comparison table also offers sourced mixed-precision layouts, including quantization scales.

Release

Released

2026-04-02

Source: blog · Gemma 4 launch post header
Gemma 4: Byte for byte, the most capable open models Apr 02, 2026

Date the weights (or, if earlier, the technical report) were first made public, YYYY-MM-DD, as dated by the publisher. A Hugging Face repository creation date is used only when no dated publisher page exists, with a note.

License

apache-2.0

Source: model-card · README.md; YAML front matter
license: apache-2.0

License of the released weights as declared by the publisher (model card metadata or license file), e.g. apache-2.0, mit, or the name of a custom license.

Input modalities

text + image

Source: model-card · README.md; Mixture-of-Experts (MoE) Model table
| **Expert Count** | 8 active / 128 total and 1 shared | | **Supported Modalities** | Text, Image |

The card also lists video understanding as processing sequences of frames; audio is limited to E2B, E4B and 12B.

Input modalities of the released checkpoint as the publisher states them, from: text, image, video, audio, joined with ' + ' in that order ("text", "text + image + video").

Parameters

Total params

25.2B parameters

Source: model-card · README.md; Mixture-of-Experts (MoE) Model table
Total Parameters | 25.2B

Total parameter count as reported by the publisher. See params.note for whether embeddings, MTP heads or vision towers are included.

Active params

3.8B parameters

Source: model-card · README.md; Mixture-of-Experts (MoE) Model table
Active Parameters | 3.8B

Report text also says 3.8B; report Table 1 lists 2,800M active einsums plus a 740M embedder.

Parameters used per token in the forward pass, as reported by the publisher.

Active non-embedding (stated)

2.8B parameters

Source: paper · PDF page 2; Table 1
26B-A4B* - 550M 740M 24,500M / 2,800M (active) 430M

Active Einsums column; the tied 740M embedder is counted separately.

Active parameters excluding the input embedding and the output head (unembedding). Stated by the publisher, or computed from params.active by subtracting vocab × d_model for each of the embedding and output head that params.active is stated to include (basis inferred, note with the arithmetic). Not disclosed when the scope of params.active is not stated.

Counted total params

25.23B parameters

Calculated: embedding + output head + all experts + other weights, google/gemma-4-26B-A4B@24548b6 safetensors headers; reproduces stated total (backbone) and active (with embedding)

Parameters of the text backbone counted from the released checkpoint's safetensors headers (embedding, output head, all experts and other weights; excluding MTP modules, vision/audio towers and n-gram lookup tables). Shown only when the counts reproduce the publisher's stated total and active parameters within 5% under some scope.

Counted embedding + head

738.2M parameters

Calculated: input embedding + output head, google/gemma-4-26B-A4B@24548b6 safetensors headers

Input embedding plus output head (once if tied), counted from the checkpoint.

Non-emb. params (counted)

24.49B parameters

Calculated: dense + routed backbone weights; excludes input embedding, output head, lookup tables, MTP and other modalities, google/gemma-4-26B-A4B@24548b6 safetensors headers; reproduces stated total (backbone) and active (with embedding)

Language backbone weights excluding input embeddings, output head, lookup/Engram tables, MTP modules and vision/audio towers. Equals params.counted_total minus params.counted_embedding. Same validation as params.counted_total.

Largest layer (counted)

828.5M parameters

Calculated: max(sum of dense and routed weights sharing a full layers.<index> tensor path), all experts included, google/gemma-4-26B-A4B@24548b6 safetensors headers

Largest group of language-backbone weights sharing a full layers.<index> tensor path, including every routed expert. Excludes lookup/Engram tables, embeddings, output head, MTP and other modalities. Hybrid checkpoints may store mixers and FFNs as separate layers. All-gather volume also depends on wrapping, sharding and dtype.

Active non-emb. (counted)

3.084B parameters

Calculated: non-expert weights + routed experts × 8/128, excluding embedding and output head, google/gemma-4-26B-A4B@24548b6 safetensors headers; reproduces stated total (backbone) and active (with embedding)

Active parameters per token excluding the input embedding and output head, counted from the checkpoint as all non-expert weights plus routed-expert weights × top_k / experts. Same validation as params.counted_total.

Counting scope

Language model only (740M embedder + 24,500M einsums, 2,800M active einsums). Excludes the 550M frozen vision encoder and the 430M MTP drafter.

Source: paper · PDF page 2; Table 1
26B-A4B* - 550M 740M 24,500M / 2,800M (active) 430M

What the publisher's counts include or exclude (MTP modules, embeddings, vision encoder, n-gram tables).

Embedding params

740M parameters

Source: paper · PDF page 2; Table 1
26B-A4B* - 550M 740M 24,500M / 2,800M (active) 430M

Parameters in input embedding and output head, as reported.

Non-embedding params

24.5B parameters

Source: paper · PDF page 2; Table 1
26B-A4B* - 550M 740M 24,500M / 2,800M (active) 430M

Parameters excluding embedding and output head, as reported.

Shape

Layers

30

Source: config · /text_config/num_hidden_layers

Number of transformer blocks in the main backbone (attention or token mixer plus FFN), excluding MTP modules.

d_model

2,816

Source: config · /text_config/hidden_size

Residual stream width.

Vocab

262,144

Source: config · /text_config/vocab_size

Embedding table rows (vocab_size in config, may include padding).

Tied embeddings

Yes

Source: config · /text_config/tie_word_embeddings

Input embedding and output head share weights.

Tokenizer

SentencePiece, same as Gemini: split digits, preserved whitespace, byte-level encodings

Source: paper · PDF page 3; §2.4 Tokenizer
digits, preserved whitespace, and byte-level en

Tokenizer type and lineage as described by the publisher (e.g. byte-level BPE shared with an earlier model).

d_model / layers

93.8667

Calculated: d_model / layers

Width-to-depth ratio, d_model divided by the number of blocks.

Attention

Token mixers

GQA, SWA

Source: model-card · README.md; Models Overview
interleaves local sliding window attention with full global attention, ensuring the final layer is always global.

Global layers reuse keys as values (attention_k_eq_v: no v_proj; V is the K projection before RoPE and k_norm). use_bidirectional_attention vision: image tokens attend bidirectionally, text is causal.

Token-mixing layer types in the backbone, e.g. GQA, MLA, SWA, Gated DeltaNet, Mamba-2, DSA (DeepSeek sparse attention).

Layer layout

5 SWA : 1 global

Inferred from the source; see the explanation below.

Source: config · config.json; /text_config/layer_types
"layer_types": [ "sliding_attention", "sliding_attention", "sliding_attention", "sliding_attention", "sliding_attention", "full_attention", "sliding_attention", "sliding_attention", "sliding_attention", "sliding_attention", "sliding_attention", "full_attention", "sliding_attention", "sliding_attention", "sliding_attention", "sliding_attention", "sliding_attention", "full_attention", "sliding_attention", "sliding_attention", "sliding_attention", "sliding_attention", "sliding_attention", "full_attention", "sliding_attention", "sliding_attention", "sliding_attention", "sliding_attention", "sliding_attention", "full_attention" ]

Ordered 30-layer backbone from /text_config/layer_types; auxiliary modules are excluded.

Token-mixer order, summarized as a pattern or layer positions. The fact's optional sequence lists each mixer in order; a ratio alone does not establish the order. Auxiliary prediction modules and standalone FFNs are excluded.

Global-attention layers

5

Source: config · /text_config/layer_types | count full_attention

Layers whose KV cache grows with full context (dense or sparse global attention, MLA). Excludes sliding-window and linear/recurrent layers.

SWA : global

5

Calculated: attn.local_layers / attn.global_layers

attn.local_layers divided by attn.global_layers, the sliding-window to global interleave ratio (5 for '5 SWA : 1 global').

Sliding-window layers

25

Source: config · /text_config/layer_types | count sliding_attention

Layers with a fixed attention window.

Query heads

16

Source: config · /text_config/num_attention_heads

Query heads in the global-attention layers.

KV heads

2

Source: config · /text_config/num_global_key_value_heads

Key/value heads in the global-attention layers. Not applicable to MLA, whose cache is a shared latent.

Heads × head dim

8,192

Calculated: heads × head_dim

attn.heads × attn.head_dim, the query projection width of global layers.

Q heads / KV head

8

Calculated: heads / kv_heads

attn.heads divided by attn.kv_heads in global layers.

QK head dim

512

Source: config · /text_config/global_head_dim

Global layers only; sliding-window layers use head_dim 256.

Query/key dimension per head in global-attention layers (for MLA, nope + rope dims).

Window

1.024K tokens

Source: config · /text_config/sliding_window

Sliding-window size of the local layers.

SWA KV heads

8

Source: code · configuration_gemma4.py; Gemma4TextConfig.__post_init__
num_key_value_heads = num_global_key_value_heads if getattr(self, "attention_k_eq_v", True) else None

This override is applied only to full_attention layers, so sliding layers use /text_config/num_key_value_heads = 8.

KV heads in sliding-window layers (stated even when equal to attn.kv_heads).

SWA query heads

16

Source: config · /text_config/num_attention_heads

Same num_attention_heads attribute for both layer types (Gemma4TextAttention).

Query heads in sliding-window layers (stated even when equal to attn.heads).

SWA QK head dim

256

Source: config · /text_config/head_dim

configuration_gemma4.py overrides head_dim (global_head_dim) and num_key_value_heads (num_global_key_value_heads) only for full_attention layers; sliding layers keep head_dim, num_key_value_heads and num_attention_heads.

Query/key head dimension in sliding-window layers. Value head dimensions may differ; see attn.local_v_head_dim.

Positional encoding

partial RoPE (global, p-RoPE p=0.25), RoPE (SWA)

Source: paper · PDF page 2; §2 Long-context efficiency
with p-RoPE with p = 0.25 on global attention

Positional scheme in global layers: RoPE, partial RoPE, NoPE, or mixed per layer type.

RoPE base

1,000,000

Source: config · /text_config/rope_parameters/full_attention/rope_theta

RoPE base frequency of the global layers at release.

SWA RoPE base

10,000

Source: config · /text_config/rope_parameters/sliding_attention/rope_theta

rope_type default.

RoPE base frequency of the sliding-window layers (stated even when equal to attn.rope_theta).

Rotary fraction

0.25

Source: config · /text_config/rope_parameters/full_attention/partial_rotary_factor

Global layers use rope_type proportional (p-RoPE).

Fraction of each head's QK dimensions that are rotated.

QK norm

Yes

Source: paper · PDF page 2; §2
and QKNorm (Henry et al., 2020).

Queries and keys are normalized per head before the dot product.

Attention scaling

1.0 (no 1/sqrt(head_dim)); V RMS-normalized without learned scale

Source: code · modeling_gemma4.py; Gemma4TextAttention.__init__
self.num_key_value_groups = config.num_attention_heads // layer_config.num_key_value_heads self.scaling = 1.0

v_norm is Gemma4RMSNorm(head_dim, with_scale=False), applied in every attention layer.

Query-key scaling when it is not 1/sqrt(head_dim), e.g. query_pre_attn_scalar, length-dependent (SSMax-style) scaling, or value scaling.

QKV bias

No

Source: config · /text_config/attention_bias

Query/key/value projections have bias terms.

Feed-forward

Activation

GeGLU (tanh-approximate GELU)

Source: code · modeling_gemma4.py; Gemma4TextMLP.forward
down_proj = self.down_proj(self.act_fn(self.gate_proj(x)) * self.up_proj(x))

act_fn = ACT2FN[/text_config/hidden_activation] = gelu_pytorch_tanh.

FFN activation (SwiGLU, GeGLU, ...).

FFN bias

No

Source: code · modeling_gemma4.py; Gemma4TextMLP.__init__
self.gate_proj = nn.Linear(self.hidden_size, self.intermediate_size, bias=False)

FFN projections have bias terms.

Mixture of experts

Routed experts

128

Source: config · /text_config/num_experts

Routed experts per MoE layer.

Experts per token

8

Source: config · /text_config/top_k_experts

Routed experts selected per token.

Shared experts

1

Source: model-card · README.md; Mixture-of-Experts (MoE) Model table
Expert Count | 8 active / 128 total and 1 shared

Always-on experts per MoE layer.

Expert dim

704

Source: config · /text_config/moe_intermediate_size

Intermediate width of one routed expert.

Shared expert dim

2,112

Source: config · /text_config/intermediate_size

The shared expert is the layer's dense GeGLU MLP; its output and the routed-expert output each get their own post-RMSNorm and are summed.

Total intermediate width of the shared expert(s).

Leading dense layers

0

Source: code · modeling_gemma4.py; Gemma4TextDecoderLayer.__init__
self.enable_moe_block = config.enable_moe_block if self.enable_moe_block: self.router = Gemma4TextRouter(config)

enable_moe_block is a single model-wide flag (true in config.json), so every layer has the MoE block.

Number of initial blocks that use a dense FFN instead of MoE.

Router score

softmax

Source: code · modeling_gemma4.py; Gemma4TextRouter.forward
router_probabilities = nn.functional.softmax(expert_scores, dim=-1, dtype=torch.float32)

Router input is the residual stream entering the FFN sub-block, RMS-normalized without weight, times a learned vector and d_model^-0.5.

Gating function over expert logits (softmax, sigmoid).

Load balancing

Not disclosed

Load-balancing method, with coefficients where disclosed.

Renormalize top-k

Yes

Source: code · modeling_gemma4.py; Gemma4TextRouter.forward
top_k_weights /= top_k_weights.sum(dim=-1, keepdim=True)

A learned per-expert scale multiplies the renormalized weights.

Selected expert weights are renormalized to sum to 1.

Expert dim / d_model

0.25

Calculated: moe.expert_dim / d_model

moe.expert_dim divided by shape.d_model.

Sparsity (experts / top-k)

16

Calculated: experts / top_k

Routed experts divided by experts selected per token.

Active / total

0.150794

Calculated: params.active / params.total

params.active divided by params.total.

Multi-token prediction

MTP depth

Not disclosed

Additional future tokens predicted during pretraining (0 when the model was trained without MTP).

Normalization and stability

Norm

RMSNorm

Source: paper · PDF page 2; §2
with RMSNorm (Zhang and Sennrich, 2019),

Normalization layer type in the blocks.

Norm placement

sandwich

Source: paper · PDF page 2; §2
Our models have pre-norm and post-norm

Pre-norm, post-norm, or sandwich (pre and post).

Final logit softcap

30

Source: config · /text_config/final_logit_softcapping

tanh soft-capping value on output logits.

Norm epsilon

1e-06

Source: config · /text_config/rms_norm_eps

Epsilon of the block normalization layers.

Embedding scaling

× sqrt(d_model)

Source: code · modeling_gemma4.py; Gemma4TextModel.__init__
config.vocab_size, config.hidden_size, self.padding_idx, embed_scale=self.config.hidden_size**0.5

Scaling or normalization applied to input embeddings (e.g. × sqrt(d_model), RMSNorm after embedding).

Context length

Pretraining context

Not disclosed

Sequence length of the main pretraining stage.

Trained context

Not disclosed

Longest sequence length trained on after context extension.

Advertised context

262.1K tokens

Source: model-card · README.md; Mixture-of-Experts (MoE) Model table
Context Length | 256K tokens | Vocabulary Size

config max_position_embeddings is also 262144.

Longest context the publisher says the model supports, possibly beyond trained length via RoPE scaling.

Pretraining recipe

Pretraining tokens

Not disclosed

Tokens seen in pretraining including annealing and context extension, as reported.

Optimizer

Not disclosed

Optimizer used for the bulk of parameters.

Peak LR

Not disclosed

Peak learning rate of the main pretraining stage.

Final LR

Not disclosed

Learning rate at the end of the decay.

LR schedule

Not disclosed

Learning-rate schedule shape with phase boundaries.

Warmup

Not disclosed

Warmup length in steps or tokens.

Batch size

Not disclosed

Global batch size, including any batch-size ramp: sequences × sequence length (token total), or the token total alone when only that is stated.

Weight decay

Not disclosed

Decoupled weight decay coefficient.

Adam betas

Not disclosed

(beta1, beta2) of the Adam-family optimizer or its AdamW fallback.

Grad clip

Not disclosed

Global gradient-norm clipping threshold.

Training precision

Not disclosed

Matmul precision of pretraining (BF16, FP8 recipe, NVFP4 recipe) with the scaling granularity where disclosed. Never inferred from the released checkpoint dtype.

Data mix

Web documents (140+ languages), code, mathematics, images

Source: model-card · README.md; Training Dataset
The training dataset includes content in over 140 languages.

Pretraining data composition as disclosed (domain shares, synthetic fraction, repetition).

Data cutoff

January 2025

Source: paper · PDF page 3; §2.4 Training data
with a cutoff date of January 2025.

Pretraining data cutoff date.

Hardware

6,144 TPUv6e chips (16 data × 16 sequence × 24 replica)

Source: paper · PDF page 2; Table 2
26B-A4B* v6e 6,144 16 16 24

Accelerators used for pretraining, count and duration where stated.

Accelerators

6,144 TPU v6e

Source: paper · PDF page 2; Table 2
26B-A4B* v6e 6,144 16 16 24

Accelerator count and type for the main pretraining run, as the count with thousands separators and the chip's short name ("2,048 H800", "2,048 GH200"). A stated range or bound stays as stated ("2,048–4,096 GH200").

Parallelism

data16 · seq16 · replica24

Source: paper · PDF page 2; Table 2
26B-A4B* v6e 6,144 16 16 24

Table 2 sharding axes (data, sequence, replica) as named by the report, not mapped to TP/CP/DP; §2.7 adds ZeRO-3 optimizer-state sharding.

Parallelism layout of the main pretraining run as stated, as degree-annotated terms in the order TP, PP, VPP, EP, CP, DP ("PP16 · EP64 · ZeRO-1 DP"); a term without a stated degree has none ("FSDP").

KV cache

KV bytes / token

22,080 bytes

Calculated: kv.bytes_at_context / 131072 tokens; uniform BF16, payload only; quantization overhead excluded. Global KV: 5 × (2048 × 16/8) B/entry; SWA KV: 25 × (4096 × 16/8) B/entry

Retained KV cache divided by context length, including bounded SWA caches and indexer keys. Exports use uniform BF16 at 131,072 tokens. The website can select uniform payload precision (no quantization overhead) or sourced component formats (including scales and documented padding). This is cache payload, not peak prefill memory or persistent prefix storage.

Global KV bytes / token

20,480 bytes

Calculated: 20480 B / 1 tokens (Global KV); uniform BF16, payload only; quantization overhead excluded. Global KV: 5 × (2048 × 16/8) B/entry; SWA KV: 25 × (4096 × 16/8) B/entry

Long-context global KV bytes per token, including indexer keys; excludes bounded SWA caches. Compression rates and cross-layer cache reuse are included. Exports use uniform BF16; the website's storage selector also applies here. This is the field to compare with global-KV figures in reports, using the matching storage recipe.

KV bytes / token / B active

5,811 bytes

Calculated: kv.bytes_per_token (131072 tokens) / (params.active / 1e9); uniform BF16, payload only; quantization overhead excluded. Global KV: 5 × (2048 × 16/8) B/entry; SWA KV: 25 × (4096 × 16/8) B/entry

kv.bytes_per_token divided by active parameters in billions (131,072 tokens in exports).

KV at context / B active

761,597,305 bytes

Calculated: kv.bytes_at_context (131072 tokens) / (params.active / 1e9); uniform BF16, payload only; quantization overhead excluded. Global KV: 5 × (2048 × 16/8) B/entry; SWA KV: 25 × (4096 × 16/8) B/entry

kv.bytes_at_context divided by active parameters in billions (131,072 tokens in exports).

KV at context

2,894,069,760 bytes

Calculated: 20480 B × 131072 (Global KV) + 204800 B × min(131072, 1024) (SWA KV); uniform BF16, payload only; quantization overhead excluded. Global KV: 5 × (2048 × 16/8) B/entry; SWA KV: 25 × (4096 × 16/8) B/entry

Retained KV cache for one sequence at the selected context, including SWA windows and indexer keys. Exports use uniform BF16 at 131,072 tokens. Excludes recurrent state, compressor tail state, draft/MTP caches, temporary prefill tensors, allocator metadata and persistent prefix snapshots. Does not estimate peak prefill or total serving memory.

Evaluations

AA Intelligence Index

17

Source: leaderboard · Artificial Analysis model page /models/gemma-4-26b-a4b, Wayback snapshot 2026-10-19
Gemma 4 26B A4B (Reasoning) scores 17 on the Artificial Analysis Intelligence Index

Score of Gemma-4-26B-A4B-it, post-trained from this base. Variant: Gemma 4 26B A4B (Reasoning). Index v4.3.2.

Artificial Analysis Intelligence Index v4.3.2 of the post-trained model, from a dated Wayback snapshot of its Artificial Analysis page. The note names the variant (reasoning setting).

All models · Link to this model