InternVL Documentation
repository·main·Indexed 27 days ago
https://github.com/opengvlab/internvlAn open-source suite of high-performance multimodal models for vision-language understanding and dialogue. The project includes the internvl_chat package (v2.0.0) and tools for scaling Vision Foundation Models. It provides implementations for InternViT-6B image classification, linear probing on ImageNet-1K, and a CLIP benchmarking suite for zero-shot image classification and image-text retrieval across multiple languages including English, Chinese, Japanese, Arabic, and Italian.
What's inside InternVL
- Mini-InternVL is a series of lightweight Multimodal Large Language Models (MLLMs) with parameter counts of 1B, 2B, and 4B. These models are designed to achieve high performance (up to 90% relative to larger models) with significantly fewer parameters (approx. 5%). They utilize the InternViT-300M visual encoder, which is a lightweight model trained to inherit capabilities from the larger InternViT-6B.
Overview of Mixed Preference Optimization (MPO)
mainMixed Preference Optimization (MPO) is a training method designed to enhance the multimodal reasoning and Chain-of-Thought (CoT) performance of Multimodal Large Language Models (MLLMs). It combines three distinct loss components to help the model learn relative preferences, absolute response quality, and the generation process of preferred responses:
- Preference Loss ($\mathcal{L}_{p}$): Uses DPO (Direct Preference Optimization) to learn the relative preference between chosen and rejected responses.
- Quality Loss ($\mathcal{L}_{q}$): Uses BCO (Binary Classifier Optimization) to help the model understand the absolute quality of individual responses.
- Generation Loss ($\mathcal{L}_{g}$): Uses SFT (Supervised Fine-Tuning) loss to help the model learn the generation process of preferred responses.
The total training objective is defined as: $\mathcal{L}=w_{p}\cdot\mathcal{L}{p} + w{q}\cdot\mathcal{L}{q} + w{g}\cdot\mathcal{L}{g}$, where $w{*}$ represents the weights for each component.
Overview of the VQA evaluation pipeline
mainThe evaluation pipeline in
internvl_chat/eval/vqasupports visual question answering (VQA) across 9 specific datasets:VQAv2OKVQATextVQAVizwizDocVQAChartQAAI2DInfoVQAGQA
Overview of the InternVL Family
mainInternVL is a suite of open-source multimodal models designed to close the gap between open-source and commercial multimodal models (like GPT-5). The family includes various versions (1.0, 1.5, 2.0, 2.5, 3.0, 3.5) and specialized packages such asinternvl_chatandllava(for multimodal dialogue using the LLaVA codebase).Overview of InternVL 2.5 Model Family
mainThe InternVL 2.5 series consists of several multimodal models varying in size, combining an InternViT vision encoder with different LLMs (Qwen 2.5 or InternLM 2.5).
Model Name Vision Part Language Part HF Link InternVL2_5-1B InternViT-300M-448px-V2_5 Qwen2.5-0.5B-Instruct 🤗 link InternVL2_5-2B InternViT-300M-448px-V2_5 internlm2_5-1_8b-chat 🤗 link InternVL2_5-4B InternViT-300M-448px-V2_5 Qwen2.5-3B-Instruct 🤗 link InternVL2_5-8B InternViT-300M-448px-V2_5 internlm2_5-7b-chat 🤗 link InternVL2_5-26B InternViT-6B-448px-V2_5 internlm2_5-20b-chat 🤗 link InternVL2_5-38B InternViT-6B-448px-V2_5 Qwen2.5-32B-Instruct 🤗 link InternVL2_5-78B InternViT-6B-448px-V2_5 Qwen2.5-72B-Instruct 🤗 link InternVL Family Model Documentation
mainThe InternVL family includes several versions, each with specific documentation for introduction, quick start, fine-tuning, evaluation, deployment, and preference optimization (MPO):
- InternVL 2.5: Includes Intro, Quick Start, Finetune, Evaluate, Deploy, and MPO.
- InternVL 2.0: Includes Intro, Quick Start, Finetune, Evaluate, Deploy, and MPO.
- InternVL 1.5: Includes Intro, Quick Start, Finetune, and Evaluate.
- InternVL 1.2: Includes Intro, Quick Start, Finetune, and Evaluate.
- InternVL 1.1: Includes Intro, Quick Start, and Evaluation.
- InternVL 1.0: Specialized tasks including Classification, CLIP-Benchmark, Segmentation, Chat-LLaVA, and InternVL-G.
InternVL 2.5 Model Architecture
mainInternVL 2.5 follows the ViT-MLP-LLM paradigm. It integrates an incrementally pre-trained InternViT with pre-trained LLMs (like InternLM 2.5 or Qwen 2.5) via a randomly initialized MLP projector.
Key architectural features include:
- Pixel Unshuffle: Reduces the number of visual tokens to one-quarter of the original.
- Dynamic Resolution Strategy: Divides images into tiles of 448×448 pixels.
- Multimodal Support: Supports single-image, multi-image, and video data.
Identify evaluation codebases for InternVL benchmarks
mainThe InternVL evaluation results are obtained using several different codebases depending on the benchmark category. To evaluate InternVL on specific tasks, you must use the corresponding codebase listed below:
Multimodal Reasoning and Mathematics
- MMMU-Pro: Use the local
./mmmu_prodirectory. - AI2D (with mask), ChartQA, DocVQA, InfoVQA: Use the local
./vqadirectory. - CharXiv: Use the CharXiv repository.
- MMMU, MathVista, MATH-Vision, MathVerse, OlympiadBench, AI2D (without mask), OCRBench, SEED-2-Plus, VCR: Use VLMEvalKit.
Multi-Image Understanding
- Mantis Eval: Use the local
./mantis_evaldirectory. - MMIU: Use the local
./mmiudirectory. - MIRB: Use the local
./mirbdirectory. - BLINK, MuirBench, MMT-Bench: Use VLMEvalKit.
Comprehensive Multimodal Evaluation
- MME: Use the local
./mmedirectory. - MMBench: Use the local
./mmbenchdirectory. - MMVet v2: Use the local
./mmvetv2directory. - MMBench v1.1, MMVet, MMStar: Use VLMEvalKit.
Multimodal Hallucination Evaluation
- MMHal-Bench: Use the local
./mmhaldirectory. - POPE: Use the local
./popedirectory. - HallBench, CRPE: Use VLMEvalKit.
Visual Grounding
- RefCOCO, RefCOCO+, RefCOCOg: Use the local
./refcocodirectory.
Video Understanding
- MVBench: Use the local
./mvbenchdirectory. - Video-MME, MMBench-Video, MLVU, LongVideoBench: Use VLMEvalKit.
- CG-Bench: Provided by authors.
Other Benchmarks
- Real-World Comprehension (RealWorldQA, MME-RealWorld, WildVision, R-Bench): Use VLMEvalKit.
- Multilingual (MMMB, Multilingual MMBench, MTVQA): Use VLMEvalKit.
- MMMU-Pro: Use the local
InternVL Model Family Documentation
mainThe InternVL project provides specialized documentation for various model versions. Depending on your needs (Quick Start, Fine-tuning, Evaluation, Deployment, or Preference Optimization), refer to the specific version guide:
- InternVL 3.0: Full suite including Intro, Quick Start, Finetune, Evaluate, Deploy, and MPO.
- InternVL 2.5: Full suite including Intro, Quick Start, Finetune, Evaluate, Deploy, and MPO.
- InternVL 2.0: Full suite including Intro, Quick Start, Finetune, Evaluate, Deploy, and MPO.
- InternVL 1.5: Includes Intro, Quick Start, Finetune, and Evaluate, and Deploy.
- InternVL 1.2: Includes Intro, Quick Start, Finetune, and Evaluate.
- InternVL 1.1: Includes Intro, Quick Start, and Evaluation.
- InternVL 1.0: Specialized tasks including Classification, CLIP-Benchmark, Segmentation, Chat-LLaVA, and InternVL-G.
Access InternVL Resources and Documentation
mainThe InternVL project provides several resources for developers, including official documentation, API references, and interactive demos. Use the following links to access them:
- Documentation: InternVL ReadTheDocs
- API Reference: InternLM API Document
- Interactive Chat Demo: InternVL Chat Demo
- Blog: InternVL Blog
- FAQs: Frequently Asked Questions
Capabilities of InternVL
mainInternVL is a suite of multimodal models capable of various visual and cross-modal tasks. Its primary capabilities include:
Visual Perception
- Linear-Probe Image Classification: High-performance image classification using models like InternViT-6B.
- Semantic Segmentation: Precise pixel-level segmentation (e.g., using InternViT-6B with UperNet).
- Zero-Shot Image Classification: Classifying images without specific training on target classes (e.g., ImageNet variants).
- Multilingual Zero-Shot Image Classification: Supporting multiple languages including English (EN), Chinese (ZH), Japanese (JP), Arabic (Ar), and Italian (IT).
- Zero-Shot Video Classification: Classifying video content across datasets like K400, K600, and K700.
Cross-Modal Retrieval
- English Zero-Shot Image-Text Retrieval: Retrieving images from text or vice versa using datasets like Flickr30K and COCO.
- Chinese Zero-Shot Image-Text Retrieval: Specialized retrieval for Chinese language datasets (Flickr30K-CN, COCO-CN).
- Multilingual Zero-Shot Image-Text Retrieval (XTD): Retrieval across multiple languages including English, Spanish, French, Chinese, Italian, Korean, Russian, and Japanese.
Multimodal Dialogue
- Support for interactive dialogue involving both text and visual inputs.
Note on MMMU benchmark alignment
mainThe internal evaluation script provided in this repository may yield scores approximately 2-3 points lower than those reported in technical reports. To align results with official technical reports, it is recommended to use VLMEvalKit for MMMU testing.