嵌入Gemma 2:一个开放的轻量级多式嵌入模型
我们推出去年EmbeddingGemma为高质量文本嵌入提供了轻量级选项,帮助您的应用程序组织,搜索,直接连接消费者硬件的信息。 开发商的反应使我们的期望落空。 拥有超过2000万次下载,建设者利用它为更聪明的端侧搜索工具和隐私首发检索增强生成(RAG)管道提供动力。
今天,我们是发布 EmbeddingGemma 2,它超越文本,EmbeddingGemma 2在商业许可Apache 2.0许可下在Gemma 4架构和发布上建成,拥有7.4亿参数,使得端侧推论最优化。 它可以帮助从语音备忘录中找到具体的视频剪辑,或者通过基于文本查询的几个小时的录音进行搜索,这些录音都是由单一的本土多式联运模式处理的。
由Gemini嵌入型号相同的技术所建,嵌入Gemma 2为:
- 其尺寸最佳:在基准测试(Massive Text Embedding 基准测试)代码和MAEB(Massive Audio Embedding 基准测试)等基准测试(Massive Audio Embedding 基准测试)多模式嵌入器中实现领先分数,同时在文本、视觉和音频任务之间匹配或超过许多更大的模型。
- 设计模式:仅限文本工作量需要270M参数,可选视觉(170M)和音频(300M)编码器,以获得充分的多式联运支持。
- 存储效率:使用 Matryoshka 代表学习(MRL),开发者可以动态切换输出向量,从768维到512,256,或128维。 这为本地矢量数据库和内存使用提供了最多6x的存储减少。
- 端侧性能优化:在紧缺资源范围内高效运行。 通过量子化,在Google像素11 Pro上,EmbeddingGemma 2对文本单重的活性RAM和全多式联运模型的~567MB的要求都很小。
- 扩展上下文准备就绪:设置一个8K令牌上下文窗口(比EmbeddingGemma 1大4x),允许它处理最多5.5分钟的音频、29个图像、58个视频帧,或者直接在本地硬件上进行其间离合。
实现代码、视觉和音频的顶级质量
EmbeddingGemma 2与EmbeddingGemma的强多语言文本性能相匹配,同时对代码性能(在MTEB代码中,从68.76到78.68)做出了显著的9.92分改进,使其非常适合本地代码库索引,语义代码搜索,以及编码agent检索。 在图像、视频、文件和音频方面,它为子-1B模型设定了每参数质量的新标准,甚至超过了一些专家模型的两倍以上。
在EmbeddingGemma 2模式卡中查找完整的评价指标和模型信息。
允许语义搜索、路由和检索,完全端侧
嵌入Gemma 2 带来强力能力直接到边缘硬件。 在当地生成嵌入物有助于确保数据隐私,减少管道延迟,并赋予开发者权力来建立完全离线的跨模式搜索和检索。
当与Gemma 4等基因模型配对时,嵌入Gemma 2使端侧 RAG管道能够理解复杂的多式联运数据。 由于EmbeddingGemma 2是建立在Gemma 4上,并共享其文本代号器和音频编码器,开发人员可以在一个统一的管道中一起运行两种模型,并拥有较低的综合总内存足迹。
为了学习如何用LiteRT构建端侧搜索和RAG系统,阅读Google AI Edge博客帖。
从 EmbeddingGemma 2 开始
我们与下列合作伙伴密切合作,确保EmbeddingGemma 2在你们建设的地方立即工作:
- 下载模型:在Hugging Face和Kaggle上查找模型重量,而Gemini Enterprise Agent平台模型花园的可用性很快就来了。 访问Hugging Face上的LiteRT社区,为端侧优化的模型。
- 端侧部署:开发带有Google AI Edge MediaPipe的跨平台应用程序,用于统包嵌入,检索和决定任务,或用于自定义模型集成的LiteRT. 用变压器.js或WebGPU为浏览器构建。
- 使用你最喜欢的开发工具:高效地使用变压器,句式变压器,MLX,vLLM,llama.cpp,SGLang,Ollama,和LMStudio来服务模型。 用 Qdrant 存储嵌入向量。
- 微调:遵循Unsloth的指引,如何将微调 EmbeddingGemma 2用于您的使用案例。
探索我们的开发者指南,文档,推论指南和微调。
本文由 AI图鉴自动抓取并翻译,版权归原作者所有;如需查看原文请点下方链接。
EmbeddingGemma 2: an open, lightweight multimodal embedding model
We introduced EmbeddingGemma last year to provide a lightweight option for high-quality text embeddings, to help your apps organize, search, and connect information directly on consumer hardware. The developer community’s response blew past our expectations. With more than 20 million downloads, builders have used it to power smarter on-device search tools and privacy-first retrieval augmented generation (RAG) pipelines.
Today, we’re launching EmbeddingGemma 2, expanding beyond text to unify code, images, video, and audio in a shared embedding space. Built on the Gemma 4 architecture and released under a commercially permissive Apache 2.0 license, EmbeddingGemma 2 has 740 million parameters, making it optimal for on-device inference. It can help find a specific video clip from a voice memo, or search through hours of audio recordings based on a text query, all processed by a single, natively multimodal model.
Built from the same technology as Gemini Embedding models, EmbeddingGemma 2 is:
- Best-in-class for its size: Achieves leading scores among sub-1B multimodal embedders for its size across benchmarks like MTEB (Massive Text Embedding Benchmark) Code and MAEB (Massive Audio Embedding Benchmark), while matching or outperforming many larger models across text, vision, and audio tasks.
- Modular by design: Requires as little as 270M parameters for text-only workloads with optional vision (170M) and audio (300M) encoders for full multimodal support.
- Storage-efficient: Using Matryoshka Representation Learning (MRL), developers can dynamically truncate output vectors from 768 dimensions down to 512, 256, or 128 dimensions. This provides up to 6x storage reduction for local vector databases and memory usage.
- Optimized for on-device performance: Runs efficiently within tight resource constraints. With quantization, on a Google Pixel 11 Pro, EmbeddingGemma 2 requires as little as ~191MB active RAM for text-only weights and ~567MB for the full multimodal model.
- Extended context ready: Features an 8K token context window (4x larger than EmbeddingGemma 1), allowing it to process up to 5.5 minutes of audio, 29 images, 58 video frames, or interleaved combinations thereof directly on local hardware.
Achieving top-tier quality for code, vision, and audio
EmbeddingGemma 2 matches the strong multilingual text performance of EmbeddingGemma while delivering a significant 9.92-point improvement on code performance (in MTEB Code, from 68.76 to 78.68), making it well-suited for local codebase indexing, semantic code search, and coding agent retrieval. Across image, video, documents, and audio, it sets a new standard in quality-per-parameter for sub-1B models and even outperforms some specialist models more than twice its size.
Find full evaluation metrics and model information in the EmbeddingGemma 2 model card.
Enabling semantic search, routing, and retrieval, fully on-device
EmbeddingGemma 2 brings robust capabilities directly to edge hardware. Generating embeddings locally helps ensure data privacy, reduces pipeline latency, and empowers developers to build cross-modal search and retrieval that works entirely offline.
When paired with generative models such as Gemma 4, EmbeddingGemma 2 enables on-device RAG pipelines that understand complex multimodal data. Because EmbeddingGemma 2 is built on Gemma 4 and shares its text tokenizer and audio encoder, developers can run both models together in a unified pipeline with a lower combined total memory footprint.
To learn how to build on-device search and RAG systems with LiteRT, read the Google AI Edge blog post.
Getting started with EmbeddingGemma 2
We worked closely with the following partners to ensure EmbeddingGemma 2 works immediately where you build:
- Download the models: Find the model weights on Hugging Face and Kaggle, with Gemini Enterprise Agent Platform Model Garden availability coming soon. Visit LiteRT Community on Hugging Face for models optimized for on-device.
- On-device deployment: Develop cross-platform apps with Google AI Edge MediaPipe for turnkey embedding, retrieval & decision tasks or LiteRT for custom model integration. Build for the browser with transformers.js or WebGPU.
- Use your favorite development tools: Serve the model efficiently using transformers, sentence-transformers, MLX, vLLM, llama.cpp, SGLang, Ollama, and LMStudio. Store your embedding vectors with Qdrant.
- Fine-tuning: Follow guidance by Unsloth for how to fine-tune EmbeddingGemma 2 for your use cases.
Explore our developer guide, documentation, and guides for inference and fine-tuning.
Auto-fetched and translated by AI Atlas. All rights belong to the original author.