# Gemma 2

> Google's 2024 open-weights LLM family — 2B, 9B, and 27B models that punch above their size.

- Maker: Google
- Line: Gemma (open weights)
- Canonical page: https://ai-tldr.dev/models/gemma-2/
- Updated: 2026-06-18

## In short

Gemma 2 is Google's second-generation family of open-weights large language models, launched on June 27, 2024 in 9B and 27B parameter sizes, with a smaller 2B (2.6B) variant following on July 31, 2024. It has a 8,192-token context window. You can use it through Hugging Face and Google AI for Developers.

## Facts

| Fact | Value | Source |
| --- | --- | --- |
| Context window | 8,192 tokens (max output Not separately specified; output shares the 8,192-token context window) | [1] |
| Input price | Free to download and self-host | [2] |
| Output price | Free to download and self-host | [2] |
| Licence | Gemma (Gemma Terms of Use) — a custom, commercially permissive license that allows redistribution, fine-tuning, commercial use, and derivative works subject to a prohibited-use policy. Not OSI-approved (not Apache 2.0). · open weights | [1] |
| Released | 27 June 2024 | [3] |
| Parameters | Three sizes: 2B (2.6B), 9B, and 27B parameters | [1] |
| Knowledge cutoff | Not officially published by Google for Gemma 2 | [1] |

## Sources

