nielsr HF Staff commited on
Commit
df0a7ca
·
verified ·
1 Parent(s): 481f6e3

Improve model card: Add abstract and Hugging Face Space link, update pipeline tag

Browse files

This PR addresses improvements to the model card:

- The paper abstract has been added under a new `

Files changed (1) hide show
  1. README.md +140 -40
README.md CHANGED
@@ -1,33 +1,53 @@
1
  ---
2
- license: apache-2.0
3
- pipeline_tag: image-text-to-text
4
- library_name: transformers
5
  base_model:
6
- - OpenGVLab/InternVL3_5-4B-MPO
 
 
 
 
 
 
 
 
 
 
 
7
  base_model_relation: finetune
 
 
 
 
 
8
  datasets:
9
- - OpenGVLab/MMPR-v1.2
10
- - OpenGVLab/MMPR-Tiny
11
  language:
12
- - multilingual
 
 
 
13
  tags:
14
- - internvl
15
- - custom_code
 
16
  ---
17
 
18
  # InternVL3_5-4B
19
 
20
  [\[📂 GitHub\]](https://github.com/OpenGVLab/InternVL) [\[📜 InternVL 1.0\]](https://huggingface.co/papers/2312.14238) [\[📜 InternVL 1.5\]](https://huggingface.co/papers/2404.16821) [\[📜 InternVL 2.5\]](https://huggingface.co/papers/2412.05271) [\[📜 InternVL2.5-MPO\]](https://huggingface.co/papers/2411.10442) [\[📜 InternVL3\]](https://huggingface.co/papers/2504.10479) [\[📜 InternVL3.5\]](https://huggingface.co/papers/2508.18265)
21
-
22
- [\[🆕 Blog\]](https://internvl.github.io/blog/) [\[🗨️ Chat Demo\]](https://chat.intern-ai.org.cn/) [\[🚀 Quick Start\]](#quick-start) [\[📖 Documents\]](https://internvl.readthedocs.io/en/latest/)
23
 
24
  <div align="center">
25
  <img width="500" alt="image" src="https://cdn-uploads.huggingface.co/production/uploads/64006c09330a45b03605bba3/zJsd2hqd3EevgXo6fNgC-.png">
26
  </div>
27
 
 
 
 
 
28
  ## Introduction
29
 
30
- We introduce *InternVL3.5*, a new family of open-source multimodal models that significantly advances versatility, reasoning capability, and inference efficiency along the InternVL series. A key innovation is the *Cascade Reinforcement Learning (Cascade RL)* framework, which enhances reasoning through a two-stage process: offline RL for stable convergence and online RL for refined alignment. This coarse-to-fine training strategy leads to substantial improvements on downstream reasoning tasks, e.g., MMMU and MathVista. To optimize efficiency, we propose a *Visual Resolution Router (ViR)* that dynamically adjusts the resolution of visual tokens without compromising performance. Coupled with ViR, our Decoupled *Vision-Language Deployment (DvD)* strategy separates the vision encoder and language model across different GPUs, effectively balancing computational load. These contributions collectively enable InternVL3.5 to achieve up to a +16.0\% gain in overall reasoning performance and a 4.05 \\(\times\\) inference speedup compared to its predecessor, i.e., InternVL3. In addition, InternVL3.5 supports novel capabilities such as GUI interaction and embodied agency. Notably, our largest model, i.e., InternVL3.5-241B-A28B, attains state-of-the-art results among open-source MLLMs across general multimodal, reasoning, text, and agentic tasks—narrowing the performance gap with leading commercial models like GPT-5. All models and code are publicly released.
31
 
32
  ![image/jpg](https://huggingface.co/OpenGVLab/InternVL3_5-241B-A28B/resolve/main/images/performance.jpg)
33
 
@@ -137,11 +157,11 @@ The Dynamic High Resolution strategy introduced in InternVL1.5 is also retained
137
 
138
 
139
  `InternVL3.5-Flash`:
140
- Compared to InternVL3.5, InternVL3.5-Flash further integrates the *Visual Resolution Router (ViR)*, thus yielding a series of efficient variants friendly suitable for resource-constrained scenarios.
141
  Specifically, in InternVL3.5, each image patch is initially represented as 1024 visual tokens for the vision encoder, which are then compressed into 256 tokens via a pixel shuffle module before being passed to the Large Language Model (LLM).
142
  In InternVL3.5-Flash, as shown in the Figure below, an additional pixel shuffle module with a higher compression rate is included, enabling the compression of visual tokens down to 64 tokens.
143
  For each patch, the patch router determines the appropriate compression rate by assessing its semantic richness, and routes it to the corresponding pixel shuffle module accordingly.
144
- Benefiting from this patch-aware compression mechanism, InternVL3.5-Flash is able to reduce the number of visual tokens by 50\% while maintaining nearly 100\% of the performance of InternVL3.5.
145
 
146
 
147
  ![image/jpg](https://huggingface.co/OpenGVLab/InternVL3_5-241B-A28B/resolve/main/images/architecture.jpg)
@@ -168,18 +188,18 @@ where \\(N\\) denotes the number of tokens in the training sample on which the l
168
  ### Supervised Fine-Tuning
169
 
170
  During the SFT phase, we adopt the same objective as in the pre-training stage and use the square-root averaging strategy to calculate the final loss. In this stage, the context window is set to 32K tokens to adapt long-context information.
171
- Compared to InternVL3, the SFT stage of InternVL3.5 contains more high-quality and diverse training data derived from three sources:
172
 
173
- (1) Instruction-following data from InternVL3, which are reused to preserve broad coverage of vision–language tasks.
174
 
175
- (2) Multimodal reasoning data in the "Thinking" mode, which are included to instill long-thinking capabilities in the model. To construct such data, we first use InternVL3-78B to describe the image and then input the description into DeepSeek-R1 to sample rollouts with detailed reasoning processes. Rollouts with an incorrect final answer are filtered out. The questions in these datasets cover various expert domains, such as mathematics and scientific disciplines, thereby strengthening performance on different reasoning tasks.
176
 
177
  (3) Capability-expansion datasets, which endow InternVL3.5 with new skills, including GUI-based interaction, embodied interaction, and scalable vect
178
 
179
  ### Cascade Reinforcement Learning
180
 
181
  Cascade RL aims to combine the benefits of offline RL and online RL to progressively facilitate the post-training of MLLMs in an efficient manner.
182
- Specifically, we first fine-tune the model using an offline RL algorithm as an efficient warm-up stage to reach a satisfied results, which can guarantee the high-quality rollouts for the latter stage.
183
  Subsequently, we employ an online RL algorithm to further refine the output distribution based on rollouts generated by the model itself. Compared to the single offline or online RL stage, our cascaded RL achieves significant performance improvements at a fraction of the GPU time cost.
184
 
185
 
@@ -233,7 +253,7 @@ $$
233
  \Bigg],
234
  $$
235
 
236
- where \\(\mathrm{KL}\) denotes the KL divergence and \(\xi\) denotes the compression rate, which is uniformly sampled from \(\{\frac{1}{4},\frac{1}{16}\}\). The image \(I_\xi\) is represented as 256 tokens when \(\xi=\frac{1}{4}\) and 64 tokens when \(\xi=\frac{1}{16}\). Notably, the reference model always performs inference with \(\xi=\frac{1}{4}\).
237
 
238
 
239
  `Router training`:
@@ -278,7 +298,7 @@ This approach improves reasoning breadth.
278
 
279
  ### Decoupled Vision-Language Deployment
280
 
281
- In multimodal inference, the vision encoder and language model have distinct computational characteristics. The vision encoder that transforms images into semantic features is highly parallelizable and does not rely on long-term history state. In contrast, the language model adopts the inference in an autoregressive manner, which requires previous states to compute the next one. This sequential property makes the language part more sensitive to memory bandwidth and latency.
282
  When MLLMs are deployed online at scale, the vision and language models often block each other, thus incurring additional inference cost. This effect becomes more pronounced with larger vision models or higher-resolution images.
283
 
284
  ![image/jpg](https://huggingface.co/OpenGVLab/InternVL3_5-241B-A28B/resolve/main/images/DvD.jpg)
@@ -529,40 +549,50 @@ generation_config = dict(max_new_tokens=1024, do_sample=True)
529
  # pure-text conversation (纯文本对话)
530
  question = 'Hello, who are you?'
531
  response, history = model.chat(tokenizer, None, question, generation_config, history=None, return_history=True)
532
- print(f'User: {question}\nAssistant: {response}')
 
533
 
534
  question = 'Can you tell me a story?'
535
  response, history = model.chat(tokenizer, None, question, generation_config, history=history, return_history=True)
536
- print(f'User: {question}\nAssistant: {response}')
 
537
 
538
  # single-image single-round conversation (单图单轮对话)
539
- question = '<image>\nPlease describe the image shortly.'
 
540
  response = model.chat(tokenizer, pixel_values, question, generation_config)
541
- print(f'User: {question}\nAssistant: {response}')
 
542
 
543
  # single-image multi-round conversation (单图多轮对话)
544
- question = '<image>\nPlease describe the image in detail.'
 
545
  response, history = model.chat(tokenizer, pixel_values, question, generation_config, history=None, return_history=True)
546
- print(f'User: {question}\nAssistant: {response}')
 
547
 
548
  question = 'Please write a poem according to the image.'
549
  response, history = model.chat(tokenizer, pixel_values, question, generation_config, history=history, return_history=True)
550
- print(f'User: {question}\nAssistant: {response}')
 
551
 
552
  # multi-image multi-round conversation, combined images (多图多轮对话,拼接图像)
553
  pixel_values1 = load_image('./examples/image1.jpg', max_num=12).to(torch.bfloat16).cuda()
554
  pixel_values2 = load_image('./examples/image2.jpg', max_num=12).to(torch.bfloat16).cuda()
555
  pixel_values = torch.cat((pixel_values1, pixel_values2), dim=0)
556
 
557
- question = '<image>\nDescribe the two images in detail.'
 
558
  response, history = model.chat(tokenizer, pixel_values, question, generation_config,
559
  history=None, return_history=True)
560
- print(f'User: {question}\nAssistant: {response}')
 
561
 
562
  question = 'What are the similarities and differences between these two images.'
563
  response, history = model.chat(tokenizer, pixel_values, question, generation_config,
564
  history=history, return_history=True)
565
- print(f'User: {question}\nAssistant: {response}')
 
566
 
567
  # multi-image multi-round conversation, separate images (多图多轮对话,独立图像)
568
  pixel_values1 = load_image('./examples/image1.jpg', max_num=12).to(torch.bfloat16).cuda()
@@ -570,17 +600,21 @@ pixel_values2 = load_image('./examples/image2.jpg', max_num=12).to(torch.bfloat1
570
  pixel_values = torch.cat((pixel_values1, pixel_values2), dim=0)
571
  num_patches_list = [pixel_values1.size(0), pixel_values2.size(0)]
572
 
573
- question = 'Image-1: <image>\nImage-2: <image>\nDescribe the two images in detail.'
 
 
574
  response, history = model.chat(tokenizer, pixel_values, question, generation_config,
575
  num_patches_list=num_patches_list,
576
  history=None, return_history=True)
577
- print(f'User: {question}\nAssistant: {response}')
 
578
 
579
  question = 'What are the similarities and differences between these two images.'
580
  response, history = model.chat(tokenizer, pixel_values, question, generation_config,
581
  num_patches_list=num_patches_list,
582
  history=history, return_history=True)
583
- print(f'User: {question}\nAssistant: {response}')
 
584
 
585
  # batch inference, single image per sample (单图批处理)
586
  pixel_values1 = load_image('./examples/image1.jpg', max_num=12).to(torch.bfloat16).cuda()
@@ -588,13 +622,15 @@ pixel_values2 = load_image('./examples/image2.jpg', max_num=12).to(torch.bfloat1
588
  num_patches_list = [pixel_values1.size(0), pixel_values2.size(0)]
589
  pixel_values = torch.cat((pixel_values1, pixel_values2), dim=0)
590
 
591
- questions = ['<image>\nDescribe the image in detail.'] * len(num_patches_list)
 
592
  responses = model.batch_chat(tokenizer, pixel_values,
593
  num_patches_list=num_patches_list,
594
  questions=questions,
595
  generation_config=generation_config)
596
  for question, response in zip(questions, responses):
597
- print(f'User: {question}\nAssistant: {response}')
 
598
 
599
  # video multi-round conversation (视频多轮对话)
600
  def get_index(bound, fps, max_frame, first_idx=0, num_segments=32):
@@ -632,17 +668,24 @@ def load_video(video_path, bound=None, input_size=448, max_num=1, num_segments=3
632
  video_path = './examples/red-panda.mp4'
633
  pixel_values, num_patches_list = load_video(video_path, num_segments=8, max_num=1)
634
  pixel_values = pixel_values.to(torch.bfloat16).cuda()
635
- video_prefix = ''.join([f'Frame{i+1}: <image>\n' for i in range(len(num_patches_list))])
 
636
  question = video_prefix + 'What is the red panda doing?'
637
- # Frame1: <image>\nFrame2: <image>\n...\nFrame8: <image>\n{question}
 
 
 
 
638
  response, history = model.chat(tokenizer, pixel_values, question, generation_config,
639
  num_patches_list=num_patches_list, history=None, return_history=True)
640
- print(f'User: {question}\nAssistant: {response}')
 
641
 
642
  question = 'Describe this video in detail.'
643
  response, history = model.chat(tokenizer, pixel_values, question, generation_config,
644
  num_patches_list=num_patches_list, history=history, return_history=True)
645
- print(f'User: {question}\nAssistant: {response}')
 
646
  ```
