★ Reading this for free? Get 25 structured AI courses + per-chapter AI tutor — the first chapter of every course free, no card.Start free in 30 secondsOr own every course: $149 once

Google Gemma 7B: 64% MMLU from DeepMind

Built on the same research as Gemini. 7B parameters, 8K context, a 5.0GB Ollama download at Q4. Released February 2024 by Google DeepMind. Succeeded by Gemma 2.

Last Updated: November 2, 2026

Technical Specifications Overview

-Parameters: 7 billion
-Context Window: 8,192 tokens
-Vocabulary: 256K tokens (SentencePiece)
-Training Data: 6 trillion tokens (web, code, math)
-Architecture: Decoder-only transformer (Gemini-based)
-License: Gemma Terms of Use (commercial OK)
-Release Date: February 21, 2024
-Ollama: ollama run gemma:7b

Google Gemma 7B Architecture

Decoder-only transformer with Multi-Query Attention, RoPE embeddings, and RMSNorm — built on Gemini research

👤
You
💻
Your ComputerAI Processing
👤
🌐
🏢
Cloud AI: You → Internet → Company Servers

Google DeepMind Architecture: Relationship to Gemini

Gemma 7B was released by Google DeepMind on February 21, 2024, built using the same research and technology as the Gemini family of models. The name "Gemma" comes from the Latin for "gem" — reflecting its position as a smaller, open version of Google's proprietary Gemini technology. It was trained on 6 trillion tokens from web documents, code, and mathematical text.

Key Architectural Features from Gemini

  • Multi-Query Attention (MQA): Unlike standard multi-head attention where each head has its own key/value projections, Gemma uses multi-query attention where all heads share a single key-value pair. This reduces memory bandwidth during inference, enabling faster generation on consumer GPUs.
  • RMSNorm Pre-Normalization: Gemma applies Root Mean Square Layer Normalization before each attention and feed-forward block (pre-norm style), rather than post-normalization. This improves training stability and was adopted from the Gemini architecture.
  • RoPE Embeddings: Rotary Position Embeddings encode positional information directly into the attention mechanism, supporting the 8,192 token context window without fixed positional encodings.
  • GeGLU Activation: Uses Gated Linear Unit with GELU activation in the feed-forward layers, which provides better gradient flow compared to standard ReLU or GELU alone.
  • SentencePiece Tokenizer: 256K vocabulary size — significantly larger than Llama 2's 32K vocabulary. This reduces the number of tokens needed to represent text, improving effective context length and multilingual capability.

Research Papers and References

Real Benchmark Results

Data source: All benchmark scores below are from Google's Gemma technical report (arXiv:2403.08295), Table 6, except TruthfulQA, which is from its HuggingFace H6 table (Table 7). MMLU is 5-shot, HellaSwag is 0-shot, GSM8K is maj@1. Google notes the Llama 2 figures are as reported by Meta. This site has not run these benchmarks.

MMLU Score: 7B Model Comparison

MMLU Accuracy (%)

Qwen 2.5 7B74.2 % Accuracy
74.2
Gemma 7B64.3 % Accuracy
64.3
Mistral 7B62.5 % Accuracy
62.5
Phi-2 (2.7B)56.7 % Accuracy
56.7
Llama 2 7B45.3 % Accuracy
45.3

MMLU (Massive Multitask Language Understanding) measures broad knowledge across 57 subjects. Higher is better.

Multi-Benchmark Capability Profile

Performance Metrics

MMLU (64.3%)
64
HellaSwag (81.2%)
81
ARC-C (53.2%)
53
GSM8K (46.4%)
46
Winogrande (72.3%)
72
TruthfulQA (44.8%)
45

Scores from Google's technical report (Tables 6 and 7). GSM8K (math) and TruthfulQA are notably weaker areas.

Detailed Benchmark Breakdown

BenchmarkGemma 7BMistral 7BLlama 2 7BShots
MMLU64.3%62.5%45.3%5-shot
HellaSwag81.2%81.0%77.2%0-shot
ARC-Challenge53.2%54.9%45.9%as reported
GSM8K46.4%35.4%14.6%maj@1
Winogrande72.3%74.2%69.2%partial scoring
TruthfulQA44.8%42.2%Not in the report0-shot (H6)

VRAM & Hardware Requirements

Hardware Requirements by Quantization

System Requirements

▸
Operating System
Windows 10/11, macOS 12+ (Apple Silicon recommended), Linux (Ubuntu 20.04+)
▸
RAM
8GB minimum system RAM, 16GB recommended
▸
Storage
5-17GB depending on quantization level
▸
GPU
Default Q4: 8GB+ VRAM (RTX 3060 12GB, RTX 4060), Q8_0: 12GB+ VRAM (RTX 4070), FP16: 24GB VRAM (RTX 4090)
▸
CPU
8+ core processor for CPU-only inference (Apple M1/M2/M3 recommended for CPU)

