arXiv:2504.04633cs.CVcs.AI2025-04被引 39

用可学习向量替代图文示范,让视觉语言模型更高效地理解新任务。

M$^2$IV: Towards Efficient and Fine-grained Multimodal In-Context Learning via Representation Engineering

  • 用可训练的多模态向量代替原始图文示范,注入模型残差流中。
  • 在多个任务上提升3.74%准确率,同时大幅降低token消耗。
  • 适合需要快速定制视觉语言模型的应用场景。

多模态上下文学习(ICL)使大型视觉语言模型(LVLMs)能够通过用户提供的多个示范样例,在不更新模型参数的情况下适应新任务。然而,其效果受限于多模态输入的高token开销以及跨模态少样本推理的复杂性,导致模型难以从示范中提取有效模式。为此,我们提出M$^2$IV,一种新型表示工程方法:将显式的token级示范替换为一组可学习的多模态上下文向量,直接注入到LVLM的残差流中。通过分析多头注意力(MHA)与多层感知机(MLP)在ICL过程中的不同作用,设计了训练策略,实现细粒度语义蒸馏与鲁棒跨模态表征学习。M$^2$IV不仅在多种任务和模型上均提升性能,还显著降低token开销,支持平滑扩展至多示例场景。为进一步提升可用性,我们引入VLibrary——一个存储训练好的M$^2$IV的仓库,支持灵活检索与注入。用户可通过VLibrary以自定义方式引导预训练的LVLM,满足多样化需求。大量实验表明,M$^2$IV持续优于原始ICL及先前表示工程基线,在平均准确率上提升3.74%,整体效率显著提高。

原文摘要 · Abstract (English)

Multimodal in-context learning (ICL) equips Large Vision-language Models (LVLMs) with the ability to adapt to new tasks via multiple user-provided demonstrations, without requiring any model parameter updates. However, its effectiveness is constrained by the token-intensive nature of multimodal inputs and the complexity of cross-modal few-shot reasoning, which together hinder LVLMs from extracting useful patterns from demonstrations. To address these challenges, we propose \textbf{M$^2$IV}, a novel representation engineering approach that replaces explicit token-level demonstrations with a set of learnable Multimodal In-context Vectors directly injected into the residual streams of LVLMs. By analyzing the distinct roles of multi-head attention (MHA) and multi-layer perceptrons (MLP) in the ICL process, we design a training strategy that enables M$^2$IV to perform fine-grained semantic distillation and robust cross-modal representation learning. M$^2$IV not only improves performance across diverse tasks and LVLMs but also significantly reduces token overhead, enabling graceful scaling to many-shot scenarios. To further enhance usability, we introduce \textbf{VLibrary}, a repository that stores trained M$^2$IVs for flexible retrieval and injection. With VLibrary, users can steer pre-trained LVLMs in a customized manner that meets diverse requirements. Extensive experiments demonstrate that M$^2$IV consistently outperforms vanilla ICL and prior representation engineering baselines, achieving an average accuracy gain of 3.74\% with substantial improvements in overall efficiency.

多模态上下文学习表示工程视觉语言模型

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。