月之暗面再次开源Kimi大模型——Kimi-VL-A3B-Instruct 和 Kimi-VL-A3B-Thinking

我们介绍的 Kimi-VL,是一种高效的开源专家混合物(MoE)视觉语言模型(VLM),它具有先进的多模态推理能力、长语境理解能力和强大的代理能力,而在其语言解码器(Kimi-VL-A3B)中只需激活 2.8B 个参数。

Kimi-VL 在各个具有挑战性的领域都表现出了强劲的性能:作为一种通用的视觉语言模型,Kimi-VL 在多轮代理交互任务(例如 OSWorld)中表现出色,取得了与旗舰模型相当的先进成果。此外,它还在各种具有挑战性的视觉语言任务中表现出卓越的能力,包括大学水平的图像和视频理解、光学字符识别(OCR)、数学推理、多图像理解等。

在比较评估中,它能有效地与 GPT-4o-mini、Qwen2.5-VL-7B 和 Gemma-3-12B-IT 等尖端高效 VLM 竞争,同时在多个专业领域超越 GPT-4o。

Kimi-VL 还在处理长语境和清晰感知方面推进了多模态模型的帕累托前沿:由于配备了 128K 扩展上下文窗口,Kimi-VL 可以处理各种长输入内容,在 LongVideoBench 和 MMLongBench-Doc 上分别取得了 64.5 和 35.1 的优异成绩;其原生分辨率视觉编码器 MoonViT 进一步使其能够看到并理解超高分辨率的视觉输入内容,在 InfoVQA 和 ScreenSpot-Pro 上分别取得了 83.2 和 34.5 的优异成绩,同时在处理普通视觉输入内容和一般任务时保持了较低的计算成本。

在此基础上,我们推出了一种先进的长期思维变体:Kimi-VL-Thinking。该模型通过长思维链(CoT)监督微调(SFT)和强化学习(RL)开发而成,具有强大的长视距推理能力。它在 MMMU、MathVision 和 MathVista 上的得分分别为 61.7、36.8 和 71.3,同时保持了 2.8B 的紧凑型激活 LLM 参数占用空间,为高效且功能强大的多模态思维模型设定了新标准。

架构

如下图所示,该模型采用了 MoE 语言模型、原生分辨率视觉编码器(MoonViT)和 MLP 投影仪。

在这里插入图片描述

性能

Kimi-VL-A3B-Instruct

作为一种高效的模型,Kimi-VL 可以在广泛的输入形式(单图像、多图像、视频、长文档等)中稳健地处理各种任务(细粒度感知、数学、大学问题、OCR、代理等)。

与现有的 10B 级密集 VLM 和 DeepSeek-VL2 (A4.5B) 进行简要比较:

在这里插入图片描述
全面对比(包括 GPT-4o 供参考):

Benchmark (Metric)GPT-4oGPT-4o-MiniQwen2.5-VL-7BLlama3.2-11B-Inst.Gemma3-12B-ITDeepSeek-VL2Kimi-VL-A3B-Instruct
Architecture--DenseDenseDenseMoEMoE
# Act. Params (LLM+VT)--7.6B+0.7B8B+2.6B12B+0.4B4.1B+0.4B2.8B+0.4B
# Total Params--8B11B12B28B16B
College-level
MMMU-Val (Pass@1)69.160.058.64859.651.157.0
VideoMMMU (Pass@1)61.2-47.441.857.244.452.6
MMVU-Val (Pass@1)67.461.650.144.457.052.152.2
General
MMBench-EN-v1.1 (Acc)83.177.182.665.874.679.683.1
MMStar (Acc)64.754.863.949.856.155.561.3
MMVet (Pass@1)69.166.967.157.664.960.066.7
RealWorldQA (Acc)75.467.168.563.359.168.468.1
AI2D (Acc)84.677.883.977.378.181.484.9
Multi-image
BLINK (Acc)68.053.656.439.850.3-57.3
Math
MathVista (Pass@1)63.852.568.247.756.162.868.7
MathVision (Pass@1)30.4-25.113.632.117.321.4
OCR
InfoVQA (Acc)80.757.982.634.643.878.183.2
OCRBench (Acc)815785864753702811867
OS Agent
ScreenSpot-V2 (Acc)18.16.984.2---92.8
ScreenSpot-Pro (Acc)0.8-29.0---34.5
OSWorld (Pass@1)5.03-2.5---8.22
WindowsAgentArena (Pass@1)9.42.73.4---10.4
Long Document
MMLongBench-Doc (Acc)42.829.029.613.821.3-35.1
Long Video
Video-MME (w/o sub.)71.964.865.146.058.2-67.8
Video-MME (w sub.)77.268.971.649.562.1-72.6
MLVU-MCQ (Acc)64.648.170.244.452.3-74.2
LongVideoBench (val)66.758.256.045.551.5-64.5
Video Perception
EgoSchema (full)72.2-65.054.356.938.578.5
VSI-Bench34.0-34.220.632.421.737.4
TOMATO37.728.827.621.528.627.231.7

