Gemma 4 31B vs Gemma 4 26B A4B: Dense 31B vs Sparse 26B-A4B MoE on 16 GB, 24 GB & Unified Memory

Key facts

Gemma 4 26B A4B fits a 16 GB graphics card at a smaller file. Dense Gemma 4 31B needs a 24 GB card at the usual quality. Speeds are our estimate.

Updated . Checked . watch on YouTube.

GUIDE · MODEL COMPARISON · UPDATED 28 OCT 2026

Google's two flagship Apache-2.0 open-weight Gemma 4 releases share a 262,144-token context window and multimodal text + image input—but one activates all 31.27B parameters on every token while the other activates just 3.8B of 25.2B parameters across 128 experts. Here is how their measured GGUF files, KV cache math, 16 GB vs 24 GB GPU fit, and unified-memory token speeds compare—plus how to test both side by side for free in your browser before downloading 17–21 GB.

Quick verdict: which Gemma 4 model should you run locally?

  • Pick Gemma 4 26B A4B (25.2B total, 3.8B active per token across 128 experts) if you have a 16 GB GPU (15.4 GB usable — fits 4-bit UD-IQ4_XS at 14.8 GB total on an RX 9060 XT 16GB at €564 / $522, RTX 4060 Ti 16GB at €899 / $832, or RTX 5080 16GB at €1,358 / $1,256), if you want 5-bit quality (UD-Q5_K_M, 22.3 GB total) on a single 24 GB GPU (RTX 3090 €1,246 / $1,395), if you run on unified memory (Mac mini M4/M6, Mac Studio, or AMD Ryzen AI Max+ 395 Strix Halo, where reading only 3.8B active parameters per token instead of 31.27B yields 2–3× faster token generation), or if you use llama.cpp --n-cpu-moe expert offloading on an 8 GB–12 GB GPU + 32 GB system RAM PC.
  • Pick Gemma 4 31B (31.27B dense, 100% active on every token) if you already own a 24 GB GPU (23.4 GB usable — fits standard Q4_K_M at 20.63 GB / 20.6 GB total at ~37 tok/s on a used GeForce RTX 3090 24GB or ~39 tok/s on a used RTX 4090 24GB, our estimate) or a 36 GB–128 GB Mac Studio / Strix Halo box and want maximum single-pass dense reasoning depth on hard logic, coding, and trick-question prompts (where dense Gemma 4 31B solved our modified €1.10 bat-and-ball live test while ChatGPT and Claude missed it).

Test both free in your browser before downloading 17–21 GB. Both Gemma 4 31B (google/gemma-4-31b-it:free) and Gemma 4 26B A4B (google/gemma-4-26b-a4b-it:free) are live in the free side-by-side playground on localllmrig.com. Tick both checkboxes, enter your hardest coding or reasoning prompt, and compare their exact answers in your browser ($0, no login, no GPU required).

Architecture: dense 31.27B vs sparse 25.2B (3.8B active)

Both models are on the free playground: Gemma 4 31B (gemma-4-31b, google/gemma-4-31b-it:free) and Gemma 4 26B A4B (gemma-4-26b-a4b, google/gemma-4-26b-a4b-it:free), and both can be tested side by side on localllmrig.com.

