Multimodal Task Vectors Enable Many-Shot Multimodal In-Context Learning

Brandon Huang, Chancharik Mitra, Assaf Arbelle, Leonid Karlinsky, Trevor Darrell +1 more
6/21/2024
cs.CVcs.AIcs.CL

Official code: Brandon3964/MultiModal-Task-Vector (27 stars, last commit 2025-04-08).

Abstract

The recent success of interleaved Large Multimodal Models (LMMs) in few-shot learning suggests that in-context learning (ICL) with many examples can be promising for learning new tasks. However, this many-shot multimodal ICL setting has one crucial problem: it is fundamentally limited by the model's context length set at pretraining. The problem is especially prominent in the multimodal domain, which processes both text and images, requiring additional tokens. This motivates the need for a multimodal method to compress many shots into fewer tokens without finetuning. In this work, we enable LMMs to perform multimodal, many-shot in-context learning by leveraging Multimodal Task Vectors (MTV) -- compact implicit representations of in-context examples compressed in the model's attention heads. Specifically, we first demonstrate the existence of such MTV in LMMs and then leverage these extracted MTV to enable many-shot in-context learning for various vision-and-language tasks. Our experiments suggest that MTV can scale in performance with the number of compressed shots and generalize to similar out-of-domain tasks without additional context length for inference. Code: https://github.com/Brandon3964/MultiModal-Task-Vector

View on arXivView PDF

Code Implementations(1)

[NeurIPS 2024] Official Code for the Paper "Multimodal Task Vectors Enable Many-Shot Multimodal In-Context Learning"

277Shell, PythonOct 18, 20241 years agoNOASSERTION

Similar Papers

Cite this paper

@article{huang2024multimodal,
  title  = {Multimodal Task Vectors Enable Many-Shot Multimodal In-Context Learning},
  author = {Brandon Huang and Chancharik Mitra and Assaf Arbelle and Leonid Karlinsky and Trevor Darrell and Roei Herzig},
  year   = {2024},
  eprint = {2406.15334},
  archivePrefix = {arXiv},
  doi    = {10.48550/arXiv.2406.15334},
  url    = {http://arxiv.org/abs/2406.15334v3},
  journal = {NEURIPS 2024 2024}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2406.15334.svg)](https://codeofpaper.com/paper/2406.15334)

Discussion