---
title: "Google releases Gemma 2 2B, ShieldGemma and Gemma Scope"
description: "Google added three models to the Gemma 2 family. Gemma 2 2B is a 2.6B-parameter on-device model, ShieldGemma is a set of 2B/9B/27B safety classifiers for filtering LLM inputs and outputs, and Gemma Scope is a suite of sparse autoencoders for interpretability on Gemma 2 2B and 9B."
url: "https://swe.quest/articles/google-releases-gemma-2-2b-shieldgemma-and-gemma-scope-1ba5ffe0e14dd40f"
canonical: "https://huggingface.co/blog/gemma-july-update"
source: "Hugging Face"
published: "2024-07-31"
difficulty: "medium"
kind: "Announcement"
reading_minutes: 11
tags: ["llms","inference","ai-safety","evals"]
---

# Google releases Gemma 2 2B, ShieldGemma and Gemma Scope

A post on [Hugging Face](https://swe.quest/sources/hugging-face.md), published 2024-07-31, 11 min read, Announcement. Original: [https://huggingface.co/blog/gemma-july-update](https://huggingface.co/blog/gemma-july-update)

## Summary

Google added three models to the Gemma 2 family. Gemma 2 2B is a 2.6B-parameter on-device model, ShieldGemma is a set of 2B/9B/27B safety classifiers for filtering LLM inputs and outputs, and Gemma Scope is a suite of sparse autoencoders for interpretability on Gemma 2 2B and 9B. The post includes usage code for Transformers and llama.cpp, the instruct prompt format, and Open LLM Leaderboard and moderation benchmark results. It also shows how to use the 2B model as an assistant for speculative decoding with Gemma 2 27B, recommending assistants 10–100x smaller than the target for up to a 3x speedup without quality loss.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [LLMs](https://swe.quest/tags/llms.md) (AI & ML)
- [Inference & serving](https://swe.quest/tags/inference.md) (AI & ML)
- [AI safety](https://swe.quest/tags/ai-safety.md) (AI & ML)
- [Evaluation](https://swe.quest/tags/evals.md) (AI & ML)

## Prerequisites

- Hugging Face Transformers
- LLM inference basics ([easy posts on Inference & serving](https://swe.quest/tags/inference.md?difficulty=easy))

## Keywords

Gemma 2, ShieldGemma, Gemma Scope, Hugging Face Transformers, llama.cpp, speculative decoding, sparse autoencoders, SAELens

## Related posts

- [Welcome Gemma - Google’s new open LLM](https://swe.quest/articles/welcome-gemma-google-s-new-open-llm-a7d68dd269473a81.md): Hugging Face · 2024-02-21 · Medium · 9 min read · LLMs, Inference & serving, Model training, Python
  Google's Gemma open LLM family ships in 2B and 7B sizes, each with base and instruction-tuned variants and an 8K context.
- [Welcome Gemma 2 - Google’s new open LLM](https://swe.quest/articles/welcome-gemma-2-google-s-new-open-llm-cda5c001e5cdbd53.md): Hugging Face · 2024-06-27 · Medium · 11 min read · LLMs, Model training, Inference & serving
  Gemma 2 ships in 9B and 27B sizes (base and instruction-tuned) with an 8K context, trained on 8T and 13T tokens respectively.
- [Welcome Gemma 3: Google's all new multimodal, multilingual, long context open LLM](https://swe.quest/articles/welcome-gemma-3-google-s-all-new-multimodal-multilingual-long-context-open-llm-9610089c9e0bc05e.md): Hugging Face · 2025-03-12 · Medium · 13 min read · LLMs, Inference & serving, Computer vision, Python
  Gemma 3 is Google's open-weight model family in 1B, 4B, 12B and 27B sizes, with 128k context (32k for 1B), image input via a SigLIP encoder on the 4B and larger models, and support for 140+ languages.
- [Welcome PaliGemma 2 – New vision language models by Google](https://swe.quest/articles/welcome-paligemma-2-new-vision-language-models-by-google-24dd8ece5058fbe9.md): Hugging Face · 2024-12-05 · Medium · 9 min read · Computer vision, LLMs, Model training, Inference & serving
  PaliGemma 2 pairs Google's SigLIP image encoder with Gemma 2 text decoders, shipping pre-trained vision language models at 3B, 10B and 28B parameters, each at 224, 448 and 896 pixel input resolutions, plus 3B and 10B checkpoints fine-tuned on DOCCI for detailed captioning.
- [Gemma 3n fully available in the open-source ecosystem!](https://swe.quest/articles/gemma-3n-fully-available-in-the-open-source-ecosystem-6d60bf60e354184a.md): Hugging Face · 2025-06-26 · Medium · 9 min read · LLMs, Inference & serving, Computer vision, Speech & audio, Python
  Gemma 3n, Google's natively multimodal on-device model accepting text, image, audio and video, now runs in transformers, timm, MLX, llama.cpp (text only), Transformers.js/ONNX and Ollama.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