Dense Gemma 4 31B against sparse Gemma 4 26B A4B. File sizes are measured downloads. Conversation memory is our estimate.
SpecificationGemma 4 31B (dense)Gemma 4 26B A4B (mixture of experts)Why it matters locally
Total parameters31.27B (model card estimate; 31B class)25.2B (model card estimate; 26B class)26B A4B stores about 19% fewer total parameters in memory
Active parameters per token31.27B (100% dense)3.8B (about 15% active across 128 routed experts)26B A4B reads about 8× fewer weight bytes per generated token, which speeds up bandwidth-bound unified memory and CPU-offloaded MoE setups
Layers and attention split60 layers: 50 sliding-window (1,024 tokens, 16 KV heads × 256 dim) + 10 full-attention (4 KV heads × 512 dim)30 layers: 25 sliding-window (1,024 tokens, 8 KV heads × 256 dim) + 5 full-attention (2 KV heads × 512 dim)Half as many layers and half the KV heads per layer means 26B A4B uses 4× less KV cache (0.38 GB vs 1.51 GB at 8,192 tokens)
Max context window262,144 tokens (about 393 pages)262,144 tokens (about 393 pages)Identical 256K max context. 26B A4B uses far less RAM at 32K–262K context
Conversation memory at 8,192 tokens1.51 GB (1.5 GB rounded, FP16 est.)0.38 GB (0.4 GB rounded, FP16 est.)Saves 1.13 GB of VRAM at 8K context alone (about 2.64 GB saved at 32K context)
Conversation memory at 32,768 / 262,144 tokens3.52 GB at 32K, 22.31 GB at 262Kabout 0.88 GB at 32K, about 5.58 GB at 262KAt 32K context with 4-bit weights, 31B hits 22.64 GB (barely inside 23.4 GB usable on 24 GB), while 26B A4B stays at about 18.63 GB
Modalities and vision projectorText + image in, text out (mmproj separate)Text + image in, text out (about 1.19 GB BF16 vision projector separate)Text-only GGUF runs omit the vision projector. Add about 1.2 GB if you run local image prompts
LicenceApache-2.0Apache-2.0Both allow commercial and private self-hosting

Context VRAM Scaling Table (8K / 32K / 128K / 256K)

Context VRAM Scaling Table (8K / 32K / 128K / 256K). Each total is the measured Q4 file, plus conversation memory, plus 0.80 GB of working space. Conversation memory and the totals are our estimate.
ContextGemma 4 31B (Q4_K_M)Gemma 4 26B A4B (UD-Q4_K_M)
8K (8,192 tokens)1.51 GB conversation memory, 20.63 GB total0.38 GB conversation memory, 18.13 GB total
32K (32,768 tokens)3.52 GB conversation memory, 22.64 GB total0.88 GB conversation memory, 18.63 GB total
128K (131,072 tokens)11.58 GB conversation memory, 30.70 GB total2.89 GB conversation memory, 20.64 GB total
256K (262,144 tokens)22.31 GB conversation memory, 41.43 GB total5.58 GB conversation memory, 23.33 GB total

Quantization and VRAM fit at 8,192 tokens

Every file size below is a measured GGUF download from unsloth/gemma-4-31B-it-GGUF (checked 21 Oct 2026) and unsloth/gemma-4-26B-A4B-it-GGUF (checked 24 Oct 2026), plus our 8,192-token FP16 conversation memory (1.51 GB for 31B, 0.38 GB for 26B A4B) and 0.80 GB runtime working space. Totals are our estimate.

