模型库 / Qwen/Qwen3-VL-2B-Instruct

Qwen3-VL-2B-Instruct

Qwen image-text-to-text transformers
Qwen/Qwen3-VL-2B-Instruct
187,009,049
下载量
586
收藏数
92
浏览量
apache-2.0
许可

简介

Meet Qwen3-VL — 迄今为止通义千问系列中最强大的视觉语言模型。

模型卡片

许可协议 apache-2.0
框架 transformers
任务 image-text-to-text

模型配置

模型类型 qwen3_vl
架构 Qwen3VLForConditionalGeneration

模型详情

已翻译

Qwen3-VL-2B-Instruct

认识 Qwen3-VL — 迄今为止 Qwen 系列中最强大的视觉语言模型。

这一代模型实现了全方位的全面升级:卓越的文本理解与生成、更深入的视觉感知与推理、扩展的上下文长度、增强的空间与视频动态理解,以及更强的智能体交互能力。

提供从边缘到云端均可扩展的 Dense 和 MoE 架构,并配备 Instruct 和推理增强的 Thinking 版本,支持灵活按需部署。

关键增强:

  • 视觉智能体:操控 PC/移动端 GUI — 识别元素、理解功能、调用工具、完成任务。

  • 视觉编码增强:从图像/视频生成 Draw.io/HTML/CSS/JS。

  • 高级空间感知:判断物体位置、视角和遮挡;提供更强的 2D grounding,并支持 3D grounding,用于空间推理和具身 AI。

  • 长上下文与视频理解:原生 256K 上下文,可扩展至 1M;处理书籍和数小时长的视频,具备完整召回和秒级索引能力。

  • 增强的多模态推理:在 STEM/数学领域表现出色 — 因果分析以及基于逻辑和证据的答案。

  • 升级的视觉识别:更广泛、更高质量的预训练能够“识别万物” — 名人、动漫、产品、地标、动植物等。

  • 扩展的 OCR:支持 32 种语言(从 19 种提升而来);在弱光、模糊和倾斜条件下表现稳健;对罕见/古文字和术语处理更佳;改进了长文档结构解析。

  • 与纯 LLM 相当的文本理解:无缝的文本-视觉融合,实现无损、统一的语义理解。

模型架构更新:

  1. Interleaved-MRoPE:通过稳健的位置编码在时间、宽度和高度上进行全频率分配,增强长时域视频推理。

  2. DeepStack:融合多级 ViT 特征以捕捉细粒度细节,并强化图像-文本对齐。

  3. 文本-时间戳对齐:超越 T‑RoPE,实现精确的、基于时间戳的事件定位,以增强视频时序建模。

这是 Qwen3-VL-2B-Instruct 的权重仓库。


模型性能

多模态性能

纯文本性能

快速开始

下面,我们提供简单示例,展示如何使用 🤖 ModelScope 和 🤗 Transformers 使用 Qwen3-VL。

Qwen3-VL 的代码已集成到最新的 Hugging Face transformers 中,我们建议您通过以下命令从源码构建:

pip install git+https://github.com/huggingface/transformers
# pip install transformers==4.57.0 # currently, V4.57.0 is not released

使用 🤗 Transformers 进行对话

以下代码片段展示了如何使用 transformers 与聊天模型交互:

from transformers import Qwen3VLForConditionalGeneration, AutoProcessor

# default: Load the model on the available device(s)
model = Qwen3VLForConditionalGeneration.from_pretrained(
    "Qwen/Qwen3-VL-2B-Instruct", dtype="auto", device_map="auto"
)

# We recommend enabling flash_attention_2 for better acceleration and memory saving, especially in multi-image and video scenarios.
# model = Qwen3VLForConditionalGeneration.from_pretrained(
#     "Qwen/Qwen3-VL-2B-Instruct",
#     dtype=torch.bfloat16,
#     attn_implementation="flash_attention_2",
#     device_map="auto",
# )

processor = AutoProcessor.from_pretrained("Qwen/Qwen3-VL-2B-Instruct")

