arXiv:2504.08851cs.LGcs.AI2025-04CVPR被引 15

让多模态模型更稳定地理解示例,提升少样本学习效果。

Mimic In-Context Learning for Multimodal Tasks

  • 通过可学习的动态向量模拟示例对模型的影响
  • 在三个任务上均超越现有方法,最高提升6.2%准确率
  • 适合需要少样本泛化能力的多模态应用

近期,上下文学习(ICL)已成为大型多模态模型(LMMs)的重要推理范式,利用少量上下文示例(ICDs)引导模型完成新任务。然而,多模态数据的协同效应使ICL性能对ICD配置更加敏感,亟需更稳定、通用的映射函数。数学上,在基于Transformer的模型中,ICDs充当“偏移向量”,作用于查询标记的隐藏状态。受此启发,本文提出模仿上下文学习(MimIC),从ICDs中学习稳定且可泛化的偏移效应。具体而言,相比以往基于偏移向量的方法,MimIC通过四个关键改进更严格逼近偏移效果:1)在注意力层后插入偏移向量;2)为每个注意力头分配独立偏移向量;3)使偏移幅度依赖于查询内容;4)引入分层对齐损失。在Idefics-9b和Idefics2-8b-base两个LMM上,针对VQAv2、OK-VQA和图像描述三个任务的大量实验表明,MimIC优于现有偏移向量方法。代码已开源。

原文摘要 · Abstract (English)

Recently, In-context Learning (ICL) has become a significant inference paradigm in Large Multimodal Models (LMMs), utilizing a few in-context demonstrations (ICDs) to prompt LMMs for new tasks. However, the synergistic effects in multimodal data increase the sensitivity of ICL performance to the configurations of ICDs, stimulating the need for a more stable and general mapping function. Mathematically, in Transformer-based models, ICDs act as "shift vectors" added to the hidden states of query tokens. Inspired by this, we introduce Mimic In-Context Learning (MimIC) to learn stable and generalizable shift effects from ICDs. Specifically, compared with some previous shift vector-based methods, MimIC more strictly approximates the shift effects by integrating lightweight learnable modules into LMMs with four key enhancements: 1) inserting shift vectors after attention layers, 2) assigning a shift vector to each attention head, 3) making shift magnitude query-dependent, and 4) employing a layer-wise alignment loss. Extensive experiments on two LMMs (Idefics-9b and Idefics2-8b-base) across three multimodal tasks (VQAv2, OK-VQA, Captioning) demonstrate that MimIC outperforms existing shift vector-based methods. The code is available at https://github.com/Kamichanw/MimIC.

多模态上下文学习模型优化

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