Default Q4 (5.0GB file)

  • Best for: Most local users
  • Quality: Minor degradation vs FP16
  • Speed: ~72 tok/s ceiling on an RTX 3060 12GB (360 GB/s)
  • GPU: 8GB+ cards (RTX 3060 12GB, RTX 4060), M1 16GB
  • Command: ollama run gemma:7b

Q8_0 (9.1GB file)

  • Best for: Quality-sensitive tasks
  • Quality: Near-lossless
  • Speed: ~55 tok/s ceiling on an RTX 4070 12GB (504 GB/s)
  • GPU: 12GB+ cards (RTX 4070, RTX 3060 12GB), M1 Pro 16GB
  • Command: ollama run gemma:7b-instruct-q8_0

FP16 (17GB file)

  • Best for: Research, fine-tuning
  • Quality: Full precision
  • Speed: ~59 tok/s ceiling on an RTX 4090 (1,008 GB/s)
  • GPU: RTX 4090 24GB, M2 Ultra
  • Note: Required for fine-tuning

Ollama Installation Guide

1

Install Ollama

Download and install Ollama from ollama.com

$ curl -fsSL https://ollama.com/install.sh | sh
2

Pull Gemma 7B

Download the default Q4 build (5.0GB)

$ ollama pull gemma:7b
3

Run Gemma 7B

Start an interactive chat session

$ ollama run gemma:7b
4

Test with a Prompt

Verify the model responds correctly

$ ollama run gemma:7b "Explain the difference between supervised and unsupervised learning in 3 sentences"
5

Check Model Info

Verify model details and VRAM usage

$ ollama show gemma:7b

Terminal Example

Terminal
$ollama run gemma:7b
# Downloads the default build (5.0 GB) on first run, then opens a chat prompt. >>> Send a message (/? for help)
$ollama run gemma:7b "What is the capital of France?"
# The answer streams into the terminal. # Add --verbose to see your own machine's eval rate (tokens/s).
$_

Alternative: Hugging Face Transformers

Terminal
$pip install torch transformers accelerate
Successfully installed torch-2.2.0 transformers-4.38.0 accelerate-0.27.0
$python3 -c " from transformers import AutoTokenizer, AutoModelForCausalLM import torch tokenizer = AutoTokenizer.from_pretrained('google/gemma-7b') model = AutoModelForCausalLM.from_pretrained( 'google/gemma-7b', device_map='auto', torch_dtype=torch.float16 ) inputs = tokenizer('The future of AI is', return_tensors='pt').to('cuda') outputs = model.generate(**inputs, max_new_tokens=50) print(tokenizer.decode(outputs[0])) "
Loading google/gemma-7b... The future of AI is a topic of great interest and debate. As artificial intelligence continues to advance, we can expect to see significant changes in how we work, learn, and interact with technology...
$_

Note: Hugging Face access requires accepting the Gemma Terms of Use at huggingface.co/google/gemma-7b and setting your HF_TOKEN.

VRAM by Quantization Level

VRAM Usage by Quantization (GB)

Gemma 7B memory needs vary significantly with quantization. Ollama's default 4-bit build is a 5.0 GB download and provides the best balance of quality and resource usage for most local deployments.

QuantizationOllama tagDownload
Default (gemma:7b)gemma:7b5.0 GB
Q4_K_Mgemma:7b-instruct-q4_K_M5.5 GB
Q5_K_Mgemma:7b-instruct-q5_K_M6.3 GB
Q6_Kgemma:7b-instruct-q6_K7.2 GB
Q8_0gemma:7b-instruct-q8_09.1 GB
FP16gemma:7b-instruct-fp1617 GB

Sizes from Ollama's gemma tag list, checked November 2, 2026. Add about 1GB for the KV cache and runtime at the 8K context.

Apple Silicon Performance

  • M1 8GB: default Q4 fits with little to spare, ~14 tok/s ceiling (68 GB/s)
  • M1 Pro 16GB: Q8_0 comfortable, ~22 tok/s ceiling (200 GB/s)
  • M2 Max 32GB: FP16 possible, ~23 tok/s ceiling (400 GB/s)
  • M3 Pro 18GB: Q8_0 with room for context
  • Unified memory: Shared CPU/GPU memory is ideal for LLMs

NVIDIA GPU Performance

  • RTX 3060 12GB: default Q4, ~72 tok/s ceiling (360 GB/s)
  • RTX 3070 8GB: Q4_K_M (5.5GB), ~81 tok/s ceiling (448 GB/s)
  • RTX 3080 10GB: Q6_K (7.2GB), ~106 tok/s ceiling (760 GB/s)
  • RTX 4090 24GB: FP16 with room, ~59 tok/s ceiling (1,008 GB/s)
  • Key: ceilings are bandwidth divided by file size; real speed lands below them

