Paper commentary
Gemma: Open Models Based on Gemini Research and Technology
- Problem Open-weight LLMs need evidence on capability, safety and memorization before others can build on them, and the Gemma report supplies that evidence for 2B and 7B models.
- Method Trains a transformer decoder with multi-query attention in the 2B model, RoPE, GeGLU and RMSNorm on 3T and 6T tokens, then applies supervised fine-tuning and RLHF.
- Results Reached 64.3 on MMLU under 5-shot, top-1 for Gemma 7B, and won 61.2% of instruction-following comparisons against Mistral v0.2 7B Instruct.

Figure 1 | Language understanding and generation performance of Gemma 7B across different capa- bilities compared to similarly sized open models. We group together standard academic benchmark evaluations by capability and average the respective scores; see Table 6 for a detailed breakdown of performance.
Original paper · CC BY 4.0 · Extracted the figure area from page 2 of the original PDF.Why Gemma is released as open weights
Gemma is a family of open models built on the research and technology behind Gemini, released with raw pretrained checkpoints and checkpoints tuned for dialogue, instruction-following, helpfulness and safety. Each of the two model sizes gets both kinds of checkpoint, so researchers can study the pretrained base and the tuned models separately.
The authors argue the checkpoints will support work on how instruction-tuning regimes affect behavior and on safer development methods. They frame responsible release of LLMs as important for frontier model safety, equitable access and rigorous evaluation of current techniques.
Releasing weights differs from serving a model behind an API, because downstream users can fine-tune and deploy the model themselves. Testing cannot cover every application, so each user is expected to run safety testing for their own use case before deployment. The report covers the architecture, training infrastructure, pretraining and tuning recipes, evaluations and responsible deployment, in that order.
Architecture changes to the base transformer
Gemma is a transformer decoder, trained on a context length of 8192 tokens. The 2B model has d_model 2048, 18 layers, 8 heads with 1 KV head and a feedforward hidden dimension of 32768, while the 7B model has d_model 3072, 28 layers, 16 heads with 16 KV heads and a feedforward hidden dimension of 49152. Both sizes use a head size of 256 and a vocabulary size of 256128.
The 7B model keeps multi-head attention, while the 2B model uses multi-query attention with a single key-value head. The authors justify the split with ablations showing that multi-query attention works well at small scales.
Absolute positional embeddings are replaced by rotary positional embeddings applied in every layer. Input embeddings and output projection share one matrix, which reduces model size.
The feedforward layers replace the ReLU non-linearity with an approximated GeGLU activation, so the gating happens inside the feedforward layer. RMSNorm normalizes the input of each attention and feedforward sub-layer, which the authors use to stabilize training.
Table 2 splits the parameters into embedding and non-embedding parts: 524,550,144 embedding and 1,981,884,416 non-embedding parameters for the 2B model, and 786,825,216 and 7,751,248,896 for the 7B model. The 256k-entry vocabulary, inherited from the Gemini vocabulary, accounts for the embedding counts in that table.
Pretraining data, tokenizer and filtering
Gemma 2B was trained on 3T tokens and Gemma 7B on 6T tokens. The data is primarily English and comes from web documents, mathematics and code. Unlike Gemini, the models are not multimodal and were not tuned for strong multilingual performance.
The tokenizer is a subset of the Gemini SentencePiece tokenizer, chosen for compatibility, with a vocabulary of 256k tokens. It splits digits, keeps extra whitespace, and falls back to byte-level encodings for unknown tokens.
Pretraining data is filtered to reduce unwanted or unsafe content and to remove certain personal information, using both heuristics and model-based classifiers. All evaluation sets are removed from the training mixture, and contamination analyses check for leakage. The authors also reduce the risk of recitation by limiting the spread of sensitive outputs.
The final mixture came from ablations on both the 2B and 7B models. Training is staged so that the weight of relevant, high-quality data rises toward the end, following the approach described for Gemini.
Training on TPUv5e pods
Gemma was trained on TPUv5e, deployed in pods of 256 chips arranged as a 2D torus of 16 x 16 chips. Within a pod, the 7B model used 16-way model sharding and 16-way data replication, whereas the 2B model used 256-way data replication. Optimizer state is sharded with techniques similar to ZeRO-3, and replicas are reduced across pods over the data-center network using the Pathways approach.
A single Python process orchestrates each run through the single-controller paradigm of Jax and Pathways, with the GSPMD partitioner and the MegaScale XLA compiler.
The pretraining carbon estimate is roughly 131 tCO2eq. It starts from hourly energy use reported by the TPU datacenters, adds energy for creating and maintaining the data center, and converts the total with hourly per-cell carbon emission data. The authors note that Google data centers are carbon neutral through energy efficiency, renewable energy purchases and carbon offsets, and that this applies to these experiments.
Supervised tuning, formatter and RLHF
Both sizes go through supervised fine-tuning and then reinforcement learning from human feedback. The supervised stage uses a mix of text-only, English-only prompt-response pairs, some synthetic and some human-written. The authors find that both stages matter for automatic and human evaluations.
The SFT data mixtures were chosen with LM-based side-by-side evaluations. A test model and a baseline each answer held-out prompts, the two answers are shuffled, and a larger high-capability model picks the preferred one. Prompt sets target instruction following, factuality, creativity and safety, and the judges use chain-of-thought prompting and rubrics or constitutions to match human preferences.
Synthetic data is filtered to remove personal information, unsafe or toxic outputs, mistaken self-identification data and duplicated examples. Subsets that encourage in-context attribution, hedging and refusals were included, following Gemini, and they improved factuality metrics without degrading other metrics. The final mixtures and recipe, including tuned hyperparameters, were chosen to improve helpfulness while limiting safety and hallucination harms.
Instruction-tuned models are trained and run with a formatter that tags each example with reserved control tokens for roles and turn boundaries. Table 3 lists the tokens user, model, start_of_turn and end_of_turn, and Table 4 gives a dialogue example that uses them. The authors expect that generating without the formatter puts inputs out of distribution and produces worse outputs.
After SFT, the model is tuned further with RLHF, using preference pairs collected from human raters. A reward function is trained under the Bradley-Terry model, and the policy is optimized against it with a reinforcement learning algorithm the authors describe as novel. To tune hyperparameters and limit reward hacking, a high-capacity model acts as automatic rater and compares outputs side by side against baselines.
Academic benchmark results
Benchmarks follow the Gemini evaluation method, and the comparisons with Mistral follow the Mistral report as closely as the authors could. LLaMA-2 could not be rerun because of licensing, so its values are the ones Touvron et al. previously reported. Gemma 2B and 7B are compared with several open models in Table 6 and Table 7.
On MMLU under the 5-shot, top-1 protocol, Gemma 7B reached 64.3, against 62.5 for Mistral 7B and 54.8 for LLaMA-2 13B. The authors say Gemma 7B outperforms all open alternatives at the same or smaller scale, and also several larger models. Human expert performance on MMLU is 89.8%, and Gemini Ultra is described as the first model to exceed it, so a clear gap to human level remains.
On GSM8K, Gemma 7B scored 46.4 against 35.4 for Mistral 7B, and on MATH it scored 24.3 against 12.7 for Mistral 7B. The authors state the margin is at least 10 points on GSM8K and on MATH. On HumanEval with pass@1, Gemma 7B reached 32.3 against 26.2 for Mistral 7B, which the authors describe as at least 6 points higher.
Averaged over the benchmark rows, Gemma 7B scores 56.9, Mistral 7B 54.5, LLaMA-2 13B 52.4 and Gemma 2B 45.0. Figure 1 groups these scores by question answering, reasoning, math and science, and coding. On the HuggingFace H6 benchmark, which HuggingFace ran independently, Gemma 7B averages 63.8 against 61.0 for Mistral 7B.
Human side-by-side preference results
Final release candidates were sent to human side-by-side studies against Mistral v0.2 7B Instruct. The instruction-following set has around 1000 held-out prompts on creative writing, coding and following instructions, and the safety set has around 400 held-out prompts on basic safety protocols. The tables in this section report the Gemma 1.1 IT models.
Gemma 7B IT won 61.2% of instruction-following comparisons, and Gemma 2B IT won 45%. On safety prompts, Gemma 7B IT won 63.5% and Gemma 2B IT won 60.1%.
On instruction following, the 7B model won 52.2%, tied 18.1% and lost 29.8%, with a 95% confidence interval of [59.3%, 63%] for its win rate. The 2B model won 37.1%, tied 15.8% and lost 47.1% on the same prompts, with its interval at [43.1%, 46.9%]. On safety, the win, tie and loss splits are 51.5%, 23.9% and 24.6% for 7B, and 48.5%, 23.2% and 28.3% for 2B, with intervals [60.7%, 66.1%] and [57.3%, 62.8%].
Ties are split evenly when the final win rate is reported.
Memorization of pretraining data
Memorization is measured as discoverable memorization, which the authors treat as a reasonable upper bound on a model's memorization. For each corpus, 10,000 documents are sampled, the first 50 tokens serve as the prompt, and the next 50 generated tokens are compared with the true continuation. Exact memorization requires an exact match, while approximate memorization accepts continuations within a 10% edit distance.
Figure 2 compares the Gemma pretrained models with PaLM and PaLM 2 models of comparable size. On the verbatim overlap with the PaLM training corpora, Gemma's measured rates are much lower, because Gemma's pretraining data overlaps far less with those corpora. Estimating total memorization over the full pretraining dataset puts Gemma at a rate comparable to PaLM.
Personal data is detected with Google Cloud Sensitive Data Protection, which gives three severity levels; the highest is labeled sensitive and the other two personal. No memorized output contained sensitive data, and some memorized outputs were classified as personal, at a much lower rate. The authors caution that the tool produces many false positives because it matches patterns without context, so personal-data counts are likely overestimates.
Approximate memorization captures roughly 50% more data than exact memorization. The gap is shown on a log scale and is nearly consistent across the data subcategories.
Safety and bias benchmark numbers
Table 8 reports the Gemma 1.1 IT 2B and 7B models against Mistral v0.2 7B, all evaluations run by the authors. The table covers RealToxicity, BOLD, CrowS-Pairs, BBQ, Winogender, TruthfulQA, Winobias and Toxigen. LLaMA-2 is absent because of licensing, and the authors did not reuse its published TruthfulQA numbers because the evaluation setup differs.
On CrowS-Pairs top-1, Gemma 1.1 IT 7B scored 49.67 against 32.76 for Mistral v0.2 7B, while on BBQ Ambig 1-shot, top-1 it scored 86.06 against 97.53. On Winobias 2_2, the 2B model scored 89.46, against 89.2 for the 7B model and 84.53 for Mistral v0.2 7B. The rows do not favor one model throughout, and the table gives no single ranking.
The authors state that Gemma outperforms competitor models on six standard safety benchmarks and in human side-by-side evaluations. That sentence does not name the six benchmarks, so the claim should be read against Table 8 row by row.
Benefits, risks and the release decision
The authors argue that openness in AI science and technology brings significant benefits and is a responsible practice in most circumstances, though it must be balanced against the risk of enabling harm. The release is meant to lower economic and technical barriers for newer ventures and independent developers, and to let developers adapt the instruction-tuned models to specific use cases.
Base pretrained models are also released so that others can build on transparency and interpretability research.
The authors list malicious uses such as deepfake imagery, AI-generated disinformation and illegal material as harms to individuals and institutions. Unintended behaviors form a second risk, including toxic language, discriminatory social harms, hallucinations and leakage of personally identifiable information. Filtering can reduce these risks when models are served behind an API, which open weights do not offer.
Mitigations include filtering and measuring biases in pretraining data, standardized safety benchmarks, internal red teaming and ethics and safety evaluations. A model card and a Generative AI Responsible Toolkit accompany the release. The authors note that new uses and misuses of open weights are still being discovered, so mitigation work continues alongside future model development.
They commit to proportionate assessments and say they may explore extended testing, staggered releases or other access mechanisms as capabilities advance. They urge the community to move beyond open-versus-closed debates.
Limits of the evidence
The authors state that testing cannot cover all applications and scenarios, so each user must run safety testing for the use case. They describe the release as irreversible and say the harms of open models are not yet well defined.
Gemma 7B reached 64.3 on MMLU, against 89.8% human expert performance, so a substantial gap remains. The authors say substantial room for improvement remains before Gemini and human-level performance are matched.
The human preference comparisons use only Mistral v0.2 7B Instruct as the opponent. The 2B model's 45% instruction-following win rate is below even, with 37.1% wins against 47.1% losses.
LLaMA-2 values are quoted from Touvron et al. and were not rerun under the same conditions. The authors note that Mistral reports 50.2 on a different MBPP split. Small-model scores on the HuggingFace H6 benchmark are sensitive to prompt changes, as the authors caution.
The models are primarily English and not multimodal, and the authors do not claim state-of-the-art multilingual performance. The verbatim comparison with PaLM rests on a small overlap between training corpora. The personal-data detection tool produces many false positives.
They also call for more challenging and robust benchmarks.
Paper info
- Authors
- Gemma Team, Thomas Mesnard, Cassidy Hardin, Robert Dadashi, Surya Bhupatiraju, Shreya Pathak, Laurent Sifre, Morgane Rivière, Mihir Sanjay Kale, Juliette Love, Pouya Tafti, Léonard Hussenot, Pier Giuseppe Sessa, Aakanksha Chowdhery, Adam Roberts, Aditya Barua, Alex Botev, Alex Castro-Ros, Ambrose Slone, Amélie Héliou, Andrea Tacchetti, Anna Bulanova, Antonia Paterson, Beth Tsai, Bobak Shahriari, Charline Le Lan, Christopher A. Choquette-Choo, Clément Crepy, Daniel Cer, Daphne Ippolito, David Reid, Elena Buchatskaya, Eric Ni, Eric Noland, Geng Yan, George Tucker, George-Christian Muraru, Grigory Rozhdestvenskiy, Henryk Michalewski, Ian Tenney, Ivan Grishchenko, Jacob Austin, James Keeling, Jane Labanowski, Jean-Baptiste Lespiau, Jeff Stanway, Jenny Brennan, Jeremy Chen, Johan Ferret, Justin Chiu, Justin Mao-Jones, Katherine Lee, Kathy Yu, Katie Millican, Lars Lowe Sjoesund, Lisa Lee, Lucas Dixon, Machel Reid, Maciej Mikuła, Mateo Wirth, Michael Sharman, Nikolai Chinaev, Nithum Thain, Olivier Bachem, Oscar Chang, Oscar Wahltinez, Paige Bailey, Paul Michel, Petko Yotov, Rahma Chaabouni, Ramona Comanescu, Reena Jana, Rohan Anil, Ross McIlroy, Ruibo Liu, Ryan Mullins, Samuel L Smith, Sebastian Borgeaud, Sertan Girgin, Sholto Douglas, Shree Pandya, Siamak Shakeri, Soham De, Ted Klimenko, Tom Hennigan, Vlad Feinberg, Wojciech Stokowiec, Yu-hui Chen, Zafarali Ahmed, Zhitao Gong, Tris Warkentin, Ludovic Peran, Minh Giang, Clément Farabet, Oriol Vinyals, Jeff Dean, Koray Kavukcuoglu, Demis Hassabis, Zoubin Ghahramani, Douglas Eck, Joelle Barral, Fernando Pereira, Eli Collins, Armand Joulin, Noah Fiedel, Evan Senter, Alek Andreev, Kathleen Kenealy
- Venue
- arXiv · Preprint
- First published
- 2024-3-13
- Added
- 2026-10-20
- Updated
- 2024-4-16
- Version
- v4
- arXiv
- 2403.08295
- Category
- cs.CL · cs.AI
- Original paper terms
- CC BY 4.0
- What we show
- Paper info, commentary and permitted figures from the original paper
AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.
Abstract
This work introduces Gemma, a family of lightweight, state-of-the art open models built from the research and technology used to create Gemini models. Gemma models demonstrate strong performance across academic benchmarks for language understanding, reasoning, and safety. We release two sizes of models (2 billion and 7 billion parameters), and provide both pretrained and fine-tuned checkpoints. Gemma outperforms similarly sized open models on 11 out of 18 text-based tasks, and we present comprehensive evaluations of safety and responsibility aspects of the models, alongside a detailed description of model development. We believe the responsible release of LLMs is critical for improving the safety of frontier models, and for enabling the next wave of LLM innovations.
Quote from the paper
Gemma Team, Thomas Mesnard, Cassidy Hardin, Robert Dadashi, Surya Bhupatiraju, Shreya Pathak, Laurent Sifre, Morgane Rivière, Mihir Sanjay Kale, Juliette Love, Pouya Tafti, Léonard Hussenot, Pier Giuseppe Sessa, Aakanksha Chowdhery, Adam Roberts, Aditya Barua, Alex Botev, Alex Castro-Ros, Ambrose Slone, Amélie Héliou et al. (2024). Gemma: Open Models Based on Gemini Research and Technology. arXiv:2403.08295v4. https://arxiv.org/abs/2403.08295v4
BibTeX
@misc{team2024gemma,
title = {{Gemma: Open Models Based on Gemini Research and Technology}},
author = {Gemma Team and Thomas Mesnard and Cassidy Hardin and Robert Dadashi and Surya Bhupatiraju and Shreya Pathak and Laurent Sifre and Morgane Rivière and Mihir Sanjay Kale and Juliette Love and Pouya Tafti and Léonard Hussenot and Pier Giuseppe Sessa and Aakanksha Chowdhery and Adam Roberts and Aditya Barua and Alex Botev and Alex Castro-Ros and Ambrose Slone and Amélie Héliou and Andrea Tacchetti and Anna Bulanova and Antonia Paterson and Beth Tsai and Bobak Shahriari and Charline Le Lan and Christopher A. Choquette-Choo and Clément Crepy and Daniel Cer and Daphne Ippolito and David Reid and Elena Buchatskaya and Eric Ni and Eric Noland and Geng Yan and George Tucker and George-Christian Muraru and Grigory Rozhdestvenskiy and Henryk Michalewski and Ian Tenney and Ivan Grishchenko and Jacob Austin and James Keeling and Jane Labanowski and Jean-Baptiste Lespiau and Jeff Stanway and Jenny Brennan and Jeremy Chen and Johan Ferret and Justin Chiu and Justin Mao-Jones and Katherine Lee and Kathy Yu and Katie Millican and Lars Lowe Sjoesund and Lisa Lee and Lucas Dixon and Machel Reid and Maciej Mikuła and Mateo Wirth and Michael Sharman and Nikolai Chinaev and Nithum Thain and Olivier Bachem and Oscar Chang and Oscar Wahltinez and Paige Bailey and Paul Michel and Petko Yotov and Rahma Chaabouni and Ramona Comanescu and Reena Jana and Rohan Anil and Ross McIlroy and Ruibo Liu and Ryan Mullins and Samuel L Smith and Sebastian Borgeaud and Sertan Girgin and Sholto Douglas and Shree Pandya and Siamak Shakeri and Soham De and Ted Klimenko and Tom Hennigan and Vlad Feinberg and Wojciech Stokowiec and Yu-hui Chen and Zafarali Ahmed and Zhitao Gong and Tris Warkentin and Ludovic Peran and Minh Giang and Clément Farabet and Oriol Vinyals and Jeff Dean and Koray Kavukcuoglu and Demis Hassabis and Zoubin Ghahramani and Douglas Eck and Joelle Barral and Fernando Pereira and Eli Collins and Armand Joulin and Noah Fiedel and Evan Senter and Alek Andreev and Kathleen Kenealy},
year = {2024},
eprint = {2403.08295},
archivePrefix = {arXiv},
url = {https://arxiv.org/abs/2403.08295v4}
}