HomeArtificial IntelligenceGoogle Gemma 4 Explained: 4 Open Models Under Apache 2.0

Google Gemma 4 Explained: 4 Open Models Under Apache 2.0

Last updated: April 2026

Google Gemma 4 is a family of four open-weight AI models released on April 2, 2026 under the Apache 2.0 license. Built from the same research as Gemini 3, the lineup spans from a 2-billion-parameter edge model that runs on a phone to a 31-billion-parameter dense model that ranks #3 among all open models on Arena AI. The switch from Google’s restrictive Gemma license to Apache 2.0 removes all commercial use restrictions, making it the most permissive major open model release of 2026.

Open-Weight AI Apache 2.0 On-Device AI Google DeepMind

What is Gemma 4 and why does it matter?

Gemma 4 is Google DeepMind’s fourth-generation open-weight large language model family. It ships in four sizes — from a 2B-parameter model that fits on a Raspberry Pi to a 31B-parameter dense model that competes with systems 20× its size on standard benchmarks. Everything runs under the commercially permissive Apache 2.0 license, which is a massive shift from the previous Gemma license that included usage restrictions and the right for Google to revoke access.

The timing isn’t accidental. Chinese open-weight models from Moonshot AI, Alibaba (Qwen), and Z.AI have been closing the gap with frontier proprietary models throughout early 2026. Google’s answer: release its strongest open model family yet and remove every licensing barrier standing between enterprises and deployment. Gemma has already crossed 400 million downloads and 100,000 community-built variants — Gemma 4 is designed to accelerate that ecosystem.

What are the four Gemma 4 models?

Model Actual Params Effective Params Architecture Context Window Target Hardware
Gemma 4 E2B 5.1B ~2.3B Dense + PLE 128K Phones, Raspberry Pi, Jetson Nano
Gemma 4 E4B 8B ~4.5B Dense + PLE 128K Phones, tablets, edge devices
Gemma 4 26B MoE 26B 3.8B active Mixture of Experts (128 experts) 256K Consumer GPUs, laptops
Gemma 4 31B Dense 31B 31B Dense 256K Workstations, servers, cloud

The “E” prefix stands for Effective parameters. This is where it gets interesting: E2B and E4B use a technique called Per-Layer Embeddings (PLE) that feeds a secondary embedding signal into every decoder layer. The models physically contain 5.1B and 8B parameters, but PLE reduces compute and memory to the equivalent of 2.3B and 4.5B — meaning they run on phones while punching well above their weight class.

The 26B MoE variant uses 128 expert sub-networks but activates only a subset (totaling ~3.8B parameters) per token. This makes it dramatically faster than a 26B dense model at inference time — ideal for applications where latency matters more than squeezing out the last percentage point of quality.

How does Gemma 4 architecture work under the hood?

Gemma 4 introduces several architectural innovations that separate it from previous open model releases. If you’re familiar with transformer architecture, these are the key departures:

Alternating attention. Layers alternate between local sliding-window attention (512–1,024 tokens) and global full-context attention. This means the model processes nearby tokens cheaply while still maintaining long-range understanding across the full 256K context window. It’s a direct efficiency trade-off: instead of computing full attention at every layer (which scales quadratically), most layers only look at local context.

Dual RoPE (Rotary Position Embeddings). Standard RoPE handles the sliding-window layers, while proportional RoPE handles global layers. This dual approach is what makes the 256K context window work without the quality degradation that plagues other long-context models.

Shared KV cache. Later layers reuse key-value tensors computed by earlier layers, cutting both memory usage and compute during inference. This is particularly valuable for the edge models where every megabyte of RAM counts.

Multimodal encoders. A learned 2D position encoder with multidimensional RoPE handles vision (preserving original aspect ratios with configurable token budgets of 70–1,120 tokens per image). Audio processing uses a USM-style conformer encoder supporting up to 30 seconds of input on edge models. This means Gemma 4 natively handles text, images, and audio — no external preprocessing pipeline needed.

What does the Apache 2.0 license actually change?

This is arguably the biggest story here, not the benchmarks. Previous Gemma models shipped under Google’s custom Gemma License, which included restrictions on certain use cases and reserved Google’s right to terminate access if you violated the terms. Apache 2.0 removes all of that:

What Apache 2.0 means in practice

No monthly active user caps. No acceptable-use policy enforcement by Google. No risk of Google revoking your license. Full freedom for sovereign deployments, commercial products, and fine-tuning without permission. Same license used by Qwen 3.5 — and more permissive than Llama 4’s community license.

For enterprises, this licensing clarity matters as much as benchmark performance. An organization building a product on Gemma 4 now has zero risk of Google pulling the rug out. Combined with the EU AI Act requirements pushing toward transparency and auditability, open-weight models under permissive licenses are becoming the default enterprise choice in regulated industries.

