
One embedding model for text, code, images, video, and audio - in under 750M parameters.
⠀
Google DeepMind's Gemma team just released EmbeddingGemma 2, an open multimodal embedding model that maps every modality (and interleaved combinations of them) into a single unified vector space. The interesting part is how it's built.
⠀
Under the hood:
⠀
The architecture is modular: a 271M-parameter bidirectional transformer backbone, a 167M vision encoder (a ViT with patch size 16), and a 305M audio encoder based on the Universal Speech Model's conformer design. Because the modality encoders independently convert media into soft tokens before entering the shared backbone, you can load only what you need - 271M for text-only, 439M for vision-language, 577M for audio-language.
⠀
Text is tokenized normally; images are compressed to a configurable budget of 70 to 1120 vision tokens; audio is processed in 40ms chunks yielding 25 soft tokens per second; video is sampled at 1 fps with frames optionally interleaved with audio segments and timestamps. Everything flows through the same bidirectional transformer, gets mean-pooled, projected, and normalized into a 768-dimensional embedding - truncatable to 512, 256, or 128 dims via Matryoshka Representation Learning.
⠀
Training is a three-stage curriculum (~2.9T tokens total): text-only pre-finetuning driven almost entirely by distillation from the much larger Gemini Embedding 2, then multimodal pre-finetuning with pure distillation, then a finetuning stage that drops distillation entirely in favor of contrastive learning plus a spread-out regularizer - letting the model escape its teacher's embedding geometry and learn a space tailored to its own size. The final model merges checkpoints from different points along the same finetuning run.
⠀
Clever simplification: instead of Gemma's dedicated per-layer embedding lookup table, they derive per-layer inputs directly from the shared input embeddings. Fewer parameters, and the ablations show it actually improves quality across modalities.
⠀
Why it matters: it sets a new Pareto frontier across text, code, image, video, document, and audio benchmarks, often beating models 2 to 12x larger - and landing within 2 points of a 28x larger model on code retrieval. Native audio embedding beats an ASR-then-embed pipeline by a wide margin. With quantization-aware training, the full multimodal model runs in ~567 MB on a phone (191 MB text-only).
⠀
Small, open, and genuinely any-to-any. Worth a read for anyone building retrieval or RAG systems.