NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Gemma 2: Improving Open Language Models at a Practical Size

Morgane Rivière, Shreya Pathak, Pier Giuseppe Sessa, Cassidy Hardin, Surya Bhupatiraju, Léonard Hussenot, Thomas Mesnard, Bobak Shahriari, Alexandre Ramé, Johan Ferret, Peter Liu, Pouya Tafti, Abe Friesen, Michelle Casbon, Sabela Ramos, Ravin Kumar, Charline Le Lan, Sammy Jerome, Anton Tsitsulin, Nino Vieillard, Piotr Stanczyk, Sertan Girgin, Nikola Momchev, Matt Hoffman, Shantanu Thakoor, Jean-Bastien Grill, Behnam Neyshabur, Olivier Bachem, Alanna Walton, Aliaksei Severyn, Alicia Parrish, Aliya Ahmad, Allen Hutchison, Alvin Abdagic, Amanda Carl, Amy Shen, Andy Brock, Andy Coenen, Anthony Laforge, Antonia Paterson, Ben Bastian, Bilal Piot, Bo Wu, Brandon Royal, Charlie Chen, Chintu Kumar, Chris Perry, Chris Welty, Christopher A. Choquette-Choo, Danila Sinopalnikov, David Weinberger, Dimple Vijaykumar, Dominika Rogozinska, Dustin Herbison, Elisa Bandy, Emma Wang, Eric Noland, Erica Moreira, Evan Senter, Evgenii Eltyshev, Francesco Visin, Gabriel Rasskin, Gary Wei, Glenn Cameron, Gus Martins, Hadi Hashemi, Hanna Klimczak-Plucinska, Harleen Batra, Harsh Dhand, Ivan Nardini, Jacinda Mein, Jack Zhou, James Svensson, Jeff Stanway, Jetha Chan, Jin Peng Zhou, Joana Carrasqueira, Joana Iljazi, Jocelyn Becker, Joe Fernandez, Joost van Amersfoort, Josh Gordon, Josh Lipschultz, Josh Newlan, Ju-yeong Ji, Kareem Mohamed, Kartikeya Badola, Kat Black, Katie Millican, Keelin McDonell, Kelvin Nguyen, Kiranbir Sodhia, Kish Greene, Lars Lowe Sjösund, Lauren Usui, Laurent Sifre, Lena Heuermann, Leticia Lago, Lilly McNealus · OpenReview

Abstract

In this work, we introduce Gemma 2, a new addition to the Gemma family of lightweight, state-of-the-art open models, ranging in scale from 2 billion to 27 billion parameters. In this new version, we apply several known technical modifications to the Transformer architecture, such as interleaving local-global attentions and group-query attention. We also train the 2B and 9B models with knowledge distillation instead of next token prediction. The resulting models deliver the best performance for their size, and even offer competitive alternatives to models that are 2-3 times bigger. We release all our models to the community.

Introduction

The AI industry is currently characterized by a focus on "scaling laws," where increasing data and parameter counts typically drive performance gains. However, for many practical applications—such as on-device AI and low-latency edge computing—massive models are often unusable. The Gemma 2 family (2B, 9B, and 27B parameters) redefines the performance-to-size ratio for open language models, proving that smaller models can compete with significantly larger counterparts when trained with advanced methodologies.

Architectural Innovations

Gemma 2 leverages several key modifications to the standard Transformer architecture to enhance efficiency and performance:

  • Knowledge Distillation (KD): This is the standout technique for the 2B and 9B models. Rather than training solely on raw text via next-token prediction, these models are trained to mimic the probability distributions of a much larger "teacher" model. This provides a richer gradient, allowing the smaller "student" to capture complex reasoning patterns more effectively.
  • Interleaved Attention: The models alternate between local sliding window attention (efficient for nearby context) and global attention (better for long-range dependencies) in every other layer. This reduces computational costs without sacrificing the model's global context awareness.
  • Group-Query Attention (GQA): Used across all sizes to improve inference speed and reduce memory overhead during deployment.
  • Logit Soft-Capping: A technique used to prevent logits from growing too large, which stabilizes training and improves overall model performance.
Table 1: Detailed architectural hyperparameters for the Gemma 2 model family.

Training and Scale