Measured GGUF file plus 8,192-token conversation memory plus 0.80 GB working space. The total is our estimate.
Quality tierGemma 4 31B totalGemma 4 26B A4B totalWhich GPU or Mac fits
2-bit (UD-IQ2_XXS)8.53 GB + 1.51 + 0.80 = 10.84 GB (10.8 GB)9.92 GB + 0.38 + 0.80 = 11.10 GB (11.1 GB)Both fit 12 GB VRAM (11.4 GB usable), for example a used GeForce RTX 3060 12GB (€261 / $292, 24 Oct 2026). Extreme compression; use for testing only.
3-bit compact (UD-IQ3_XXS / UD-Q3_K_XL)UD-IQ3_XXS: 11.84 GB + 1.51 + 0.80 = 14.15 GB (14.1 GB)UD-Q3_K_XL: 12.91 GB + 0.38 + 0.80 = 14.09 GB (14.1 GB)Both fit 16 GB VRAM (15.4 GB usable), for example a new Radeon RX 9060 XT 16GB (€564 / $522, 17 Oct 2026) or RTX 4060 Ti 16GB (€899 / $832, 16 Oct 2026).
3-bit standard (Q3_K_M)14.74 GB + 1.51 + 0.80 = 17.05 GB (17.0 GB). Misses 16 GB.Use 4-bit UD-IQ4_XS at 14.8 GB instead.31B Q3_K_M overflows 15.4 GB usable on 16 GB cards by 1.65 GB and requires a 24 GB GPU.
4-bit compact (IQ4_XS / UD-IQ4_XS), 16 GB sweet spotIQ4_XS: 16.37 GB + 1.51 + 0.80 = 18.68 GB (18.7 GB). Misses 16 GB.UD-IQ4_XS: 13.60 GB + 0.38 + 0.80 = 14.78 GB (14.8 GB). Fits 16 GB.Key 16 GB separator: Gemma 4 26B A4B fits a 16 GB GPU at 4-bit (UD-IQ4_XS, 14.8 GB vs 15.4 GB usable), whereas Gemma 4 31B (18.7 GB) overflows 16 GB by 3.3 GB and needs 24 GB.
4-bit legacy (Q4_0)17.99 GB + 1.51 + 0.80 = 20.30 GB (20.3 GB)14.62 GB + 0.38 + 0.80 = 15.80 GB (15.8 GB)Both exceed 15.4 GB usable on a 16 GB discrete GPU (26B A4B by 0.4 GB). Both fit a 24 GB GPU (23.4 GB usable).
4-bit standard (Q4_K_M / UD-Q4_K_M), default tierQ4_K_M: 18.32 GB + 1.51 + 0.80 = 20.63 GB (20.6 GB)UD-Q4_K_M: 16.95 GB + 0.38 + 0.80 = 18.13 GB (18.1 GB)Both fit 24 GB VRAM (23.4 GB usable): used GeForce RTX 3090 24GB (€1,246 / $1,395), Radeon RX 7900 XTX 24GB (€1,254 / $1,404), RTX 4090 24GB (€2,185 / $2,446), and Mac mini M6 32GB (21.3 GB usable, €1,530 / $1,416 unverified). 26B A4B leaves 5.27 GB free on 24 GB vs 2.77 GB for 31B.
5-bit (Q5_K_M / UD-Q5_K_M), 24 GB sweet spotQ5_K_M: 21.66 GB + 1.51 + 0.80 = 23.97 GB (24.0 GB). 24.51 GB formula; misses 24 GB.UD-Q5_K_M: 21.15 GB + 0.38 + 0.80 = 22.33 GB (22.3 GB). 19.07 GB formula; fits 24 GB.Key 24 GB separator: Gemma 4 26B A4B fits UD-Q5_K_M (22.3 GB) on a single 24 GB GPU (23.4 GB usable), while Gemma 4 31B Q5_K_M (24.0 GB) is 0.6 GB over 23.4 GB usable and requires 32 GB VRAM or a 64 GB Mac.
6-bit (Q6_K / UD-Q6_K_XL)Q6_K: 25.20 GB + 1.51 + 0.80 = 27.51 GB (27.5 GB)UD-Q6_K_XL: 23.30 GB + 0.38 + 0.80 = 24.48 GB (24.5 GB)26B A4B UD-Q6_K_XL (24.5 GB) fits a 36 GB Mac Studio (27.0 GB usable, M4 Max 36GB €1,890 / $2,116 unverified or M5 Max 36GB €3,029 / $2,802), whereas 31B Q6_K (27.5 GB) overflows 27.0 GB and needs 32 GB VRAM (31.4 GB usable) or a 64 GB Mac.
8-bit (Q8_0), 32 GB sweet spot32.64 GB + 1.51 + 0.80 = 34.95 GB (34.9 GB measured / 35.77 GB formula). Misses 32 GB.26.86 GB + 0.38 + 0.80 = 28.04 GB (28.0 GB measured / 28.14 GB formula). Fits 32 GB.Key 32 GB separator: Gemma 4 26B A4B Q8_0 (28.0 GB) fits inside a 32 GB GPU (31.4 GB usable, RTX 5090 32GB €7,367 / $6,816 or Intel Arc Pro B70 32GB), whereas Gemma 4 31B Q8_0 (34.9 GB) requires 48 GB VRAM or 64 GB unified memory (Mac mini M4 Pro 64GB €1,890 / $2,116).
16-bit (BF16 / FP16)61.41 GB + 1.51 + 0.80 = 63.72 GB (63.7 GB measured / 64.85 GB formula)50.51 GB + 0.38 + 0.80 = 51.69 GB (51.7 GB measured / 51.58 GB formula)Both require 96 GB (72.0 GB usable on Mac Studio Ultra) or 128 GB unified memory (96.0 GB usable on Mac Studio M4 Max 128GB €3,290 / $3,683 or GMKtec EVO-X2 128GB €3,800 / $3,516).

Hardware scenarios: 16 GB GPUs, MoE offload, unified memory, and 24 GB dense reasoning

Why Gemma 4 26B A4B is the Gemma 4 choice on 16 GB GPUs and 8–12 GB + 32 GB RAM PCs

A 16 GB discrete graphics card reserves 0.60 GB for the display and driver, leaving 15.4 GB usable. Dense Gemma 4 31B cannot fit any 4-bit quantization (Q4_K_M 20.6 GB, Q4_0 20.3 GB, IQ4_XS 18.7 GB) or even standard 3-bit Q3_K_M (17.0 GB) inside 15.4 GB. It has to drop to UD-IQ3_XXS (11.84 GB file, 14.1 GB total). Gemma 4 26B A4B fits its measured 4-bit UD-IQ4_XS (13.60 GB file + 0.38 GB KV cache + 0.80 GB overhead = 14.78 GB / 14.8 GB total) inside 15.4 GB on a Radeon RX 9060 XT 16GB (€564 / $522 new, 17 Oct 2026, Gemma 4 26B A4B on RX 9060 XT 16GB), GeForce RTX 4060 Ti 16GB (€899 / $832 new, 16 Oct 2026, Gemma 4 26B A4B on RTX 4060 Ti 16GB), or GeForce RTX 5080 16GB (€1,358 / $1,256 new, 21 Oct 2026, Gemma 4 26B A4B on RTX 5080 16GB).

If you have an 8 GB or 12 GB GPU, such as a used GeForce RTX 3060 12GB at €261 / $292, paired with 32 GB of DDR4/DDR5 system RAM, offloading a dense 31B model (18.32 GB at Q4_K_M) to CPU RAM forces the CPU to read the offloaded dense layers on every token, collapsing generation to about 2–4 tok/s. With Gemma 4 26B A4B, passing --n-cpu-moe (or -ot ".ffn_.*_exps.=CPU") in llama.cpp keeps shared attention weights and the 0.38 GB KV cache in GPU VRAM while offloading routed expert tensors to system RAM. Each token only activates 3.8B parameters (about 2.3 GB of active 4-bit weights) instead of 25.2B (16.95 GB), so system RAM bandwidth streams a fraction of the model per token.

Unified memory: why 3.8B active parameters changes the speed

Local token generation is memory-bandwidth bound: every generated token must stream the active weights from memory into the compute units. On Gemma 4 31B (Q4_K_M, 18.32 GB weights read on every token), our bandwidth formula estimates these speeds. Every figure below is our estimate.

On Gemma 4 26B A4B (UD-Q4_K_M, 16.95 GB total file stored in memory, but only 3.8B active parameters / about 2.3 GB read per token), our automated calculator currently labels speed as "Speed not estimated" because the speed estimate does not yet apply an MoE active-parameter multiplier. In practice, because each token reads roughly 1/8th as many weight bytes as dense 31B (with router and gather overhead), Gemma 4 26B A4B generates tokens 2–3× faster on 170–546 GB/s unified memory Macs and Strix Halo mini PCs, turning a sluggish 4–6 tok/s Mac mini run into an interactive coding and chat assistant. That comparison is our estimate, not a lab benchmark.

Builder rig, self-reported 26 Oct 2026, not a measurement by this site: Roshan George's RTX A6000 48 GB vLLM interview. On a shared AMD EPYC 7402P + NVIDIA RTX A6000 48 GB (250 W power cap, about 35 GB free for vLLM alongside NVR video decoding and speech services), Roshan George (@arjie) runs a fine-tuned Gemma 4 26B A4B quantized to GPTQ W4A16 (group size 64) via Marlin INT4 kernels as a fast single-forward-pass logprob decision model. On Ampere (sm_86) he notes that INT4 Marlin outperforms emulated weight-only FP8. For unified-memory Strix Halo and Apple Silicon setups, see also @c4software's dual 128 GB Strix Halo boxes, Valérian de Thézan de Gaussan's Framework Desktop 128 GB benchmark (gemma-4-31B-it-Q4_K_M, 17.07 GiB, 359.99 ± 1.082 tokens per second prefill and 11.27 ± 0.002 tokens per second decode on llama.cpp Vulkan, 28 Oct 2026, self-reported, not a measurement by this site), OscarJHernandez's GMKtec EVO-X2 128 GB benchmark lab, Danila Sukharev's 36 GB MacBook Pro M3 Pro, and Xijing (Thomas) Wang's MacBook Pro M5 Max 128 GB.

When dense Gemma 4 31B wins: 24 GB GPUs and deep multi-step reasoning

On a dedicated 24 GB discrete GPU (936–1,008 GB/s memory bandwidth), dense Gemma 4 31B at Q4_K_M (20.63 GB total) is already fast. Every speed below is our estimate.

The extra 2.50 GB of VRAM (20.63 GB vs 18.13 GB) buys a pass through all 31.27B parameters across 60 layers (10 global + 50 sliding-window) rather than 3.8B active parameters across 30 layers. On adversarial logic, multi-constraint coding, and modified trick questions, that 8× higher per-token active parameter density reduces pattern-matching shortcuts. In our 24-second live 8-LLM browser test (watch on YouTube), dense Gemma 4 31B solved the modified €1.10 bat-and-ball trick prompt while both ChatGPT and Claude fell for the classic $0.05 training-data reflex. See Compare Claude and GPT LLMs with Local LLMs and Qwen3.8-27B vs Gemma 4 31B.

Watch on YouTube ↗

Watch: 8 open LLMs vs 1 trick question (24s real-time screen recording)

Unedited recording of the free multi-model playground on localLLMrig.com running Gemma 4 31B, NVIDIA Nemotron 3.5 Lightning, Recursive Flint, and Gemma 4 26B A4B side by side on the classic €1.10 bat-and-ball question — then showing the cheapest Mac mini or GPU that runs the winner locally. Watch on YouTube (@localllmrig) ↗

Related pages

Model fit pages

Model and GPU pair pages

VRAM tier hubs

Related guides

Builder rig interviews

Open either model in the calculator: Gemma 4 31B or Gemma 4 26B A4B. The memory totals and speeds on this page are our estimate.

Sources and method

Checked . watch on YouTube

Speeds and memory are our estimate from the hardware specs, not a measured test. Prices are dated and may change. How we calculate

Questions

