This family of models performs vision-language and text-only tasks including optical character recognition, multimodal reasoning, localization, common sense reasoning, world knowledge utilization, and coding.
Today (September 17th, 2024), we introduce NVLM 1.0, a family of frontier-class multimodal large language models (LLMs) that achieve state-of-the-art results on vision-language tasks, rivaling the leading proprietary models (e.g., GPT-4o) and open-access models (e.g., Llama 3-V 405B and InternVL 2). Remarkably, NVLM 1.0 shows improved text-only performance over its LLM backbone after multimodal training.
In this repo, we are open-sourcing NVLM-1.0-D-72B (decoder-only architecture), the decoder-only model weights and code for the community.
We train our model with legacy Megatron-LM and adapt the codebase to Huggingface for model hosting, reproducibility, and inference.
We observe numerical differences between the Megatron and Huggingface codebases, which are within the expected range of variation.
We provide the results from both the Huggingface codebase and the Megatron codebase for reproducibility and comparison with other models.
Results (as of September 17th, 2024) in the multimodal benchmarks are as follows:
The model trained on this dataset cannot regenerate its training data:
The model has no image generation capability since its output is only text. Hence it cannot regenerate any image it would have seen during training.
The model cannot regenerate training text data: during training, the model takes text and images as inputs, and the model output (text) is conditioned on both inputs. During inference, without training images as input, the models would not be able to reproduce any part of the training text data.
Input
Input Type(s): Text, Image Input Format(s): String, Pillow Library-Supported Formats Input Dimensions: One-Dimensional (1D), Two Dimensional (2D) Other Properties Related to Input: Maximum Token Length = 128K Tokens
Output
Output Type(s): Text Output Format: String Model Output: 1D Other Properties Related to Output: None
How to use
When converting Megatron checkpoint to Huggingface, we adapt InternVL codebase to support model loading and multi-GPU inference in HF.
We also use the tokenizer from Qwen2.5-72B-Instruct when adapting the tokenizer to Huggingface, as it contains extra special tokens for vision tasks, e.g., <|vision_pad|>.
We train NVLM-1.0-D-72B based on the Qwen2-72B-Instruct text-only model and InternViT-6B-448px-V1-5 ViT model with our large-scale high-quality multimodal dataset.
For training code, please refer to Megatron-Core.
Prepare the environment
We provide a docker build file in the Dockerfile for reproduction.
The docker image is based on nvcr.io/nvidia/pytorch:23.09-py3.
Note: We observe that different transformer versions / CUDA versions / docker versions can lead to slight benchmark number differences. We recommend using the Dockerfile above for precise reproduction.
--config-path eval/full_eval.yaml file contains the evaluation configurations, including the evaluation prompt, the evaluation dataset paths, and generation hyper-parameters.
--result-save-path path/to/eval_results/ specifies the path to save the evaluation results.
--zero-shot-eval-tasks specifies the tasks to evaluate on.
@article{nvlm2024,
title={NVLM: Open Frontier-Class Multimodal LLMs},
author={Dai, Wenliang and Lee, Nayeon and Wang, Boxin and Yang, Zhuolin and Liu, Zihan and Barker, Jon and Rintamaki, Tuomas and Shoeybi, Mohammad and Catanzaro, Bryan and Ping, Wei},
journal={arXiv preprint},
year={2024}}
Ethical Considerations
NVIDIA believes Trustworthy AI is a shared responsibility and we have established policies and practices to enable development for a wide array of AI applications. When downloaded or used in accordance with our terms of service, developers should work with their supporting model team to ensure this model meets requirements for the relevant industry and use case and addresses unforeseen product misuse.
Please report security vulnerabilities or NVIDIA AI Concerns here.