提出可变视觉位置编码,提升视觉语言模型处理长序列能力
V2PE: Improving Multimodal Long-Context Capability of Vision-Language Models with Variable Visual Position Encoding
- 用可变小增量编码视觉令牌,优化长序列管理
- 在256K token数据上训练,可处理高达100万token的多模态序列
- 适合需要理解视频、高分辨率图像等长上下文任务的研究者
视觉语言模型(VLMs)在多模态任务中表现优异,但在处理视频、高分辨率图像或长图文文档等长上下文场景时表现不佳。本文通过构建增强型长上下文多模态数据集,对VLMs的长上下文能力进行实证分析,发现直接将文本位置编码应用于视觉令牌效果不佳,当位置编码超过模型上下文窗口时性能急剧下降。为此,我们提出可变视觉位置编码(V2PE),采用可变且更小的增量对视觉令牌进行编码,从而更高效地管理长多模态序列。实验表明,V2PE显著提升了VLM在长上下文任务中的理解与推理能力。我们将V2PE与增强数据集结合,微调开源模型InternVL2,使其在标准和长上下文任务中均表现优异。特别地,当训练数据序列长度增至256K token时,模型可处理长达1M token的多模态序列,展现出在真实长上下文应用中的巨大潜力。
原文摘要 · Abstract (English)
Vision-Language Models (VLMs) have shown promising capabilities in handling various multimodal tasks, yet they struggle in long-context scenarios, particularly in tasks involving videos, high-resolution images, or lengthy image-text documents. In our work, we first conduct an empirical analysis of the long-context capabilities of VLMs using our augmented long-context multimodal datasets. Our findings reveal that directly applying the positional encoding mechanism used for textual tokens to visual tokens is suboptimal, and VLM performance degrades sharply when the position encoding exceeds the model's context window. To address this, we propose Variable Visual Position Encoding (V2PE), a novel positional encoding approach that employs variable and smaller increments for visual tokens, enabling more efficient management of long multimodal sequences. Our experiments demonstrate the effectiveness of V2PE to enhances VLMs' ability to effectively understand and reason over long multimodal contexts. We further integrate V2PE with our augmented long-context multimodal datasets to fine-tune the open-source VLM, InternVL2. The fine-tuned model achieves strong performance on both standard and long-context multimodal tasks. Notably, when the sequence length of the training dataset is increased to 256K tokens, the model is capable of processing multimodal sequences up to 1M tokens, highlighting its potential for real-world long-context applications.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。