7B Model Comparison (Published Benchmarks)

Local 7B Models: MMLU Comparison

Gemma 7B was strong for its February 2024 release date. However, Qwen 2.5 7B (released September 2024) significantly outperforms it on MMLU. MMLU scores come from the Gemma report (Gemma, Mistral, Llama 2), the Qwen2.5 report and Microsoft's Phi-2 announcement.

ModelSizeOllama downloadSpeed ceiling (RTX 3060 12GB)MMLU (published)Licence
Qwen 2.5 7B7B4.7GB~77 tok/s ceiling74.2%Apache 2.0
Gemma 7B7B5.0GB~72 tok/s ceiling64.3%Gemma ToU
Mistral 7B7B4.4GB~82 tok/s ceiling62.5%Apache 2.0
Phi-2 (2.7B)2.7B1.6GB~225 tok/s ceiling56.7%MIT
Llama 2 7B7B3.8GB~94 tok/s ceiling45.3%Llama 2 License

Speed is an upper bound, not a measurement: an RTX 3060 12GB's 360 GB/s of memory bandwidth divided by each model's default Ollama file. At the smallest sizes compute, not bandwidth, sets the real limit, so Phi-2 will land well below its ceiling.

Honest Assessment

Gemma 7B Strengths

  • - Strong MMLU (64.3%) for a February 2024 7B model
  • - Google DeepMind pedigree and Gemini-derived architecture
  • - 256K vocabulary handles multilingual text efficiently
  • - Permissive commercial license (Gemma Terms of Use)
  • - Well-supported across frameworks (Ollama, HuggingFace, vLLM)

Gemma 7B Weaknesses

  • - Only 8K context window (Mistral 7B has 32K)
  • - Math is only middling: 46.4% GSM8K, well short of newer 7B models
  • - Superseded by Gemma 2 9B which is better in every metric
  • - TruthfulQA score (44.8%) indicates hallucination risk
  • - Qwen 2.5 7B now significantly outperforms it at 74.2% MMLU

Gemma 2 Upgrade Path

Why Upgrade to Gemma 2?

Google released Gemma 2 in July 2024, with models at 2B, 9B, and 27B parameters. For users currently running Gemma 7B, the Gemma 2 9B Instruct model is the natural upgrade path — it offers substantially better performance at similar VRAM cost.

MetricGemma 7BGemma 2 9B ITImprovement
MMLU64.3%71.3%+7 points
Parameters7B9B+2B
Context Window8,1928,192Same
VRAM (Q4)5.0GB5.4GB+0.4GB
Instruction TunedSeparate IT variantBuilt-in ITBetter chat

Migration Command

ollama run gemma2:9b

Drop-in replacement in Ollama. If you have Gemma 7B fine-tunes, you will need to re-fine-tune on the Gemma 2 architecture, as the model structures are not compatible.

Local AI Alternatives

If you are evaluating Gemma 7B for a new project in 2026, consider these alternatives that may better suit your needs.

ModelMMLUVRAM (Q4)ContextLicenseBest For
Gemma 2 9B IT71.3%5.4GB8KGemma ToUDirect Gemma 7B upgrade
Qwen 2.5 7B74.2%4.7GB128KApache 2.0Best 7B overall, long context
Mistral 7B v0.362.5%4.4GB32KApache 2.0Apache license, 32K context
Llama 3.1 8B69.4%4.9GB128KLlama 3.1 LicenseStrong all-rounder, huge context
Phi-3 Mini 3.8B70.9%2.2GB128KMITTiny but strong, MIT license

Recommendation for 2026: If you need a Google model, upgrade to Gemma 2 9B IT. For the strongest 7B-class model with Apache 2.0 license, choose Qwen 2.5 7B. For the best balance of size and capability, Llama 3.1 8B is excellent.

Resources & Further Reading

Official Google Resources

Local Deployment Tools

Gemma 2 Resources

Troubleshooting & Common Issues

Out of Memory (OOM) Errors

Gemma 7B at FP16 is a 17GB file. If you see OOM errors, you are likely trying to load a quantization too large for your GPU.

Solutions:

  • - Use the default 4-bit build (5.0GB): fits an 8GB card with room for context
  • - Close other GPU-intensive applications (browsers with hardware acceleration, games)
  • - On Ollama, the default gemma:7b is already 4-bit — if OOM, your GPU likely has less than 6GB VRAM
  • - For GPUs with 4GB or less VRAM, consider Gemma 2B or Phi-3 Mini instead
  • - On Apple Silicon, check Activity Monitor to ensure enough unified memory is free

Slow Generation Speed

If you are getting less than 10 tokens/second, the model is likely running on CPU instead of GPU.