647
 
648
  #### Streaming Output
@@ -726,7 +769,9 @@ image_urls=[
726
 
727
  images = [load_image(img_url) for img_url in image_urls]
728
  # Numbering images improves multi-image conversations
729
- response = pipe((f'Image-1: {IMAGE_TOKEN}\nImage-2: {IMAGE_TOKEN}\ndescribe these two images', images))
 
 
730
  print(response.text)
731
  ```
732
 
@@ -828,4 +873,59 @@ If you find this project useful in your research, please consider citing:
828
  journal={arXiv preprint arXiv:2508.18265},
829
  year={2025}
830
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
831
  ```
 
 
 
 
 
 
 
 
 
 
 
1
  ---
 
 
 
2
  base_model:
3
+ - OpenGVLab/InternVL3_5-4B-MPO
4
+ datasets:
5
+ - OpenGVLab/MMPR-v1.2
6
+ - OpenGVLab/MMPR-Tiny
7
+ language:
8
+ - multilingual
9
+ library_name: transformers
10
+ license: apache-2.0
11
+ pipeline_tag: IMAGE_TEXT_TO_TEXT
12
+ tags:
13
+ - internvl
14
+ - custom_code
15
  base_model_relation: finetune
16
+ ---
17
+
18
+ ---
19
+ base_model:
20
+ - OpenGVLab/InternVL3_5-4B-MPO
21
  datasets:
22
+ - OpenGVLab/MMPR-v1.2
23
+ - OpenGVLab/MMPR-Tiny
24
  language:
25
+ - multilingual
26
+ library_name: transformers
27
+ license: apache-2.0
28
+ pipeline_tag: IMAGE_TEXT_TO_TEXT
29
  tags:
30
+ - internvl
31
+ - custom_code
32
+ base_model_relation: finetune
33
  ---
34
 
35
  # InternVL3_5-4B
36
 
37
  [\[📂 GitHub\]](https://github.com/OpenGVLab/InternVL) [\[📜 InternVL 1.0\]](https://huggingface.co/papers/2312.14238) [\[📜 InternVL 1.5\]](https://huggingface.co/papers/2404.16821) [\[📜 InternVL 2.5\]](https://huggingface.co/papers/2412.05271) [\[📜 InternVL2.5-MPO\]](https://huggingface.co/papers/2411.10442) [\[📜 InternVL3\]](https://huggingface.co/papers/2504.10479) [\[📜 InternVL3.5\]](https://huggingface.co/papers/2508.18265)
38
+ [\[🆕 Blog\]](https://internvl.github.io/blog/) [\[🗨️ Chat Demo\]](https://chat.intern-ai.org.cn/) [\[🚀 Quick Start\]](#quick-start) [\[📖 Documents\]](https://internvl.readthedocs.io/en/latest/) [\[🤗 HF Space\]](https://huggingface.co/spaces/OpenGVLab/InternVL)
 
39
 
40
  <div align="center">
41
  <img width="500" alt="image" src="https://cdn-uploads.huggingface.co/production/uploads/64006c09330a45b03605bba3/zJsd2hqd3EevgXo6fNgC-.png">
42
  </div>
43
 
44
+ ## Abstract
45
+
46
+ We introduce InternVL 2.5, an advanced multimodal large language model (MLLM) series that builds upon InternVL 2.0, maintaining its core model architecture while introducing significant enhancements in training and testing strategies as well as data quality. In this work, we delve into the relationship between model scaling and performance, systematically exploring the performance trends in vision encoders, language models, dataset sizes, and test-time configurations. Through extensive evaluations on a wide range of benchmarks, including multi-discipline reasoning, document understanding, multi-image / video understanding, real-world comprehension, multimodal hallucination detection, visual grounding, multilingual capabilities, and pure language processing, InternVL 2.5 exhibits competitive performance, rivaling leading commercial models such as GPT-4o and Claude-3.5-Sonnet. Notably, our model is the first open-source MLLMs to surpass 70% on the MMMU benchmark, achieving a 3.7-point improvement through Chain-of-Thought (CoT) reasoning and showcasing strong potential for test-time scaling. We hope this model contributes to the open-source community by setting new standards for developing and applying multimodal AI systems. HuggingFace demo see this https URL
47
+
48
  ## Introduction
49
 
50
+ We introduce *InternVL3.5*, a new family of open-source multimodal models that significantly advances versatility, reasoning capability, and inference efficiency along the InternVL series. A key innovation is the *Cascade Reinforcement Learning (Cascade RL)* framework, which enhances reasoning through a two-stage process: offline RL for stable convergence and online RL for refined alignment. This coarse-to-fine training strategy leads to substantial improvements on downstream reasoning tasks, e.g., MMMU and MathVista. To optimize efficiency, we propose a *Visual Resolution Router (ViR)* that dynamically adjusts the resolution of visual tokens without compromising performance. Coupled with ViR, our Decoupled *Vision-Language Deployment (DvD)* strategy separates the vision encoder and language model across different GPUs, effectively balancing computational load. These contributions collectively enable InternVL3.5 to achieve up to a +16.0% gain in overall reasoning performance and a 4.05 \\(\times\\) inference speedup compared to its predecessor, i.e., InternVL3. In addition, InternVL3.5 supports novel capabilities such as GUI interaction and embodied agency. Notably, our largest model, i.e., InternVL3.5-241B-A28B, attains state-of-the-art results among open-source MLLMs across general multimodal, reasoning, text, and agentic tasks—narrowing the performance gap with leading commercial models like GPT-5. All models and code are publicly released.
51
 
52
  ![image/jpg](https://huggingface.co/OpenGVLab/InternVL3_5-241B-A28B/resolve/main/images/performance.jpg)
53
 
 
157
 
158
 
159
  `InternVL3.5-Flash`:
160
+ Compared to InternVL3.5, InternVL3.5-Flash further integrates the *Visual Resolution Router (ViR)*, thus yielding a series of efficient variants friendly suitable for resource-constrained scenarios.
161
  Specifically, in InternVL3.5, each image patch is initially represented as 1024 visual tokens for the vision encoder, which are then compressed into 256 tokens via a pixel shuffle module before being passed to the Large Language Model (LLM).
162
  In InternVL3.5-Flash, as shown in the Figure below, an additional pixel shuffle module with a higher compression rate is included, enabling the compression of visual tokens down to 64 tokens.
163
  For each patch, the patch router determines the appropriate compression rate by assessing its semantic richness, and routes it to the corresponding pixel shuffle module accordingly.
164
+ Benefiting from this patch-aware compression mechanism, InternVL3.5-Flash is able to reduce the number of visual tokens by 50% while maintaining nearly 100% of the performance of InternVL3.5.
165
 
166
 
167
  ![image/jpg](https://huggingface.co/OpenGVLab/InternVL3_5-241B-A28B/resolve/main/images/architecture.jpg)
 
188
  ### Supervised Fine-Tuning
189
 
190
  During the SFT phase, we adopt the same objective as in the pre-training stage and use the square-root averaging strategy to calculate the final loss. In this stage, the context window is set to 32K tokens to adapt long-context information.
191
+ Compared to InternVL3, the SFT stage of InternVL3.5 contains more high-quality and diverse training data derived from three sources:
192
 
193
+ (1) Instruction-following data from InternVL3, which are reused to preserve broad coverage of vision–language tasks.
194
 
195
+ (2) Multimodal reasoning data in the "Thinking" mode, which are included to instill long-thinking capabilities in the model. To construct such data, we first use InternVL3-78B to describe the image and then input the description into DeepSeek-R1 to sample rollouts with detailed reasoning processes. Rollouts with an incorrect final answer are filtered out. The questions in these datasets cover various expert domains, such as mathematics and scientific disciplines, thereby strengthening performance on different reasoning tasks.
196
 
197
  (3) Capability-expansion datasets, which endow InternVL3.5 with new skills, including GUI-based interaction, embodied interaction, and scalable vect
198
 
199
  ### Cascade Reinforcement Learning
200
 
201
  Cascade RL aims to combine the benefits of offline RL and online RL to progressively facilitate the post-training of MLLMs in an efficient manner.
202
+ Specifically, we first fine-tune the model using an offline RL algorithm as an efficient warm-up stage to reach a satisfied results, which can guarantee the high-quality rollouts for the latter stage.
203
  Subsequently, we employ an online RL algorithm to further refine the output distribution based on rollouts generated by the model itself. Compared to the single offline or online RL stage, our cascaded RL achieves significant performance improvements at a fraction of the GPU time cost.
204
 
205
 
 
253
  \Bigg],
254
  $$
255
 
256
+ where \\(\mathrm{KL}\\) denotes the KL divergence and \(\xi\) denotes the compression rate, which is uniformly sampled from \(\{\frac{1}{4},\frac{1}{16}\}\). The image \(I_\xi\) is represented as 256 tokens when \(\xi=\frac{1}{4}\) and 64 tokens when \(\xi=\frac{1}{16}\). Notably, the reference model always performs inference with \(\xi=\frac{1}{4}\).
257
 
258
 
259
  `Router training`:
 
298
 
299
  ### Decoupled Vision-Language Deployment
300
 
301
+ In multimodal inference, the vision encoder and language model have distinct computational characteristics. The vision encoder that transforms images into semantic features is highly parallelizable and does not rely on long-term history state. In contrast, the language model adopts the inference in an autoregressive manner, which requires previous states to compute the next one. This sequential property makes the language part more sensitive to memory bandwidth and latency.
302
  When MLLMs are deployed online at scale, the vision and language models often block each other, thus incurring additional inference cost. This effect becomes more pronounced with larger vision models or higher-resolution images.
303
 
304
  ![image/jpg](https://huggingface.co/OpenGVLab/InternVL3_5-241B-A28B/resolve/main/images/DvD.jpg)
 
549
  # pure-text conversation (纯文本对话)
550
  question = 'Hello, who are you?'
551
  response, history = model.chat(tokenizer, None, question, generation_config, history=None, return_history=True)
552
+ print(f'User: {question}
553
+ Assistant: {response}')
554
 
555
  question = 'Can you tell me a story?'
556
  response, history = model.chat(tokenizer, None, question, generation_config, history=history, return_history=True)
557
+ print(f'User: {question}
558
+ Assistant: {response}')
559
 
560
  # single-image single-round conversation (单图单轮对话)
561
+ question = '<image>
562
+ Please describe the image shortly.'
563
  response = model.chat(tokenizer, pixel_values, question, generation_config)
564
+ print(f'User: {question}
565
+ Assistant: {response}')
566
 
567
  # single-image multi-round conversation (单图多轮对话)
568
+ question = '<image>
569
+ Please describe the image in detail.'
570
  response, history = model.chat(tokenizer, pixel_values, question, generation_config, history=None, return_history=True)
571
+ print(f'User: {question}
572
+ Assistant: {response}')
573
 
574
  question = 'Please write a poem according to the image.'
575
  response, history = model.chat(tokenizer, pixel_values, question, generation_config, history=history, return_history=True)
576
+ print(f'User: {question}
577
+ Assistant: {response}')
578
 
579
  # multi-image multi-round conversation, combined images (多图多轮对话,拼接图像)
580
  pixel_values1 = load_image('./examples/image1.jpg', max_num=12).to(torch.bfloat16).cuda()
581
  pixel_values2 = load_image('./examples/image2.jpg', max_num=12).to(torch.bfloat16).cuda()
582
  pixel_values = torch.cat((pixel_values1, pixel_values2), dim=0)
583
 
584
+ question = '<image>
585
+ Describe the two images in detail.'
586
  response, history = model.chat(tokenizer, pixel_values, question, generation_config,
587
  history=None, return_history=True)
588
+ print(f'User: {question}
589
+ Assistant: {response}')
590
 
591
  question = 'What are the similarities and differences between these two images.'
592
  response, history = model.chat(tokenizer, pixel_values, question, generation_config,
593
  history=history, return_history=True)
594
+ print(f'User: {question}
595
+ Assistant: {response}')
596
 
597
  # multi-image multi-round conversation, separate images (多图多轮对话,独立图像)
598
  pixel_values1 = load_image('./examples/image1.jpg', max_num=12).to(torch.bfloat16).cuda()
 
600
  pixel_values = torch.cat((pixel_values1, pixel_values2), dim=0)
601
  num_patches_list = [pixel_values1.size(0), pixel_values2.size(0)]
602
 
603
+ question = 'Image-1: <image>
604
+ Image-2: <image>
605
+ Describe the two images in detail.'
606
  response, history = model.chat(tokenizer, pixel_values, question, generation_config,
607
  num_patches_list=num_patches_list,
608
  history=None, return_history=True)
609
+ print(f'User: {question}
610
+ Assistant: {response}')
611
 
612
  question = 'What are the similarities and differences between these two images.'
613
  response, history = model.chat(tokenizer, pixel_values, question, generation_config,
614
  num_patches_list=num_patches_list,
615
  history=history, return_history=True)
616
+ print(f'User: {question}
617
+ Assistant: {response}')
618
 
619
  # batch inference, single image per sample (单图批处理)
620
  pixel_values1 = load_image('./examples/image1.jpg', max_num=12).to(torch.bfloat16).cuda()
 
622
  num_patches_list = [pixel_values1.size(0), pixel_values2.size(0)]
623
  pixel_values = torch.cat((pixel_values1, pixel_values2), dim=0)
624
 
625
+ questions = ['<image>
626
+ Describe the image in detail.'] * len(num_patches_list)
627
  responses = model.batch_chat(tokenizer, pixel_values,
628
  num_patches_list=num_patches_list,
629
  questions=questions,
630
  generation_config=generation_config)
631
  for question, response in zip(questions, responses):
632
+ print(f'User: {question}
633
+ Assistant: {response}')
634
 
635
  # video multi-round conversation (视频多轮对话)
636
  def get_index(bound, fps, max_frame, first_idx=0, num_segments=32):
 
668
  video_path = './examples/red-panda.mp4'
669
  pixel_values, num_patches_list = load_video(video_path, num_segments=8, max_num=1)
670
  pixel_values = pixel_values.to(torch.bfloat16).cuda()
671
+ video_prefix = ''.join([f'Frame{i+1}: <image>
672
+ ' for i in range(len(num_patches_list))])
673
  question = video_prefix + 'What is the red panda doing?'
674
+ # Frame1: <image>
675
+ Frame2: <image>
676
+ ...
677
+ Frame8: <image>
678
+ {question}
679
  response, history = model.chat(tokenizer, pixel_values, question, generation_config,
680
  num_patches_list=num_patches_list, history=None, return_history=True)
681
+ print(f'User: {question}
682
+ Assistant: {response}')
683
 
684
  question = 'Describe this video in detail.'
685
  response, history = model.chat(tokenizer, pixel_values, question, generation_config,
686
  num_patches_list=num_patches_list, history=history, return_history=True)
687
+ print(f'User: {question}
688
+ Assistant: {response}')
689
  ```
690
 
691
  #### Streaming Output
 
769
 
770
  images = [load_image(img_url) for img_url in image_urls]
771
  # Numbering images improves multi-image conversations
772
+ response = pipe((f'Image-1: {IMAGE_TOKEN}
773
+ Image-2: {IMAGE_TOKEN}
774
+ describe these two images', images))
775
  print(response.text)
776
  ```
777
 
 
873
  journal={arXiv preprint arXiv:2508.18265},
874
  year={2025}
875
  }
876
+ @article{zhu2025internvl3,
877
+ title={Internvl3: Exploring advanced training and test-time recipes for open-source multimodal models},
878
+ author={Zhu, Jinguo and Wang, Weiyun and Chen, Zhe and Liu, Zhaoyang and Ye, Shenglong and Gu, Lixin and Tian, Hao and Duan, Yuchen and Su, Weijie and Shao, Jie and others},
879
+ journal={arXiv preprint arXiv:2504.10479},
880
+ year={2025}
881
+ }
882
+ @article{chen2024expanding,
883
+ title={Expanding Performance Boundaries of Open-Source Multimodal Models with Model, Data, and Test-Time Scaling},
884
+ author={Chen, Zhe and Wang, Weiyun and Cao, Yue and Liu, Yangzhou and Gao, Zhangwei and Cui, Erfei and Zhu, Jinguo and Ye, Shenglong and Tian, Hao and Liu, Zhaoyang and others},
885
+ journal={arXiv preprint arXiv:2412.05271},
886
+ year={2024}
887
+ }
888
+ @article{wang2024mpo,
889
+ title={Enhancing the Reasoning Ability of Multimodal Large Language Models via Mixed Preference Optimization},
890
+ author={Wang, Weiyun and Chen, Zhe and Wang, Wenhai and Cao, Yue and Liu, Yangzhou and Gao, Zhangwei and Zhu, Jinguo and Zhu, Xizhou and Lu, Lewei and Qiao, Yu and Dai, Jifeng},
891
+ journal={arXiv preprint arXiv:2411.10442},
892
+ year={2024}
893
+ }
894
+ @article{gao2024mini,
895
+ title={Mini-InternVL: a flexible-transfer pocket multi-modal model with 5% parameters and 90% performance},
896
+ author={Gao, Zhangwei and Chen, Zhe and Cui, Erfei and Ren, Yiming and Wang, Weiyun and Zhu, Jinguo and Tian, Hao and Ye, Shenglong and He, Junjun and Zhu, Xizhou and others},
897
+ journal={Visual Intelligence},
898
+ volume={2},
899
+ number={1},
900
+ pages={1--17},
901
+ year={2024},
902
+ publisher={Springer}
903
+ }
904
+ @article{chen2024far,
905
+ title={How far are we to gpt-4v? closing the gap to commercial multimodal models with open-source suites},
906
+ author={Chen, Zhe and Wang, Weiyun and Tian, Hao and Ye, Shenglong and Gao, Zhangwei and Cui, Erfei and Tong, Wenwen and Hu, Kongzhi and Luo, Jiapeng and Ma, Zheng and others},
907
+ journal={Science China Information Sciences},
908
+ volume={67},
909
+ number={12},
910
+ pages={220101},
911
+ year={2024},
912
+ publisher={Springer}
913
+ }
914
+ @inproceedings{chen2024internvl,
915
+ title={Internvl: Scaling up vision foundation models and aligning for generic visual-linguistic tasks},
916
+ author={Chen, Zhe and Wu, Jiannan and Wang, Wenhai and Su, Weijie and Chen, Guo and Xing, Sen and Zhong, Muyan and Zhang, Qinglong and Zhu, Jinguo and Lu, Lewei and others},
917
+ booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition},
918
+ pages={24185--24198},
919
+ year={2024}
920
+ }
921
  ```
922
+
923
+ ## Acknowledgement
924
+
925
+ InternVL is built with reference to the code of the following projects: [OpenAI CLIP](https://github.com/openai/CLIP), [Open CLIP](https://github.com/mlfoundations/open_clip), [CLIP Benchmark](https://github.com/LAION-AI/CLIP_benchmark), [EVA](https://github.com/baaivision/EVA/tree/master), [InternImage](https://github.com/OpenGVLab/InternImage), [ViT-Adapter](https://github.com/czczup/ViT-Adapter), [MMSegmentation](https://github.com/open-mmlab/mmsegmentation), [Transformers](https://github.com/huggingface/transformers), [DINOv2](https://github.com/facebookresearch/dinov2), [BLIP-2](https://github.com/salesforce/LAVIS/tree/main/projects/blip2), [Qwen-VL](https://github.com/QwenLM/Qwen-VL/tree/master/eval_mm), and [LLaVA-1.5](https://github.com/haotian-liu/LLaVA). Thanks for their awesome work!
926
+
927
+ ______________________________________________________________________
928
+
929
+ Scan the following QR Code, join our WeChat group.
930
+
931
+ <p align="center"><img width="300" alt="image" src="https://github.com/user-attachments/assets/f776df09-ebba-4fd5-80c2-fec4ff1518be"></p>