Skip to main content
Back

Google DeepMind's Gemma 3n Runs Full Multimodal AI on 3GB of RAM

Google's mobile-first Gemma 3n E4B-it packs 8B parameters into a 4B memory footprint, adding native audio, video, and 140-language multimodality.

Pro

  • Google's Gemma 3n E4B-it is an 8B multimodal model running in a 4B memory footprint
  • MatFormer nests an E2B sub-model inside E4B, enabling elastic inference from one checkpoint
  • Per-Layer Embeddings offload embedding tables to CPU RAM, cutting VRAM use dramatically
  • Handles text, images, audio, and video across 140+ languages with 32k context
  • Scores 75.0 HumanEval and 64.9 MMLU, but weak on frontier reasoning (23.7 GPQA)
  • Runs on vLLM, SGLang, Ollama, llama.cpp, and mobile devices with 3GB RAM

Google DeepMind's Gemma 3n E4B-it is the instruction-tuned flagship of a new family of open models built to run on phones, laptops, and tablets rather than data-center GPUs. It accepts text, images, audio, and video as input, produces text, and does so within a memory budget that would normally only support a much smaller model.

The E prefix stands for Effective parameters. Raw parameter counts are 5B and 8B for the E2B and E4B variants, but architectural innovations let them run with a memory footprint comparable to traditional 2B and 4B models, using as little as 2GB and 3GB of RAM respectively. A reduced set of active parameters handles any given inference pass, which is what makes the efficiency possible.

One checkpoint, nested sizes

The central architectural bet is MatFormer, short for Matryoshka Transformer. Smaller models are nested inside the larger one, and those sub-models can run inference without activating the enclosing model's full parameter set, reducing compute, latency, and energy draw. The E4B model contains the E2B model's parameters, and you can select intermediate sizes anywhere between 2B and 4B effective parameters.

During training, the 2B sub-model is optimized simultaneously inside the E4B. In practice, that means you ship one checkpoint and choose your compute budget at deployment time. A Mix-n-Match technique adjusts feed-forward network hidden dimensions per layer and can skip entire blocks to fit specific device constraints.

The second major trick is Per-Layer Embeddings. In a standard language model, the token embedding table is a large vocabulary-size-by-hidden-dimension block in VRAM. For a 256,000-token vocabulary at hidden dimension 2048 in bfloat16, that table alone runs roughly 1.05 GB before a single token is processed. PLE offloads those embedding weights from GPU VRAM to the larger, slower CPU RAM, freeing scarce on-device memory for the layers that actually compute.

Inside the architecture

Beyond MatFormer and PLE, the model card and Transformers documentation list several less-advertised components:

  • Alternating Updates (AltUp), Learned Augmented Residual Layer (LAuReL), Activation Sparsity with Statistical Top-k, and KV cache sharing
  • A Gemma 3 attention pattern with 4 local sliding-window self-attention layers per global self-attention layer, up to a 32k token context
  • MobileNet v5 as the vision encoder at 768x768 default resolution, plus a newly trained audio encoder based on the Universal Speech Model (USM) architecture
  • KV cache sharing that Google reports delivers a 2x prefill improvement, which matters for streaming audio and video where time-to-first-token dominates perceived responsiveness

Images normalize to 256x256, 512x512, or 768x768 and encode to 256 tokens each. Audio encodes at 6.25 tokens per second from a single channel. Total context is 32k tokens. The instruction-tuned variant was post-trained with knowledge distillation and reinforcement learning.

Training footprint

The model trained on roughly 11 trillion tokens covering web text, code, math, images, and audio, with a June 2024 knowledge cutoff and over 140 spoken languages. Training ran on TPUv4p, TPUv5p, and TPUv5e hardware using JAX and ML Pathways.

Benchmark results

Selected instruction-tuned scores from the model card:

BenchmarkE2B ITE4B IT
MMLU60.164.9
MMLU Pro40.550.6
HumanEval pass@166.575.0
MBPP pass@156.663.6
LiveCodeBench v518.625.7
MGSM (multilingual math)53.160.7
AIME 20256.711.6
GPQA Diamond24.823.7

Hard reasoning is the clear weakness. AIME 2025 and GPQA Diamond scores are low, and Google has already positioned successor models against both. Gemma 4's E2B/E4B carry the same per-layer-embedding approach but extend context to 128K, shrink the audio encoder by 55%, and reach 58.6% on GPQA Diamond versus 23.7% here. For frontier reasoning tasks, Gemma 3n E4B-it is the wrong tool.

Getting it running

The model is on Hugging Face under the Gemma license (click-through accept) and requires transformers 4.53.0 or later. Basic usage:

from transformers import pipeline
import torch
pipe = pipeline(
    "image-text-to-text",
    model="google/gemma-3n-e4b-it",
    device="cuda",
    torch_dtype=torch.bfloat16,
)
out = pipe(text=messages, max_new_tokens=200)

It also works with vLLM (vllm serve google/gemma-3n-E4B-it), SGLang, Docker Model Runner, and quantized builds for llama.cpp, Ollama, and LM Studio. AMD, NVIDIA, and RedHat tooling is supported, along with deployment via Google AI Studio, Docker, and Cloud Run. Weights are free to download; the cost is your own compute.

Where it fits

The practical sweet spot is anything you would rather not send to a cloud API:

  • On-device voice assistants doing speech recognition and translation, using the USM-based audio encoder
  • Image and short-video understanding on a laptop or phone via the MobileNet v5 vision path
  • Multilingual chat and summarization across 140+ languages without per-token API costs
  • Coding copilots where a HumanEval pass@1 of 75 is sufficient and latency matters more than peak reasoning
  • Custom-sized deployments via MatFormer Lab, where you slice between E2B and E4B to match a specific device's memory budget

A single 8B checkpoint that runs in 3GB, understands audio and video natively, ships nested variants for elastic inference, and offloads embeddings to CPU RAM cuts the default assumption that anything genuinely multimodal must be a cloud call. Even with Gemma 4 already succeeding it, PLE, MatFormer, and KV cache sharing are the template on-device multimodal models are being built on going forward.