Skip to content

Gemma 3 Technical Report

optionalextendedfrontierpaperrubric 8/122025 · ~30 min

Gemma Team (Aishwarya Kamath, Johan Ferret, Shreya Pathak, et al.)

Status

TL;DR. Gemma 3 (1B, 4B, 12B, 27B) adds vision, more languages and 128K context (32K for 1B) to Gemma 2. The main architecture change is cheaper long context: 5 sliding-window layers of 1,024 tokens per global layer. All sizes are trained by distillation, and the 27B IT model scores 1,338 Elo in Chatbot Arena, above DeepSeek-V3 (1,318) and Llama 3 405B (1,257).

Long context is a KV-cache problem, so make most layers local. If a fraction 1/(r+1)1/(r+1) of layers are global and the rest see a window ww, KV memory at length TT shrinks roughly to

T+r w(r+1) T,r=5,  w=1024.\frac{T + r\,w}{(r+1)\,T}, \qquad r = 5,\; w = 1024 .

Results and discussion. Gemma3-4B-IT is competitive with Gemma2-27B-IT, and Gemma3-27B-IT is comparable to Gemini-1.5-Pro across benchmarks. What transferred: the 5:1 local/global pattern became Gemma’s standard and is kept in Gemma 4 (arXiv 2607.02770), which adds dense and MoE models from 2.3B to 31B, a thinking mode, p-RoPE, KV-cache sharing and an MTP drafter head for speculative decoding. gpt-oss also alternates local and dense attention. The report does not name its optimizer or learning-rate schedule.

Questions to think through

These questions have no single right answer. Write or say your answer before you open the hints. Mark a question once you could defend your answer in a reading group.

  1. Derive / compute

    Gemma 3 uses 5 local layers (1,024-token sliding window) per global layer. At a 128K-token context, estimate the KV-cache memory relative to an all-global model with the same layers and heads, and explain why the 1B model with 32K context gains less.

    What a strong answer covers
    • Per layer, KV memory scales with the tokens it stores: global layers store all 131,072 tokens, local layers only 1,024.
    • Ratio ≈ (1/6 × 131,072 + 5/6 × 1,024) / 131,072 ≈ 0.167 + 0.007 ≈ 0.17, about 5.8× less than all-global.
    • The global layers dominate what remains, so the saving is bounded by the 1-in-6 share of global layers.
    • At 32K, local layers still store 1,024 of 32,768 tokens (about 3%), so the ratio is ≈ 0.19: a slightly smaller saving and a smaller absolute KV cache to start with.
  2. What if…

    Section 5 ablates the local:global ratio, the sliding-window size and teacher size for distillation. Summarize what each ablation shows and what design choice it justifies.

    What a strong answer covers
    • Changing the ratio from 1:1 (Gemma 2) to 5:1 or even 7:1 has minimal effect on perplexity.
    • The sliding window can be cut substantially (down to 1,024) without hurting perplexity.
    • With sw=1024, KV-cache overhead at 32K drops from about 60% of model memory (global only) to under 15%, even at 1:3.
    • A smaller teacher is better for short training horizons, but a larger teacher wins for longer training, which supports distilling from a large teacher over trillions of tokens.
  3. Connect

    Gemma 3 extends context by pre-training at 32K and rescaling RoPE by a factor of 8 at the end, with base 1M on global layers and 10K on local layers. Relate this to other long-context recipes and to what Gemma 4 changed.

    What a strong answer covers
    • This is position interpolation (Chen et al., 2023) applied only near the end of training, like the long-context stages in Llama 3 and DeepSeek-V3.
    • Raising the base only on global layers makes sense because local layers never see distances beyond 1,024.
    • The report shows models generalize to 128K but degrade quickly beyond it, so the claimed length is an edge, not a soft limit.
    • Gemma 4 keeps the 5:1 local/global ratio (4:1 for 2.3B) but switches to p-RoPE and adds KV-cache sharing, a 26B MoE with 3.8B active and a thinking mode.

Done with this page?

Status