我们将介绍如何使用 transformers 库在推理阶段使用我们的模型。建议使用 python=3.10, torch>=2.1.0 和 transformers=4.48.2 作为开发环境。

from PIL import Image
from transformers import AutoModelForCausalLM, AutoProcessor
model_path = "moonshotai/Kimi-VL-A3B-Instruct"
model = AutoModelForCausalLM.from_pretrained(
    model_path,
    torch_dtype="auto",
    device_map="auto",
    trust_remote_code=True,
)
processor = AutoProcessor.from_pretrained(model_path, trust_remote_code=True)
image_path = "./figures/demo.png"
image = Image.open(image_path)
messages = [
    {"role": "user", "content": [{"type": "image", "image": image_path}, {"type": "text", "text": "What is the dome building in the picture? Think step by step."}]}
]
text = processor.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt")
inputs = processor(images=image, text=text, return_tensors="pt", padding=True, truncation=True).to(model.device)
generated_ids = model.generate(**inputs, max_new_tokens=512)
generated_ids_trimmed = [
    out_ids[len(in_ids) :] for in_ids, out_ids in zip(inputs.input_ids, generated_ids)
]
response = processor.batch_decode(
    generated_ids_trimmed, skip_special_tokens=True, clean_up_tokenization_spaces=False
)[0]
print(response)

Kimi-VL-A3B-Thinking

凭借有效的长思考能力,Kimi-VL-A3B-Thinking 在 MathVision 基准测试中的性能可媲美 30B/70B 前沿开源 VLM:

在这里插入图片描述

Benchmark (Metric)GPT-4oGPT-4o-miniQwen2.5-VL-72BQwen2.5-VL-7BGemma-3-27BGemma-3-12Bo1-1217QVQ-72BKimi-k1.5Kimi-VL-Thinking-A3B
Thinking Model?
MathVision (full) (Pass@1)30.4-38.125.135.532.1-35.938.636.8
MathVista (mini) (Pass@1)63.856.774.868.262.356.471.071.474.971.3
MMMU (val) (Pass@1)69.160.074.858.664.859.677.370.370.061.7
我们将介绍如何使用 transformers 库在推理阶段使用我们的模型。建议使用 python=3.10, torch>=2.1.0 和 transformers=4.48.2 作为开发环境。
from PIL import Image
from transformers import AutoModelForCausalLM, AutoProcessor
model_path = "moonshotai/Kimi-VL-A3B-Thinking"
model = AutoModelForCausalLM.from_pretrained(
    model_path,
    torch_dtype="auto",
    device_map="auto",
    trust_remote_code=True,
)
processor = AutoProcessor.from_pretrained(model_path, trust_remote_code=True)
image_paths = ["./figures/arch.png", "./figures/thinking_perf.png"] # 官方Demo图片错误,我直接换了其他的用于测试多图理解
images = [Image.open(path) for path in image_paths]
messages = [
    {
        "role": "user",
        "content": [
            {"type": "image", "image": image_path} for image_path in image_paths
        ] + [{"type": "text", "text": "Please infer step by step who this manuscript belongs to and what it records"}],
    },
]
text = processor.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt")
inputs = processor(images=images, text=text, return_tensors="pt", padding=True, truncation=True).to(model.device)
generated_ids = model.generate(**inputs, max_new_tokens=2048)
generated_ids_trimmed = [
    out_ids[len(in_ids) :] for in_ids, out_ids in zip(inputs.input_ids, generated_ids)
]
response = processor.batch_decode(
    generated_ids_trimmed, skip_special_tokens=True, clean_up_tokenization_spaces=False
)[0]
print(response)
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值