messages = [
    {
        "role": "user",
        "content": [
            {
                "type": "image",
                "image": "https://qianwen-res.oss-cn-beijing.aliyuncs.com/Qwen-VL/assets/demo.jpeg",
            },
            {"type": "text", "text": "Describe this image."},
        ],
    }
]

# Preparation for inference
inputs = processor.apply_chat_template(
    messages,
    tokenize=True,
    add_generation_prompt=True,
    return_dict=True,
    return_tensors="pt"
)
inputs = inputs.to(model.device)

# Inference: Generation of the output
generated_ids = model.generate(**inputs, max_new_tokens=128)
generated_ids_trimmed = [
    out_ids[len(in_ids) :] for in_ids, out_ids in zip(inputs.input_ids, generated_ids)
]
output_text = processor.batch_decode(
    generated_ids_trimmed, skip_special_tokens=True, clean_up_tokenization_spaces=False
)
print(output_text)

生成超参数

VL

export greedy='false'
export top_p=0.8
export top_k=20
export temperature=0.7
export repetition_penalty=1.0
export presence_penalty=1.5
export out_seq_length=16384

文本

export greedy='false'
export top_p=1.0
export top_k=40
export repetition_penalty=1.0
export presence_penalty=2.0
export temperature=1.0
export out_seq_length=32768

引用

如果您觉得我们的工作有帮助,欢迎引用我们。

@misc{qwen3technicalreport,
      title={Qwen3 Technical Report}, 
      author={Qwen Team},
      year={2025},
      eprint={2505.09388},
      archivePrefix={arXiv},
      primaryClass={cs.CL},
      url={https://arxiv.org/abs/2505.09388}, 
}

@article{Qwen2.5-VL,
  title={Qwen2.5-VL Technical Report},
  author={Bai, Shuai and Chen, Keqin and Liu, Xuejing and Wang, Jialin and Ge, Wenbin and Song, Sibo and Dang, Kai and Wang, Peng and Wang, Shijie and Tang, Jun and Zhong, Humen and Zhu, Yuanzhi and Yang, Mingkun and Li, Zhaohai and Wan, Jianqiang and Wang, Pengfei and Ding, Wei and Fu, Zheren and Xu, Yiheng and Ye, Jiabo and Zhang, Xi and Xie, Tianbao and Cheng, Zesen and Zhang, Hang and Yang, Zhibo and Xu, Haiyang and Lin, Junyang},
  journal={arXiv preprint arXiv:2502.13923},
  year={2025}
}

@article{Qwen2VL,
  title={Qwen2-VL: Enhancing Vision-Language Model's Perception of the World at Any Resolution},
  author={Wang, Peng and Bai, Shuai and Tan, Sinan and Wang, Shijie and Fan, Zhihao and Bai, Jinze and Chen, Keqin and Liu, Xuejing and Wang, Jialin and Ge, Wenbin and Fan, Yang and Dang, Kai and Du, Mengfei and Ren, Xuancheng and Men, Rui and Liu, Dayiheng and Zhou, Chang and Zhou, Jingren and Lin, Junyang},
  journal={arXiv preprint arXiv:2409.12191},
  year={2024}
}

@article{Qwen-VL,
  title={Qwen-VL: A Versatile Vision-Language Model for Understanding, Localization, Text Reading, and Beyond},
  author={Bai, Jinze and Bai, Shuai and Yang, Shusheng and Wang, Shijie and Tan, Sinan and Wang, Peng and Lin, Junyang and Zhou, Chang and Zhou, Jingren},
  journal={arXiv preprint arXiv:2308.12966},
  year={2023}
}

标签

qwen3_vl conversational arxiv:2505.09388 arxiv:2502.13923 arxiv:2409.12191 arxiv:2308.12966 license:apache-2.0 endpoints_compatible

操作


详细信息

厂商
Qwen
任务
image-text-to-text
框架
transformers
模型类型
qwen3_vl
许可(HF)
apache-2.0