Solutions:

  • - Verify GPU detection: ollama ps shows which device is in use
  • - Install NVIDIA CUDA toolkit if on Linux with NVIDIA GPU
  • - On macOS, Apple Silicon Metal acceleration is automatic in Ollama
  • - Reduce context length if generation slows over long conversations
  • - Bandwidth ceilings for the 5.0GB default: ~72 tok/s on an RTX 3060 12GB, ~14 tok/s on a base M1, ~18 tok/s CPU-only on dual-channel DDR5-5600; real speed lands below these

Hugging Face Access Denied

Gemma models on Hugging Face require accepting Google's Terms of Use before downloading.

Steps:

  • 1. Visit huggingface.co/google/gemma-7b and accept the license agreement
  • 2. Create a Hugging Face access token at huggingface.co/settings/tokens
  • 3. Set the token: export HF_TOKEN=your_token_here
  • 4. Alternatively, use Ollama which does not require Hugging Face authentication

Frequently Asked Questions

What is Gemma 7B and how is it related to Google Gemini?

Gemma 7B is a 7-billion parameter open model released by Google DeepMind in February 2024. It uses the same research and technology that powers the Gemini models, including Multi-Query Attention and RMSNorm pre-normalization. It scores 64.3% on MMLU and 81.2% on HellaSwag. Unlike Gemini, Gemma weights are freely downloadable for local inference under the Gemma Terms of Use, which permits commercial applications.

How much VRAM does Gemma 7B need to run locally?

It depends on quantization: Ollama's default gemma:7b is a 5.0GB download, Q8_0 is 9.1GB and FP16 (full precision) is 17GB, plus about 1GB for the KV cache and runtime. For most users the default build on an 8GB+ GPU (RTX 3060 12GB, RTX 4060) is the right balance. CPU-only inference works but is limited by system memory bandwidth: dual-channel DDR5-5600 (89.6 GB/s) caps the 5GB file at roughly 18 tokens/second, against a ceiling near 72 tok/s on an RTX 3060 12GB.

How does Gemma 7B compare to Mistral 7B and Llama 2 7B?

In Google's Gemma report, Gemma 7B scores 64.3% on MMLU versus 62.5% for Mistral 7B and 45.3% for Llama 2 7B. It edges Mistral on HellaSwag (81.2% vs 81.0% vs 77.2%) and leads clearly on math (GSM8K 46.4% vs 35.4% vs 14.6%), while Mistral is ahead on ARC-Challenge (54.9% vs 53.2%) and Winogrande. Mistral 7B v0.2 and later have a 32K context window versus Gemma's 8K. Both have been succeeded by stronger models: Gemma 2 and Mistral Nemo.

Should I use Gemma 7B or upgrade to Gemma 2?

For new projects in 2026, Google Gemma 2 9B IT is the recommended choice. It scores significantly higher on benchmarks (71.3% MMLU in the Gemma 2 report) while requiring similar VRAM to Gemma 7B at equivalent quantization levels. Gemma 7B remains useful if you have existing fine-tunes or need the specific 7B architecture. Run Gemma 2 via Ollama with: ollama run gemma2:9b.

Can I use Gemma 7B commercially?

Yes. Gemma 7B is released under the Gemma Terms of Use, which is a permissive license allowing commercial use, fine-tuning, and redistribution. You must include the license notice and cannot use the Gemma name to endorse your products. This is more permissive than Llama 2's license for large-scale commercial deployment. Note: this is NOT Apache 2.0 — it is Google's own Gemma Terms of Use.

Build Real AI on Your Machine

RAG, agents, NLP, vision, and MLOps - chapters across 25 courses that take you from reading about AI to building AI.

Reading now
Join the discussion

Related Guides

Continue your local AI journey with these comprehensive guides

🎯
AI Learning Path

Go from reading about AI to building with AI

25 structured courses. Hands-on projects. Runs on your machine. Start free.

Or own it for life — Lifetime $149 $599, pay once
Barsha Mohapatra

Written by

Barsha Mohapatra

Founder and Editor, Local AI Master · Founder, Little AI Master

Founder of Little AI Master and the editor behind every course and guide on Local AI Master. Years of tutoring students taught her where AI education actually fails.

📅 Published: September 26, 2025🔄 Last Updated: November 2, 2026✓ Manually Reviewed
More on Ollama
See the full Best Ollama Models 2026 guide.
📚
Free · no account required

Grab the AI Starter Kit — career roadmap, cheat sheet, setup guide

No spam. Unsubscribe with one click.

🎯
AI Learning Path

Found your model? Now build something with it.

25 hands-on courses — RAG, agents, fine-tuning — all running locally. First chapter free, no card.

Or own it for life — Lifetime $149 $599, pay once
Free Tools & Calculators