Overview
Google's Gemma 2 (arXiv: 2408.00118) asks: how do you build the best-performing open model at 2B and 9B parameters? How should positional encoding, attention design, and training method be combined?
Key Design Choices
1. Interleaving local-global attention — Based on Beltagy's sliding-window attention (SWA), but instead of using local attention everywhere, Gemma 2 *alternates*: odd layers use local window attention, even layers use global attention. This preserves local detail while still allowing global aggregation.
2. GQA (Grouped-Query Attention) — Reduces the KV cache footprint.
3. Knowledge distillation — The 2B and 9B models are trained by distillation: rather than pure next-token prediction, they imitate a larger teacher model. This is more effective than standard pretraining at small scale.
4. Soft-capping — Logits are soft-capped (via tanh) to prevent extreme values from destabilizing training.
Key Numbers
- Model sizes: 2B, 9B, 27B
- "Best performance for their size"
- "Competitive alternatives to models that are 2-3 times bigger"
- Fully open source
Impact
Gemma 2 demonstrates that "small model + good architecture + distillation" can rival "large model + standard training." Its interleaved attention strategy has been referenced by follow-up work. As Google's response to the open-source community (countering LLaMA), Gemma pushed forward research on lightweight high-performance models.
Commentary
> Gemma 2's mindset is "composition over novelty." It did not invent a new attention mechanism; it combined existing good ideas (SWA, GQA, distillation) in the right way. The interleaved local-global attention is especially clever — instead of making the model "always nearsighted" or "always farsighted," it alternates: one layer looks at details, the next looks at the big picture. Like a good photographer who shoots both close-ups and panoramas. The lesson: don't chase the most innovative single technique; chase the most harmonious combination of techniques. Gemma 2 is a victory of engineering taste.
Reference
Gemma Team (2024). *Gemma 2: Improving Open Language Models at a Practical Size.* arXiv:2408.00118