How does Gemma 4 perform compared to other open models?

Google positions the 31B Dense variant as the #3 open model worldwide on the Arena AI text leaderboard. The 26B MoE ranks #6. More impressively, Google claims the smaller models outcompete systems 20× their size on reasoning and coding tasks — though as always, vendor-supplied benchmarks deserve healthy skepticism.

What’s objectively verifiable: the 31B model runs unquantized at FP16 on a single 80GB H100, and at 4-bit quantization it fits on a 24GB consumer GPU like an NVIDIA RTX 4090 or AMD RX 7900 XTX. If you’ve been following the machine learning space in 2026, you know this hardware accessibility is what actually drives adoption — not abstract benchmark scores.

The real comparison to watch is Gemma 4 31B vs. Llama 4 Scout (109B total, 17B active) and Qwen 3.5 72B. The 31B dense is significantly smaller but claims competitive reasoning performance. Independent community benchmarks over the next few weeks will settle this.

How to run Gemma 4 locally — a practical guide

One of Gemma 4’s strongest selling points is deployment flexibility. Day-one support covers more than a dozen inference frameworks. Here’s what each path looks like:

Bash — Ollama (quickest start)
# Pull and run the 31B instruction-tuned model
ollama pull gemma4:31b-it
ollama run gemma4:31b-it

# For the edge model (runs on 8GB RAM)
ollama pull gemma4:e4b-it
ollama run gemma4:e4b-it
Python — Hugging Face Transformers
from transformers import AutoTokenizer, AutoModelForCausalLM
import torch

model_id = "google/gemma-4-31B-it"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
    model_id,
    torch_dtype=torch.bfloat16,
    device_map="auto",
)

messages = [{"role": "user", "content": "Explain mixture of experts in 3 sentences."}]
inputs = tokenizer.apply_chat_template(messages, return_tensors="pt").to(model.device)
outputs = model.generate(inputs, max_new_tokens=256)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
Python — vLLM (production serving)
# Serve Gemma 4 31B with vLLM for high-throughput inference
vllm serve google/gemma-4-31B-it \
  --tensor-parallel-size 2 \
  --max-model-len 131072 \
  --dtype bfloat16

The models are also available directly in Google AI Studio (31B and 26B MoE) and Google AI Edge Gallery (E4B and E2B). Weights can be downloaded from Hugging Face, Kaggle, or Ollama. Framework support at launch includes vLLM, SGLang, llama.cpp, MLX (Apple Silicon), LM Studio, and transformers.js for in-browser inference.

What does Gemma 4 mean for AI agents and agentic workflows?

Google explicitly positions Gemma 4 as an agentic AI model. The key capabilities that enable this are native function calling, structured output generation, and chain-of-thought reasoning — all built into the instruction-tuned variants.

The practical implication: developers can now build MCP-compatible autonomous agents that run entirely on-device. The E4B model with its 128K context window can process long documents, maintain multi-turn conversations, and execute tool calls — all offline, on a smartphone. Google has explicitly stated that code written for Gemma 4 today will be forward-compatible with Gemini Nano 4 when it ships on Pixel devices later in 2026.

Google’s Agent Development Kit (ADK) already supports Gemma 4, providing a framework for building multi-step agents with reasoning, tool use, and structured outputs. This is Google’s answer to the agentic ecosystem that has been building around proprietary models — now anyone can build production agents without API costs or latency.

How does Gemma 4 fit into the broader open model landscape in 2026?

The open-weight AI space in 2026 is vastly more competitive than even 12 months ago. The key players and their positioning:

Gemma 4 (Google) — Apache 2.0, strongest edge/on-device play, 4 model sizes, multimodal. The licensing is the most permissive among major releases.

Llama 4 (Meta) — Community license with MAU caps and usage restrictions. Larger models (Scout at 109B total) but less deployment flexibility due to licensing constraints.

Qwen 3.5 (Alibaba) — Apache 2.0, strong multilingual performance, competitive at larger parameter counts. The main competitor to Gemma 4 on licensing terms.

Moonshot/Z.AI models — Rapidly closing the gap with frontier models, but with less ecosystem support and more limited documentation.

The trend is clear: Apache 2.0 is becoming the standard for serious open model releases. Google and Alibaba both understand that the licensing moat matters more than marginal benchmark advantages. Enterprises will choose the model they can deploy without legal review — and Apache 2.0 models pass that test immediately.

For a deeper look at how LoRA fine-tuning applies to these models, or how RAG architectures can extend their capabilities beyond the training data, the DTF AI Core cluster covers these patterns in detail.

What should developers actually do with this?

Here’s the honest take — and this is where we depart from the press releases. Gemma 4 doesn’t revolutionize what’s possible in AI. What it does is make high-quality AI dramatically more accessible:

The real value proposition

