llama-nemoretriever-colembed-1b-v1:多模态嵌入模型,支持文本-图像检索,ViDoRe等榜单亚军

这是一个用于查询-文档检索的后期交互嵌入模型,支持文本查询与图像文档输入,输出ColBERT风格多向量表示,适用于多模态RAG系统,在ViDoRe等榜单表现优异。【此简介由AI生成】

分支1Tags0
78361b5f创建于 2月5日12次提交
文件最后提交记录最后更新时间
add init 1b 10 个月前
add init 1b 10 个月前
add init 1b 10 个月前
Update README.md3 个月前
Add has_no_defaults_at_init configuration (#8) - Add has_no_defaults_at_init configuration (d2bfa0fa2e8169d937a997f97adf25d1dbb4c71d) - add flags to config.json (ff46189a39181f283a0e036936c50dea978fb509) 4 个月前
Add has_no_defaults_at_init configuration (#8) - Add has_no_defaults_at_init configuration (d2bfa0fa2e8169d937a997f97adf25d1dbb4c71d) - add flags to config.json (ff46189a39181f283a0e036936c50dea978fb509) 4 个月前
adding license 10 个月前
add init 1b 10 个月前
adding license 10 个月前
add init 1b 10 个月前
add init 1b 10 个月前
add init 1b 10 个月前
Enables MTEB 2 evaluation for Vidore V1-V2-V3 benchmarks (#7) - Enables MTEB2 eval of this model on Vidore V1-V2-V3 benchmarks (7ad6e4c5478ccd62026d1333ee9b820524f1a5b4) - Updated readme and scripts (1c223f04fdc7c7a79038e1a5793ed6253b187dff) 4 个月前
adding license 10 个月前
Enables MTEB 2 evaluation for Vidore V1-V2-V3 benchmarks (#7) - Enables MTEB2 eval of this model on Vidore V1-V2-V3 benchmarks (7ad6e4c5478ccd62026d1333ee9b820524f1a5b4) - Updated readme and scripts (1c223f04fdc7c7a79038e1a5793ed6253b187dff) 4 个月前
add init 1b 10 个月前
adding license 10 个月前
add init 1b 10 个月前
add init 1b 10 个月前
add init 1b 10 个月前
adding license 10 个月前

license: other license_name: customized-nscl-v1 license_link: LICENSE tags:

  • text
  • image
  • vidore
  • colpali
  • multimodal-embedding
  • multilingual-embedding
  • Text-to-Visual Document (T→VD) retrieval
  • feature-extraction language:
  • multilingual inference: false library_name: transformers pipeline_tag: visual-document-retrieval new_version: nvidia/llama-nemotron-colembed-vl-3b-v2

llama-nemoretriever-colembed-1b-v1

描述

nvidia/llama-nemoretriever-colembed-1b-v1 是一款针对查询-文档检索任务微调的后期交互嵌入模型。用户可向模型输入文本格式的 queries(查询)或页面图像格式的 documents(文档)。该模型能为输入的查询和文档生成 ColBERT 风格的多向量数值表示。它是 llama-nemoretriever-colembed-3b-v1 的轻量版本,后者在 ViDoRe V1(nDCG@5)、ViDoRe V2(nDCG@5)和 MTEB VisualDocumentRetrieval(Rank Borda)榜单中均位列第一(截至 2025 年 6 月 27 日)。nvidia/llama-nemoretriever-colembed-1b-v1 在这些基准测试中排名第二。

更多技术细节,请参阅我们的技术报告:Llama Nemoretriever Colembed: Top-Performing Text-Image Retrieval Model

本模型仅供非商业/研究用途。

许可协议/使用条款

llama-nemoretriever-colembed-1b-v1 模型的适用条款:NVIDIA 非商业许可协议
补充信息:Apache License 2.0 适用于 siglip2-giant-opt-patch16-384LLAMA 3.2 Community License Agreement 适用于 Llama-3.2-1B。基于 Meta Llama 3 构建,并借助 Qwen 进行优化。

本项目会下载并安装其他第三方开源软件项目。使用前请查阅这些开源项目的许可条款。

团队

  • Mengyao Xu
  • Gabriel Moreira
  • Radek Osmulski
  • Ronay Ak
  • Yauhen Babakhin
  • Even Oldridge
  • Benedikt Schifferer

引用

@misc{xu2025llamanemoretrievercolembedtopperforming,
      title={Llama Nemoretriever Colembed: Top-Performing Text-Image Retrieval Model}, 
      author={Mengyao Xu and Gabriel Moreira and Ronay Ak and Radek Osmulski and Yauhen Babakhin and Zhiding Yu and Benedikt Schifferer and Even Oldridge},
      year={2025},
      eprint={2507.05513},
      archivePrefix={arXiv},
      primaryClass={cs.CV},
      url={https://arxiv.org/abs/2507.05513}, 
}

@misc{li2025eagle2buildingposttraining,
      title={Eagle 2: Building Post-Training Data Strategies from Scratch for Frontier Vision-Language Models}, 
      author={Zhiqi Li and Guo Chen and Shilong Liu and Shihao Wang and Vibashan VS and Yishen Ji and Shiyi Lan and Hao Zhang and Yilin Zhao and Subhashree Radhakrishnan and Nadine Chang and Karan Sapra and Amala Sanjay Deshmukh and Tuomas Rintamaki and Matthieu Le and Ilia Karmanov and Lukas Voegtle and Philipp Fischer and De-An Huang and Timo Roman and Tong Lu and Jose M. Alvarez and Bryan Catanzaro and Jan Kautz and Andrew Tao and Guilin Liu and Zhiding Yu},
      year={2025},
      eprint={2501.14818},
      archivePrefix={arXiv},
      primaryClass={cs.CV},
      url={https://arxiv.org/abs/2501.14818}, 
}

@misc{moreira2025nvretrieverimprovingtextembedding,
      title={NV-Retriever: Improving text embedding models with effective hard-negative mining}, 
      author={Gabriel de Souza P. Moreira and Radek Osmulski and Mengyao Xu and Ronay Ak and Benedikt Schifferer and Even Oldridge},
      year={2025},
      eprint={2407.15831},
      archivePrefix={arXiv},
      primaryClass={cs.IR},
      url={https://arxiv.org/abs/2407.15831}, 
}

NVIDIA 的检索模型

模型名称 用例 说明
nvidia/llama-NemoRetriever-ColEmbed-1B-v1 仅供研究 nvidia/llama-NemoRetriever-ColEmbed-3B-v1 的较小版本
nvidia/llama-NemoRetriever-ColEmbed-3B-v1 仅供研究 截至 2025 年 6 月 27 日,在 ViDoRe V1、V2 和 MTEB 视觉文档检索任务中排名第一
llama-3_2-nemoretriever-1b-vlm-embed-v1 商业应用 用于视觉文档检索生产用例的多模态嵌入模型
llama-3_2-nv-embedqa-1b-v2 商业应用 用于文本文档检索生产用例的文本嵌入模型
llama-3_2-nemoretriever-500m-rerank-v2 商业应用 用于文本文档检索生产用例的文本重排序模型
llama-3_2-nv-rerankqa-1b-v2 商业应用 用于文本文档检索生产用例的文本重排序模型
nvidia/NV-Embed-v2 仅供研究 截至 2024 年 8 月 30 日,在 MTEB 中排名第一
nvidia/MM-Embed 仅供研究 改进版 nvidia/NV-Embed-v1,支持多模态嵌入
nvidia/NV-Retriever-v1 仅供研究 截至 2024 年 7 月 12 日,在 MTEB BEIR 中排名第一

部署地区

全球

应用场景

llama-nemoretriever-colembed 旨在供研究人员探索需要跨文本和图像模态理解或检索信息的应用。它在多模态 RAG 系统中发挥重要作用,此类系统中查询为文本格式,而文档为图像(如页面、文本、图表、表格或信息图)。潜在应用包括多媒体搜索引擎、跨模态检索系统以及具备丰富输入理解能力的对话式 AI。

发布日期

于 2025 年 6 月 27 日在 Huggingface 发布,链接:https://huggingface.co/nvidia/llama-nemoretriever-colembed-1b-v1

模型架构

llama-nemoretriever-colembed-1b-v1 是一个基于 Transformer 的多模态嵌入模型,构建于基于 google/siglip2-giant-opt-patch16-384 和 meta-llama/Llama-3.2-1B 的 VLM 之上。

输入

属性 查询 文档
输入类型 文本 文本 | 图像
输入格式 字符串列表 字符串列表 | 图像列表
输入参数 一维 一维
其他属性 模型的最大上下文长度为 8192 个 tokens。超过最大长度的文本必须进行分块或截断。 模型的最大上下文长度为 8192 个 tokens。超过最大长度的文本必须进行分块或截断。图像必须为 python PIL 格式。模型会将图像缩放为多个 512x512 的图块。

输出

  • 输出类型:浮点数
  • 输出格式:浮点数数组列表
  • 输出参数:相当于 [batchsize x seq length x embedding_dim] 的浮点数列表
  • 与输出相关的其他属性:模型为每个输入 token 输出维度为 的嵌入向量。

我们的 AI 模型设计和/或优化为在 NVIDIA GPU 加速系统上运行。通过利用 NVIDIA 的硬件(如 GPU 核心)和软件框架(如 CUDA 库),与仅使用 CPU 的解决方案相比,该模型实现了更快的训练和推理时间。

使用方法

该模型需要 transformers 4.49.0 版本和 flash attention。

pip install transformers==4.49.0
pip install flash-attn==2.6.3 --no-build-isolation
import requests
from PIL import Image
from io import BytesIO
import torch
from transformers import AutoModel

# Load Model
model = AutoModel.from_pretrained(
    'nvidia/llama-nemoretriever-colembed-1b-v1',
    device_map='cuda',
    trust_remote_code=True,
    torch_dtype=torch.bfloat16,
    attn_implementation="flash_attention_2"
).eval()

# Queries
queries = [
	'How much percentage of Germanys population died in the 2nd World War?',
	'How many million tons CO2 were captured from Gas processing in 2018?',
	'What is the average CO2 emission of someone in Japan?'
]

# Documents
image_urls = [
	'https://upload.wikimedia.org/wikipedia/commons/3/35/Human_losses_of_world_war_two_by_country.png',
	'https://upload.wikimedia.org/wikipedia/commons/thumb/7/76/20210413_Carbon_capture_and_storage_-_CCS_-_proposed_vs_implemented.svg/2560px-20210413_Carbon_capture_and_storage_-_CCS_-_proposed_vs_implemented.svg.png',
	'https://upload.wikimedia.org/wikipedia/commons/thumb/f/f3/20210626_Variwide_chart_of_greenhouse_gas_emissions_per_capita_by_country.svg/2880px-20210626_Variwide_chart_of_greenhouse_gas_emissions_per_capita_by_country.svg.png'
]

# Load into PIL
headers = {
    "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64)"
}

images = [Image.open(BytesIO(requests.get(image_url, headers=headers).content)) for image_url in image_urls]

# Encoding
query_embeddings = model.forward_queries(queries, batch_size=8)
image_embeddings = model.forward_images(images, batch_size=8)


scores = model.get_scores(
    query_embeddings,
    image_embeddings
)
# Diagonal should have high scores
print(scores)
# tensor([[13.9970, 11.4219, 12.1225],
#         [11.4157, 14.6388, 12.0341],
#         [ 9.9023,  9.8857, 11.3387]], device='cuda:0')

在基准测试上运行评估

MTEB 排行榜上的 Vidore V1&V2 和 V3

ViDoRe 是视觉文档检索领域的顶级基准测试。该基准测试的最新版本是 Vidore V3,它是针对企业用例检索的全面评估。
我们提供了一个脚本,该脚本使用 MTEB 2 库在 ViDoRe 基准测试上评估 ColEmbed 模型。

pip install "mteb>=2.3.10,<3.0.0"
# Evaluates with Vidore V1 and V2
CUDA_VISIBLE_DEVICES=0; python3 mteb2_eval.py --model_name nvidia/llama-nemoretriever-colembed-3b-v1 --batch_size 16 --benchmark "VisualDocumentRetrieval
# Evaluates with Vidore V3
CUDA_VISIBLE_DEVICES=0; python3 mteb2_eval.py --model_name nvidia/llama-nemoretriever-colembed-3b-v1 --batch_size 16 --benchmark "ViDoRe(v3)"
# Evaluates with a specific task/dataset of Vidore V3: Vidore3ComputerScienceRetrieval
CUDA_VISIBLE_DEVICES=0; python3 mteb2_eval.py --model_name nvidia/llama-nemoretriever-colembed-3b-v1 --batch_size 16 --benchmark "ViDoRe(v3)" --task-list Vidore3ComputerScienceRetrieval

我们还提供了一个脚本,用于基于其已弃用的GitHub 仓库评估 ViDoRe V1 和 ViDoRe V2。

pip install git+https://github.com/illuin-tech/vidore-benchmark@e0eb9032e7e00adc8aa6f9cb35d5a9371f67485a
# Downgrade transformers as vidore will install latest transformers
pip install --upgrade transformers==4.49.0
CUDA_VISIBLE_DEVICES=0; python3 vidore_eval.py --model_name_or_path nvidia/llama-nemoretriever-colembed-1b-v1 --savedir_datasets ./results/ --model_revision 50c36f4d5271c6851aa08bd26d69f6e7ca8b870c

软件集成:

运行时引擎:TensorRT、Triton 支持的硬件微架构兼容性:A100 40GB、A100 80GB、H100 80GB 支持的操作系统:Linux

模型版本

llama-nemoretriever-colembed-1b-v1

训练与评估数据集

  • 训练数据点总数:1274万问答对
  • 数据集总数:23个用于训练,17个用于评估

训练数据集

该模型在公开可用的数据集上进行训练,包括HotpotQAMIRACLNatural Questions (NQ)Stack ExchangeSQuADTiger Math/StackDocMatix-IRVDRVidore-ColPali-TrainingVisRAG-Ret-Train-Synthetic-dataVisRAG-Ret-Train-In-domain-dataWiki-SS-NQ

  • 各数据集的数据收集方法:混合:自动化、人工、合成
  • 各数据集的标注方法:混合:自动化、人工、合成
  • 属性:训练阶段:第一阶段:1200万问答对,第二阶段:50万问答对,第三阶段:24万问答对

评估数据集

我们在多个视觉文档检索基准上对模型进行评估,包括ViDoRe V1、ViDoRe V2和MTEB视觉文档检索。

  • 各数据集的数据收集方法:混合:自动化、人工、合成
  • 各数据集的标注方法:混合:自动化、人工、合成
  • 属性:有关ViDoRe V1和ViDoRe V2的更多详细信息,请参见其排行榜。视觉文档检索基准(ViDoRe)由多个页面级检索任务组成,涵盖多个领域、语言和场景。
基准 Model 1B Model 3B
ViDoRe V1(2025年6月27日) 0.9050 0.9100
ViDoRe V1(已弃用) 0.9049 0.9098
ViDoRe V2(2025年6月27日) 0.6209 0.6352
ViDoRe V2(已弃用) 0.6261 0.6342
MTEB视觉文档检索 0.8238 0.8315

注:所有分数均为平均NDCG@5。ViDoRe V1和V2已于2025年6月27日更新,采用MTEB计算的分数,可能导致分数略有不同。ViDoRe V2(2025年6月27日)仅使用原始7个数据集中的4个。

推理:

加速引擎: 不适用
测试硬件: A100 40GB、A100 80GB、H100 80GB

伦理考量

NVIDIA 认为可信 AI 是一项共同责任,我们已制定相关政策和实践,以支持各类 AI 应用的开发。当开发者按照我们的服务条款下载或使用本模型时,应与内部模型团队合作,确保该模型满足相关行业和使用场景的要求,并应对不可预见的产品误用问题。

请通过 此处 报告安全漏洞或 NVIDIA AI 相关问题。

项目介绍

这是一个用于查询-文档检索的后期交互嵌入模型,支持文本查询与图像文档输入,输出ColBERT风格多向量表示,适用于多模态RAG系统,在ViDoRe等榜单表现优异。【此简介由AI生成】

定制我的领域

下载使用量

0

项目总下载次数(含Clone、Pull、 zip 包及 release 下载),每日凌晨更新

语言类型

Python100%