Google 的 EmbeddingGemma 2 是一款紧凑、开放权重的多模态嵌入模型,基于 Gemma 4 构建,并采用 Apache 2.0 许可证发布。该模型旨在提高语义搜索和检索增强生成(RAG)的效率,同时针对设备端部署优化性能。
EmbeddingGemma 2 旨在移动设备和笔记本电脑等消费级硬件上运行,可为设备端搜索、检索增强生成(RAG)、分类和聚类等应用提供低延迟的语义表示。
得益于多模态能力,EmbeddingGemma 2 支持广泛的检索任务,包括根据查询查找相关文档、屏幕截图和录音,使用自然语言搜索源代码,以及根据文本描述检索视频内容。
Google 表示,EmbeddingGemma 2 的关键特性是能够在统一的 768 维嵌入空间中表示文本、代码、图像、视频和音频。借助这项能力,开发者可以构建跨不同媒体类型进行搜索的检索系统,而无需为不同媒体类型维护彼此独立且不兼容的嵌入空间。
尽管来自不同模态,EmbeddingGemma 2 生成的嵌入仍处于相同的维度空间中,可以根据语义相似度进行比较。
该模型允许开发者只加载应用所需的编码器,其参数规模从用于文本和代码的 2.7 亿扩展到支持完整多模态能力的 7.4 亿。Google 表示,该模型“在代码搜索和技术内容检索方面显著超越 EmbeddingGemma 1,非常适合本地代码库索引和智能体代码搜索”。
EmbeddingGemma 2 支持套娃表示学习(Matryoshka Representation Learning,MRL),可以将嵌入截断为更短的单位长度向量,从而降低存储需求。例如,以 bfloat16 精度存储 100 万个 768 维向量大约需要 1.5GB 内存,而将其截断到 128 维后只需 250MB,存储占用减少至六分之一。不过,这也意味着需要在检索质量之间作出取舍。因此,Google 建议仅在存储空间或搜索速度确有需要时使用截断。在 128 维下,该模型在文本任务上可保留约 90% 的质量,但在图像、视频和语音检索中的表现会下降到约 75%。
在评论这项发布时,Reddit 用户 Distinct-Target7503 肯定了该模型的多模态能力,同时质疑它在纯文本任务上的提升幅度:
这个模型令人印象深刻的地方,是它可以将图像和音频嵌入同一个共享语义空间;但如果只看文本任务,提升并不算巨大。
与此同时,Reddit 用户 Open-Adhesiveness-86 提醒开发者注意正确使用该模型的重要性:
初代 EmbeddingGemma 有两点让我踩过坑,而这些问题很可能仍然适用:任务前缀不是可选项。如果在索引文档时使用查询前缀,而不是“title: none | text: ”,召回率会明显下降。此外,如果要为 MRL 截断向量,应先进行切片,再对较短的向量执行 L2 归一化;如果先在 768 维上归一化再截断,就会得到范数不正确的向量。
EmbeddingGemma 于去年推出,重点面向“离线和隐私敏感场景,例如在本地搜索个人文件、使用 Gemma 3n 运行移动端 RAG 流水线,或者构建特定领域的聊天机器人”。EmbeddingGemma 2 已在 Hugging Face 上提供。
原文链接:
https://www.infoq.com/news/2026/10/embeddinggemma-2-multimodal/
本文由 AI宝库自动抓取并翻译,版权归原作者所有;如需查看原文请点下方链接。
Google’s Embedding Gemma 2 is a compact, open weight multi-modular embedded model based on Gemma 4 and using Apache 2.0 license publish. The model is designed to increase the efficiency of semantic search and retrieval to enhance generation (RAG), while optimizing performance for end-to-end deployment of equipment.
Embedding Gemma 2 is designed to operate on consumer-grade hardware such as mobile devices and laptop computers and can provide a low-delayed synonym for equipment-end search, retrieval enhancement generation (RAG), classification and clustering applications.
Embedding Gemma 2 supports a wide range of search missions, including searching for relevant documents, screenshots and sound recordings based on queries, searching for source codes in natural languages, and searching for video content based on text descriptions, thanks to multi-modular capabilities.
Google indicates that the key feature of Embeding Gemma 2 is to be able to represent text, code, image, video and audio in a unified 768-D embedded space. With this capacity, developers can construct search systems that can be searched across different media types without the need to maintain separate and incompatible embedded spaces for different media types.
Embedding Gemma 2 is still in the same dimension space, although from different mosaics, and can be compared to semantic similarities.
The model allows the developer to load only the encoder required for the application, and the size of its parameters is expanded from 270 million for text and code to 740 million for full multi-modular capability. Google indicates that the model " significantly surpasses Embeding Gemma 1 in code search and technical content retrieval, and is well suited for local code repository index and AI agent code search. "
Embedding Gemma 2 supports the package of study (Matryoshka Representation Learning, MRL), which can reduce storage needs by cutting embedding to a shorter unit length vector. For example, storage of 1 million 768-dimensional vectors at bfloat16 accuracy requires about 1.5 GB RAM, which will be cut to 128 dimensional only 250 MB and reduced storage occupancy to one sixth. However, it also implies a trade-off between the quality of the search. Thus, Google suggests that cut-off be used only when storage space or search speed is really necessary. At 128 dimensions, the model retains about 90% of the quality of the text mission, but its performance in image, video and voice retrieval will drop to about 75%.
Commenting on this publish, Reddit user Distinct-Target7503 confirmed the model ' s multi-modular capability and questioned the extent to which it had increased on a pure text mission:
The model is impressive in that it embeds images and audio in the same shared semantic space; but if you look only at text assignments, the upgrade is not huge.
Meanwhile, Reddit user Open-Adhesisvenes-86 reminds developers of the importance of using the model correctly:
The first generation Embeding Gemma has two things that make me step through the pit, and these issues are likely to remain relevant: mission prefixes are not an option. If the query prefix is used in the index document, instead of the 'title: none |text: ', the recall rate will decrease significantly. In addition, if the MRL cut vector is to be cut first, then L2 is to be normalized for a shorter vector; if the 768-D is to be normalized and then cut off, you get the wrong vector.
Embeding Gemma was launched last year with a focus on “offline and privacy-sensitive scenes, such as local searches for personal files, the use of Gemma 3n to run mobile RAG flow lines, or the construction of chat robots in specific fields”. Embeding Gemma 2 has been made available on Hugging Face.
Original link:
https://www.infoq.com/news/2026/10/embeddinggemma-2-multimodal/
Auto-fetched and translated by AI Gem Box. All rights belong to the original author.