If you were paying $0.01–$0.03 per 1K tokens for API-based inference, Gemma 4 31B on a single GPU gives you equivalent quality at a fraction of the ongoing cost. If you were building mobile AI features that required cloud roundtrips, E4B running locally eliminates latency entirely. The model isn’t the innovation — the deployment economics are.

Three concrete use cases worth exploring immediately:

1. On-device AI assistants. E4B with 128K context, multimodal input, and offline operation is production-ready for mobile apps that process documents, images, or voice — without sending user data to the cloud. Privacy-first AI applications just became viable at scale.

2. Self-hosted enterprise inference. The 31B model on a single H100 (or 4-bit on a 4090) gives mid-size companies a viable alternative to API subscriptions. Combined with context engineering techniques, this covers most internal tooling and automation needs.

3. Fine-tuned domain specialists. Apache 2.0 means you can fine-tune, distill, and redistribute without restrictions. Expect an explosion of Gemma 4-based vertical models in legal, medical, and financial domains within weeks of release.

Gemma 4 Model Family — Size vs. Target Hardware Diagram showing the four Gemma 4 models (E2B, E4B, 26B MoE, 31B Dense) mapped to their target hardware — from phones and Raspberry Pi to cloud GPUs — with parameter counts and context windows. Gemma 4 Model Family Map DecodeTheFuture.org Gemma 4, open-weight AI, on-device AI, model architecture, Per-Layer Embeddings Visual overview of Google Gemma 4’s four model sizes and their deployment targets. Diagram image/svg+xml en © DecodeTheFuture.org Gemma 4 — Model × Hardware Map Edge Cloud E2B — Effective 2B 5.1B actual → 2.3B effective (PLE) 128K context · Multimodal · Audio 📱 Phones · Raspberry Pi · Jetson Nano E4B — Effective 4B 8B actual → 4.5B effective (PLE) 128K context · Multimodal · Audio 📱 Phones · Tablets · Edge AI 26B MoE — 128 Experts 26B total · 3.8B active per token 256K context · Arena AI #6 Open 💻 Consumer GPUs · Laptops · Notebooks 31B Dense — Flagship 31B full dense · FP16 on single H100 256K context · Arena AI #3 Open 🖥️ Workstations · Cloud · 4-bit on RTX 4090 All Apache 2.0 Licensed

FAQ

Is Gemma 4 truly open-source?

Gemma 4 is open-weight, not open-source in the strictest sense — Google has released the model weights and inference code under Apache 2.0, but hasn’t published the training data or full training pipeline. However, Apache 2.0 is about as permissive as it gets: you can use, modify, fine-tune, and commercially distribute the models without restrictions.

Can Gemma 4 run on my phone?

Yes — the E2B and E4B models are specifically designed for on-device inference. They run on Android phones with AI accelerators from Google, Qualcomm, and MediaTek. Google’s AICore Developer Preview gives you access today, and code written for Gemma 4 will be forward-compatible with Gemini Nano 4 later in 2026.

What GPU do I need for Gemma 4 31B?

At full FP16 precision, the 31B model fits on a single 80GB GPU (like an NVIDIA H100). At 4-bit quantization, it fits on a 24GB consumer GPU — an NVIDIA RTX 4090 or AMD RX 7900 XTX. The 26B MoE variant is even more efficient since it only activates 3.8B parameters per token.

What’s the difference between Gemma and Gemini?

Gemini is Google’s proprietary, closed-source frontier model (currently Gemini 3). Gemma is the open-weight derivative built from the same underlying research. Gemma 4 shares the architectural DNA of Gemini 3 but is smaller, independently deployable, and available under Apache 2.0 for anyone to use.

What are Per-Layer Embeddings (PLE)?

PLE is a technique used in Gemma 4’s edge models (E2B, E4B) where a secondary embedding signal is injected into every decoder layer. This allows the model to maintain quality while drastically reducing the effective compute and memory footprint — E2B has 5.1B actual parameters but only ~2.3B effective parameters during inference.

How does Gemma 4 compare to Llama 4?

Gemma 4’s biggest advantage is licensing: Apache 2.0 vs. Llama 4’s community license which includes MAU caps and usage restrictions. In terms of raw capability, Llama 4 Scout (109B total, 17B active) may edge out Gemma 4 31B on some tasks, but Gemma 4’s edge models (E2B, E4B) have no direct Llama equivalent — Meta doesn’t offer comparable on-device models.

Where can I download Gemma 4?

Model weights are available on Hugging Face (google/gemma-4-31B-it, google/gemma-4-26B-A4B-it, google/gemma-4-E4B-it, google/gemma-4-E2B-it), Kaggle, and Ollama. You can also access them directly through Google AI Studio (larger models) or Google AI Edge Gallery (edge models).

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -

Most Popular

Recent Comments