Google releases EmbeddingGemma 2 for on-device multimodal embeddings

EmbeddingGemma 2 is an open 740M parameter model that maps text, code, images, video, and audio into a unified vector space for local RAG and semantic search.

cpaua3 min1
Google releases EmbeddingGemma 2 for on-device multimodal embeddings

Google has launched EmbeddingGemma 2, an open multimodal embedding model designed to map text, code, images, video, and audio into a single 768-dimensional vector space. Built on the Gemma 4 architecture and released under the Apache 2.0 license, the model is optimized for on-device inference on consumer hardware like laptops and mobile devices. This allows developers to build privacy-focused retrieval augmented generation (RAG) pipelines and cross-modal search tools that operate entirely offline.

Modular architecture and on-device resource usage

The model consists of 740 million total parameters but uses a modular design to reduce memory overhead. It combines a 270M parameter text backbone with optional encoders for vision (170M) and audio (300M), allowing developers to load only the necessary modalities for a specific task.

On a Google Pixel 11 Pro with quantization, the model requires approximately 191MB of active RAM for text-only weights and 567MB for the full multimodal configuration. It features an 8K token context window, which is four times larger than the first version, enabling the processing of up to 5.5 minutes of audio or 58 video frames on local hardware.

Performance gains in code and multimodal tasks

EmbeddingGemma 2 improves code performance by 9.92 points on the MTEB Code benchmark, rising from 68.76 to 78.68. This makes it suitable for local codebase indexing and semantic code search. The model matches the multilingual text performance of its predecessor while outperforming some specialized models that are more than twice its size.

When paired with generative models like Gemini 4 Hydrogen, it enables on-device RAG pipelines. Because both models share the same text tokenizer and audio encoder, they can run together with a lower combined memory footprint.

Vector storage reduction via Matryoshka Learning

The model implements Matryoshka Representation Learning (MRL), which allows developers to truncate output vectors from 768 dimensions down to 512, 256, or 128. This capability provides up to a 6x reduction in storage for local vector databases with minimal impact on quality down to 256 dimensions.

To maintain ranking quality during truncation, vectors must be L2-normalized before calculating cosine similarity. The 128-dimension setting is recommended specifically for text-only workloads, as it degrades multimodal quality more substantially.

Deployment and implementation requirements

The model is available on Hugging Face and Kaggle and can be served using tools such as vLLM, llama.cpp, Ollama, and LMStudio. For optimal results, Google recommends running inference in bfloat16 or float32, as float16 can lead to NaN values or degraded embeddings due to the model's activation range.

bash
pip install -U sentence-transformers transformers

To improve precision, the model uses task-specific instruction prefixes for text inputs. For example, asymmetric tasks like web search require a SearchQuery prefix for queries and a specific format for documents: title: {title} | text: {content}.

python
from sentence_transformers import SentenceTransformer

model = SentenceTransformer("google/embeddinggemma-2")

query = "What causes the northern lights?"
document = "The northern lights are caused by charged particles from the sun."

query_emb = model.encode(query, prompt_name="SearchQuery")
doc_emb = model.encode(document, prompt_name="Document")
print(model.similarity(query_emb, doc_emb))

Related reading

Sources

EmbeddingGemma 2 is a best-in-class open model for natively multimodal embeddings

Hugging Facegoogle/embeddinggemma-2huggingface.co/google/embeddinggemma-2Hugging Faceunsloth/embeddinggemma-2-GGUFhuggingface.co/unsloth/embeddinggemma-2-GGUF
Share

Author

cpaua

VibeCode blog admin. Writing about vibe coding, AI and open source.

Related news

Comments

To leave a comment, log in
Loading...

Weekly digest

The best of vibe coding, AI agents and open source — once a week, no spam.