1. [Gemma 2 model card (Google AI for Developers)](https://ai.google.dev/gemma/docs/core/model_card_2)
2. [gemma-2-27b-it on Hugging Face (benchmarks + weights)](https://huggingface.co/google/gemma-2-27b-it)
3. [Google launches Gemma 2 (official announcement)](https://blog.google/technology/developers/google-gemma-2/)

## Overview

Gemma 2 is Google's second-generation family of open-weights large language models, launched on June 27, 2024 in 9B and 27B parameter sizes, with a smaller 2B (2.6B) variant following on July 31, 2024. Built by Google DeepMind from the same research and technology used to create the Gemini models, Gemma 2 is text-in, text-out, and is distributed as downloadable weights on Hugging Face, Kaggle, and Vertex AI Model Garden under the custom Gemma license — which permits commercial use, fine-tuning, and redistribution.

Each size ships in two flavors: a pretrained base model (e.g. gemma-2-27b) and an instruction-tuned chat model (e.g. gemma-2-27b-it). Architecturally, Gemma 2 is a decoder-only transformer that interleaves local sliding-window attention with full global attention, uses grouped-query attention for faster inference, and applies logit soft-capping plus RMSNorm pre/post-normalization for training stability. The 2B and 9B models were trained via knowledge distillation from the 27B model, which is why the smaller Gemma 2 models were unusually strong for their size at launch.

At release, Google positioned the 27B model as offering performance competitive with proprietary models and open models more than twice its size, while the 9B model was pitched as outperforming Llama 3 8B and other open models in its class. Gemma 2 has since been succeeded by Gemma 3 (2025) and Gemma 4 (2026), which add multimodality, larger context windows, and multilingual support, but the Gemma 2 weights remain published and widely used for on-device and self-hosted deployment because of their small footprint and the fact that the 9B and 2B models run on a single consumer GPU or even a laptop.

## Benchmarks

- MMLU (5-shot): 75.2% ([source](https://huggingface.co/google/gemma-2-27b-it))
- GSM8K (5-shot, maj@1): 74% ([source](https://huggingface.co/google/gemma-2-27b-it))
- HumanEval (pass@1): 51.8% ([source](https://huggingface.co/google/gemma-2-27b-it))
- MATH (4-shot): 42.3% ([source](https://huggingface.co/google/gemma-2-27b-it))
- HellaSwag (10-shot): 86.4% ([source](https://huggingface.co/google/gemma-2-27b-it))
- ARC-c (25-shot): 71.4% ([source](https://huggingface.co/google/gemma-2-27b-it))
- MMLU (5-shot, 9B): 71.3% ([source](https://huggingface.co/google/gemma-2-9b))
- GSM8K (5-shot, maj@1, 9B): 68.6% ([source](https://huggingface.co/google/gemma-2-9b))
- HumanEval (pass@1, 9B): 40.2% ([source](https://huggingface.co/google/gemma-2-9b))
- MATH (4-shot, 9B): 36.6% ([source](https://huggingface.co/google/gemma-2-9b))

## Pricing

- Input: Free to download and self-host / 1M tokens
- Output: Free to download and self-host / 1M tokens

Gemma 2 is open weights — Google charges nothing for the model itself; cost depends on your own compute or a third-party inference host. Google did not publish a first-party per-token price for Gemma 2. Various inference providers (e.g. Groq, Together AI) listed hosted per-token rates over time, but those vary by provider and change frequently.

Source: https://huggingface.co/google/gemma-2-27b-it

## Strengths

- Strong quality-per-parameter: the 9B and 2B models were trained with knowledge distillation from the 27B, making them punch above their size class
- Truly open weights — downloadable and self-hostable with no API dependency, under a commercially permissive license
- Small footprint: the 9B and 2B variants run on a single consumer GPU (or a high-end laptop in quantized form), and the 27B fits on a single A100 80GB or H100
- Efficient architecture (GQA + sliding-window attention) gives fast inference relative to dense models its size
- Broad ecosystem support out of the box — Hugging Face Transformers, llama.cpp/Ollama, vLLM, TensorRT-LLM, Keras, and Vertex AI

## Best for

- On-device and self-hosted text generation, summarization, and extraction where data must stay local
- Fine-tuning a small, license-friendly base model for a domain-specific task
- Cost-controlled inference at scale by running open weights on your own GPUs instead of paying per-token API fees
- Research and experimentation that requires full access to model weights and architecture
- Lightweight chat assistants and coding helpers on modest hardware (2B/9B)

## How to access

- [Hugging Face](https://huggingface.co/google/gemma-2-27b-it) — model id `google/gemma-2-27b-it`
- [Hugging Face](https://huggingface.co/google/gemma-2-9b-it) — model id `google/gemma-2-9b-it`
- [Google AI for Developers](https://ai.google.dev/gemma/docs/core/model_card_2) — model id `gemma-2`

## Gemma (open weights) versions

- [Gemma 4](https://ai-tldr.dev/models/gemma-4/) (2 April 2026)
- [Gemma 3n](https://ai-tldr.dev/models/gemma-3n/) (26 June 2025)
- [Gemma 3](https://ai-tldr.dev/models/gemma-3/) (12 March 2025)
- Gemma 2 (27 June 2024) — this page
- [Gemma 1](https://ai-tldr.dev/models/gemma-1/) (21 February 2024)

## FAQ

### Is Gemma 2 open source?

Gemma 2 is open weights, but not open source in the strict OSI sense. Google publishes the model weights for free download and allows commercial use, fine-tuning, and redistribution under the custom Gemma license (Gemma Terms of Use). That license is more permissive than many, but it is not Apache 2.0 and carries a prohibited-use policy, so it is not an OSI-approved open-source license.

### What sizes does Gemma 2 come in?

Three parameter sizes: 2B (2.6B), 9B, and 27B. The 9B and 27B launched on June 27, 2024, and the 2B variant followed on July 31, 2024. Each size has a pretrained base model and an instruction-tuned (-it) chat model.

### What is Gemma 2's context window?

Gemma 2 has an 8,192-token context window. The architecture alternates local sliding-window attention (a 4,096-token window) with full global attention across the full 8,192 tokens, which keeps inference efficient.

### Is Gemma 2 still worth using in 2026?

Google has released Gemma 3 (2025) and Gemma 4 (2026), which add multimodality, larger context, and multilingual support, so Gemma 2 is no longer the latest generation. But its weights remain published and it is still a practical choice for lightweight, self-hosted, English-only text tasks — especially the 2B and 9B models, which run on a single consumer GPU or laptop.

## Links

- [Google launches Gemma 2 (official announcement)](https://blog.google/technology/developers/google-gemma-2/)
- [Gemma 2 model card (Google AI for Developers)](https://ai.google.dev/gemma/docs/core/model_card_2)
- [Welcome Gemma 2 — Google's new open LLM (Hugging Face)](https://huggingface.co/blog/gemma2)
- [gemma-2-27b-it on Hugging Face (benchmarks + weights)](https://huggingface.co/google/gemma-2-27b-it)
- [gemma-2-9b on Hugging Face (benchmarks + weights)](https://huggingface.co/google/gemma-2-9b)
- [Gemma explained: What's new in Gemma 2 (Google Developers Blog)](https://developers.googleblog.com/en/gemma-explained-new-in-gemma-2/)
- [Gemma releases / version history](https://ai.google.dev/gemma/docs/releases)

Source: AI/TLDR LLM registry, https://ai-tldr.dev/models/gemma-2/