The Gemma 2 models were trained on vast datasets: 13 trillion tokens for the 27B model, 8 trillion for the 9B, and 2 trillion for the 2B. The data mix primarily consists of English-language web documents, code, and scientific articles.

Table 2: Breakdown of embedding and non-embedding parameters across the Gemma 2 sizes.

One significant finding in the training process was the impact of model depth. Ablation studies indicated that for a fixed parameter budget, deeper networks (more layers) slightly outperformed wider networks (larger hidden dimensions). Furthermore, Gemma 2 models show lower rates of verbatim training data memorization compared to Gemma 1, suggesting better generalization.

Key Results and Performance

Gemma 2 models demonstrate exceptional efficiency across standard benchmarks:

  • The 9B Giant-Killer: The Gemma 2 9B model achieves a 71.3 on MMLU, notably higher than Llama-3 8B (66.6) and Mistral 7B (62.5).
  • 27B vs 70B: The 27B model is remarkably competitive with models nearly three times its size. In the LMSYS Chatbot Arena, Gemma 2 27B-it (the instruction-tuned version) holds an Elo score of 1218, rivaling the much larger Llama-3 70B.
  • Human Preference: In side-by-side human evaluations, Gemma 2 models were rated significantly better than their predecessors in both user satisfaction and goal achievement.

Limitations and Future Work

Despite these advancements, Gemma 2 remains primarily English-centric in its training data. Additionally, while these models are excellent assistants, they still face challenges with "self-proliferation" tasks—complex, multi-step autonomous coding or system administration. Future research will focus on expanding multilingual capabilities and further optimizing these practical-sized models for specialized hardware like mobile GPUs.

Summary updated

BibTeX
@misc{riviere2024gemma,
  author = {Morgane Rivière and Shreya Pathak and Pier Giuseppe Sessa and Cassidy Hardin and Surya Bhupatiraju and Léonard Hussenot and Thomas Mesnard and Bobak Shahriari and Alexandre Ramé and Johan Ferret and Peter Liu and Pouya Tafti and Abe Friesen and Michelle Casbon and Sabela Ramos and Ravin Kumar and Charline Le Lan and Sammy Jerome and Anton Tsitsulin and Nino Vieillard and Piotr Stanczyk and Sertan Girgin and Nikola Momchev and Matt Hoffman and Shantanu Thakoor and Jean-Bastien Grill and Behnam Neyshabur and Olivier Bachem and Alanna Walton and Aliaksei Severyn and Alicia Parrish and Aliya Ahmad and Allen Hutchison and Alvin Abdagic and Amanda Carl and Amy Shen and Andy Brock and Andy Coenen and Anthony Laforge and Antonia Paterson and Ben Bastian and Bilal Piot and Bo Wu and Brandon Royal and Charlie Chen and Chintu Kumar and Chris Perry and Chris Welty and Christopher A. Choquette-Choo and Danila Sinopalnikov and David Weinberger and Dimple Vijaykumar and Dominika Rogozinska and Dustin Herbison and Elisa Bandy and Emma Wang and Eric Noland and Erica Moreira and Evan Senter and Evgenii Eltyshev and Francesco Visin and Gabriel Rasskin and Gary Wei and Glenn Cameron and Gus Martins and Hadi Hashemi and Hanna Klimczak-Plucinska and Harleen Batra and Harsh Dhand and Ivan Nardini and Jacinda Mein and Jack Zhou and James Svensson and Jeff Stanway and Jetha Chan and Jin Peng Zhou and Joana Carrasqueira and Joana Iljazi and Jocelyn Becker and Joe Fernandez and Joost van Amersfoort and Josh Gordon and Josh Lipschultz and Josh Newlan and Ju-yeong Ji and Kareem Mohamed and Kartikeya Badola and Kat Black and Katie Millican and Keelin McDonell and Kelvin Nguyen and Kiranbir Sodhia and Kish Greene and Lars Lowe Sjösund and Lauren Usui and Laurent Sifre and Lena Heuermann and Leticia Lago and Lilly McNealus},
  title = {{Gemma 2: Improving Open Language Models at a Practical Size}},
  year = {2024},
  eprint = {2408.00118},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2408.00118},
}
Figure