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

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

21 Jun 2024arXiv:2406.15334archive 2025-07-28

Brandon Huang, Chancharik Mitra, Assaf Arbelle, Leonid Karlinsky, Trevor Darrell, Roei Herzig

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

PaperPDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2406.15334")

Code

Syntology Ran 14 of 19 code samples harvested from 1 repository linked to this paper; 5 have no recorded run. Of those that ran: 4 ran · honoured contract; 2 ran · violated contract; 1 ran · our draft was wrong; 7 ran with no contract checked.

By repository: official repository: 19 samples from 1 repository, 14 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

brandon3964/multimodal-task-vector officialmentioned in papermentioned on GitHubpytorchNOASSERTION report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

19 samples harvested; 14 ran; 4 honoured the contract we drafted; 5 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

4ran · honoured contract
2ran · violated contract
1ran · our draft was wrong
7ran
5unverified

Licence: 19 of the 19 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from Brandon3964/MultiModal-Task-Vector. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

box_iou Brandon3964/MultiModal-Task-Vector/eval_mm/evaluate_grounding.py official repository ran · honoured contract fingerprinted no licence file found · pointer only · ce749f837424dd8c · report
collate_fn Brandon3964/MultiModal-Task-Vector/eval_mm/evaluate_caption.py official repository ran licence not identified · pointer only · a7ddf937ddb1ba60 · report
collate_fn Brandon3964/MultiModal-Task-Vector/eval_mm/evaluate_grounding.py official repository ran licence not identified · pointer only · d19fe23145498c35 · report
collate_fn Brandon3964/MultiModal-Task-Vector/eval_mm/evaluate_multiple_choice.py official repository ran licence not identified · pointer only · 37a27553c04d476e · report
evaluate_exact_match_accuracy brandon3964/multimodal-task-vector/eval_mm/evaluate_vqa.py official repository ran · honoured contract licence not identified · pointer only · e159a001bd4cbfaa · report
evaluate_relaxed_accuracy brandon3964/multimodal-task-vector/eval_mm/evaluate_vqa.py official repository ran · honoured contract licence not identified · pointer only · 4ffcad52354b4806 · report
format_vizwiz Brandon3964/MultiModal-Task-Vector/MTV/preprocess.py official repository ran licence not identified · pointer only · d3495f004eb282e1 · report
levenshtein_distance Brandon3964/MultiModal-Task-Vector/eval_mm/infographicsvqa_eval.py official repository ran fingerprinted licence not identified · pointer only · 90a8e73fa6de72a4 · report
load_image brandon3964/multimodal-task-vector/MTV/models.py official repository ran · violated contract licence not identified · pointer only · 3275ed06c9e635d8 · report
load_images brandon3964/multimodal-task-vector/MTV/models.py official repository ran · honoured contract fingerprinted licence not identified · pointer only · 8f69c6173ca1fadb · report
open_data Brandon3964/MultiModal-Task-Vector/MTV/preprocess.py official repository ran licence not identified · pointer only · c62b6812691c4ecc · report
preprocess Brandon3964/MultiModal-Task-Vector/finetune.py official repository ran · our draft was wrong no licence file found · pointer only · 8b733c9fc590e4c1 · report
relaxed_correctness brandon3964/multimodal-task-vector/eval_mm/evaluate_vqa.py official repository ran · violated contract licence not identified · pointer only · b3c8680ebd8739af · report
split_activations_by_head Brandon3964/MultiModal-Task-Vector/MTV/mtv_utils.py official repository ran licence not identified · pointer only · d4db6c913fb49a77 · report
add_extra_stop_words Brandon3964/MultiModal-Task-Vector/openai_api.py official repository unverified no licence file found · pointer only · 385a35a03fe04cde · report
evaluate_method Brandon3964/MultiModal-Task-Vector/eval_mm/infographicsvqa_eval.py official repository unverified licence not identified · pointer only · b90651bcc771b76f · report
get_format_func Brandon3964/MultiModal-Task-Vector/MTV/preprocess.py official repository unverified licence not identified · pointer only · 9d2410fb29f7ac7e · report
load_model Brandon3964/MultiModal-Task-Vector/MTV/mtv_utils.py official repository unverified licence not identified · pointer only · 2534a18f2f56fd6c · report
trim_stop_words Brandon3964/MultiModal-Task-Vector/openai_api.py official repository unverified no licence file found · pointer only · 469cf12b400c2c5a · report

Tasks

Few-Shot LearningIn-Context Learning

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

AttentionSETSoftmax

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections