Model datasheet · Gemma 3
Gemma 3 4B
SupersededSuperseded by Gemma 4 E4B (Google's next generation at the same 8GB-laptop size, with vision again). Kept as the record of what the previous generation scored — pleasant chat and image understanding on small machines, and weak at math and code.
- Vendor
- Architecture
- Dense · 4B
- Context
- 131,072 tokens
- License
- Gemma Terms of Use
- Released
- 2025-03-12
- Vision
- Yes
→ GGUF (llama.cpp / LM Studio / Ollama) → MLX (Apple Silicon)
Architecture, from its own config.json
34 layers · 29 sliding window · 5 full attention
8 attention heads over 4 KV heads (GQA 2:1), head dim 256 · dense feed-forward · vocabulary 262,208
Where the memory goes: weights by band above, plus a KV cache of 334MB at 8K · 814MB at 32K · 2.7GB at 128K, plus the runtime's own working memory — dominated by the output projection over that vocabulary.
Inside one layer, from its own tensors
34 × layer
29 sliding-window layers, 5 full-attention layers — the same block either way. What differs is how far back the mask lets attention look, not what the layer is built from.
The green line down the right of each half is the residual: it leaves the spine above the norm, skips the operation entirely and rejoins at the +. Where attention is drawn open, q, k and v are scaled to their real output widths — a model that shares key and value heads across many query heads shows one wide box beside two narrow ones.
Around the stack: an embedding of 262,208 × 2,560, a final norm, and an output projection that reuses the embedding (tied weights).
§1 Characteristics by quantization band
— Not yet rated · contributions welcome —
Q4–Q5 — 4–5 bit
2.5GB weights · e.g. Q4_0 , Q4_K_M , mlx-4bit + KV: 334MB at 8K · 814MB at 32K · 2.7GB at 128Kdata checked Aug 2026
- quant-degradation-community — community consensus @ Q4_0 · aggregated · 2026-08-30
Editorial derivation: already weak at full precision; QAT Q4_0 preserves what there is.
data checked Aug 2026
- quant-degradation-community — community consensus @ Q4_0 · aggregated · 2026-08-30
Editorial derivation: QAT limits quant loss.
data checked Oct 2026
- quant-degradation-community — editorial band derivation @ Q4_0 · aggregated · 2026-10-04
Editorial derivation: carried from the EQ-Bench-anchored full band; QAT Q4_0 limits quant loss.
— Not yet rated · contributions welcome —
FP16 — full precision (fp16/bf16)
7.8GB weights · e.g. bf16 + KV: 334MB at 8K · 814MB at 32K · 2.7GB at 128Kdata checked Aug 2026
- vendor-model-card — MATH (4-shot) = 24.2 @ bf16 · vendor-reported · 2026-08-30
GSM8K: 38.4 — well behind Qwen3-4B and Phi-4-mini.
data checked Aug 2026
- vendor-model-card — HumanEval (0-shot) = 36 @ bf16 · vendor-reported · 2026-08-30
MBPP: 46.0.
data checked Aug 2026
- vectara-hallucination — HHEM hallucination rate % (lower is better) = 6.4 @ bf16 · aggregated · 2026-08-30
Answer rate only 67.3% — it refuses to answer a third of the time, which caps usefulness even when it doesn't hallucinate.
data checked Oct 2026
- eqbench-creative — EQ-Bench Creative Writing v3 rubric score (0-20) = 13.91 @ bf16 · aggregated · 2026-10-04
The weakest of the Gemma 3 sizes (12B 14.63, 27B 15.33), but well ahead of Llama 3.2 3B (8.18) at a similar size. Normalised Elo 1068.0, 114th of 140, retrieved 2026-10-04. Independent; rubric judged by Claude Sonnet 4. EQ-Bench's normalised Elo moves as models are added, so the rubric score is the figure stored. Quant not stated by EQ-Bench (presumed full-precision API serving). Data file behind https://eqbench.com/creative_writing.html; the date the row was added is not published.
- eqbench-creative — EQ-Bench Creative Writing Longform score (0-100) = 34.4 @ bf16 · aggregated · 2026-10-04
Longform: below the 12B and 27B (41.8, 41.9), ahead of Qwen3 4B (17.0). Data file behind the Longform page on eqbench.com. Quant not stated (presumed full precision).
§2 Known issues & what fixes them
Weakest math and coding in its size class (MATH 24.2, HumanEval 36.0 — vendor's own numbers). Its strengths are chat, languages, and vision; STEM is not on the list.
A calculator tool helps with arithmetic — though check tool-calling works in your setup, since Gemma's function calling is prompt-based.
For math or code at 4B, use Qwen3-4B or Phi-4-mini instead.
Evidence · 2 sources · community-consensus
- Gemma 3 4B model card (MATH 24.2, HumanEval 36.0) (vendor, 2026-08-30)
- Gemma 3 hands-on testing guide (blog, 2026-08-30)
Thin world knowledge plus a 67.3% answer rate on HHEM — it either doesn't know or declines to say, a third of the time.
Grounding raises both accuracy and answer rate.
Evidence · 2 sources · community-consensus
- Vectara HHEM (answer rate 67.3%) (leaderboard, 2026-08-30)
- Gemma 3 practical testing (knowledge gaps) (blog, 2026-08-30)