What is the difference between Gemma 4 31B and Gemma 4 26B A4B?
Both are Apache-2.0 open-weight multimodal (text + image) models from Google with a 262,144-token context window, and both can be tested side by side for free at https://localllmrig.com/. Gemma 4 31B is a 31.27B dense Transformer (60 layers: 50 sliding-window + 10 full-attention) that activates all 31.27B parameters on every token, needing 20.63 GB of VRAM at Q4_K_M (18.32 GB measured GGUF + 1.51 GB KV cache at 8,192 tokens + 0.80 GB working space). Gemma 4 26B A4B is a sparse Mixture-of-Experts (MoE) model with 25.2B total parameters across 128 experts (30 layers: 25 sliding-window + 5 full-attention) that activates only 3.8B parameters per token, needing 18.13 GB at UD-Q4_K_M (16.95 GB measured GGUF + 0.38 GB KV cache + 0.80 GB working space) or 14.78 GB (14.8 GB) at UD-IQ4_XS.
Which Gemma 4 model fits on a 16 GB GPU (RTX 4060 Ti 16GB, RTX 5080 16GB, RX 9060 XT 16GB)?
A 16 GB discrete GPU leaves 15.4 GB usable after subtracting 0.60 GB for the display and driver. Gemma 4 26B A4B fits in 4-bit at UD-IQ4_XS (13.60 GB measured GGUF + 0.38 GB KV cache + 0.80 GB working space = 14.78 GB / 14.8 GB total estimate) and in 3-bit at UD-Q3_K_XL (12.91 GB file = 14.09 GB total) on a Radeon RX 9060 XT 16GB (€564 / $522), GeForce RTX 4060 Ti 16GB (€899 / $832), or GeForce RTX 5080 16GB (€1,358 / $1,256). Dense Gemma 4 31B cannot fit any 4-bit file or Q3_K_M (17.05 GB total) inside 15.4 GB; it must drop to 3-bit UD-IQ3_XXS (11.84 GB file = 14.15 GB total) to fit a 16 GB card.
Why is Gemma 4 26B A4B faster than Gemma 4 31B on a Mac mini, Mac Studio, or Ryzen AI Max+ 395 Strix Halo?
Token generation on unified memory (120–546 GB/s on Mac mini and Mac Studio, 256 GB/s on AMD Ryzen AI Max+ 395 Strix Halo) is bottlenecked by how many gigabytes of weights must be read from memory for each token. Dense Gemma 4 31B reads all 31.27B parameters (18.32 GB at Q4_K_M) on every token, running at an estimated 4.1 tok/s on a Mac mini M6 32GB (€1,530 / $1,416), 6.6 tok/s on a Mac mini M4 Pro 64GB (€1,890 / $2,116), and 10.3 tok/s on a GMKtec EVO-X2 64GB (€2,199 / $2,035). Gemma 4 26B A4B holds 16.95 GB in memory at UD-Q4_K_M but reads only 3.8B active parameters (~2.3 GB) per token—roughly 8× less memory traffic per token, delivering 2–3× higher token generation speed on unified memory.
Can I run Gemma 4 26B A4B on an 8 GB or 12 GB GPU using llama.cpp --n-cpu-moe offloading?
Yes. Both models fit fully inside a 12 GB GPU (11.4 GB usable, such as a used RTX 3060 12GB at €261 / $292) at 2-bit UD-IQ2_XXS (10.8 GB for 31B; 11.1 GB for 26B A4B). Better yet, if you have an 8 GB or 12 GB GPU paired with 32 GB of DDR4/DDR5 system RAM, Gemma 4 26B A4B at UD-Q4_K_M (16.95 GB file) works well with llama.cpp MoE expert offloading (--n-cpu-moe): shared attention layers and the 0.38 GB KV cache stay in GPU VRAM while only the 3.8B active expert weights (~2.3 GB per token) are read from system RAM.
Which quantizations fit on a 24 GB GPU (used RTX 3090 or RTX 4090) for Gemma 4 31B vs 26B A4B?
A 24 GB GPU provides 23.4 GB of usable VRAM. At standard 4-bit quality, both fit comfortably: Gemma 4 31B Q4_K_M takes 20.63 GB (20.6 GB, running at ~37 tok/s on a used RTX 3090 at €1,246 / $1,395 and ~39 tok/s on a used RTX 4090 at €2,185 / $2,446, our estimate), and Gemma 4 26B A4B UD-Q4_K_M takes 18.13 GB (18.1 GB, leaving 5.27 GB of headroom for longer context). At 5-bit quality, Gemma 4 26B A4B UD-Q5_K_M (21.15 GB file, 22.33 GB total) still fits on a single 24 GB GPU, whereas Gemma 4 31B Q5_K_M (21.66 GB file, 23.97 GB total) exceeds 23.4 GB usable by 0.57 GB and requires a 32 GB GPU or 64 GB Mac.
Where can I test Gemma 4 31B and Gemma 4 26B A4B side by side for free in my browser?
You can test both Gemma 4 31B (google/gemma-4-31b-it:free) and Gemma 4 26B A4B (google/gemma-4-26b-a4b-it:free) side by side for free in your browser at https://localllmrig.com/, with no account, no login, and no local GPU required. Tick both models in the playground (up to 5 free questions every 10 minutes) and compare their answers alongside Qwen3.8-27B, Recursive Flint 40B, Claude, and GPT before downloading 17–21 GB of weights.