Introduction
Large Multimodal Models (LMMs), such as Qwen-VL and Idefics2, have demonstrated a remarkable ability to learn from examples provided within a prompt, a paradigm known as In-Context Learning (ICL). Research indicates that "many-shot" ICL—providing hundreds of demonstrations—can significantly enhance performance. However, this approach faces two primary bottlenecks: context window constraints, where image tokens rapidly consume available memory, and high inference overhead due to the exponential increase in latency when processing long sequences.
To mitigate these issues, researchers have turned to task vectors—compact representations of demonstrations injected directly into a model's internal activations. This paper introduces Sensitivity-aware Task Vector insertion (STV), a framework designed to optimize both the placement ("where") and the content ("what") of these task vectors.
Methodology
The STV framework operates in two distinct stages to optimize the injection of task information:
- Sensitivity-Aware Location Identification ("Where"): The authors observed that specific attention heads are more responsive to context than others. By calculating "activation deltas"—the difference in internal activations when a query is processed with versus without context—they identify the most sensitive layers and heads. This averaged delta map allows for targeted intervention in the top-K most sensitive locations.
- RL-based Vector Selection ("What"): Rather than using a simple average of demonstration activations, which can dilute task-specific nuances, STV constructs a cluster bank of activations using k-means. It then employs the REINFORCE algorithm to iteratively select the optimal cluster for each sensitive location, maximizing the reward based on task loss.
At inference time, the model performs a single forward pass where original activations at identified locations are replaced by the learned task vectors, effectively simulating a many-shot environment without the associated token cost.
Experimental Results and Analysis
The framework was evaluated across five diverse vision-language benchmarks, including VizWiz and OK-VQA, using Qwen-VL-7B and Idefics2-8B models.
Performance and Efficiency
STV achieved a state-of-the-art accuracy of 58.3% on VizWiz, significantly outperforming the previous leading task-vector method, MTV (45.6%), and standard 4-shot ICL (42.0%). Beyond accuracy, STV offers a massive leap in efficiency, reducing the time required to search for optimal insertion locations from 6,000 seconds to just 88 seconds—a 98.53% reduction.
Targeted Intervention vs. Global Change
A key finding of the study is that more intervention is not always better. Performance typically peaks at a specific number of sensitive locations (approximately 300 for Qwen-VL) and degrades if task vectors are inserted into "insensitive" areas of the model. This underscores the importance of the sensitivity-aware mapping stage.
Representation Richness
The use of a cluster bank and reinforcement learning proved superior to traditional averaging. By selecting specific cluster centers, STV preserves the "representation richness" of the demonstrations, allowing the model to capture finer task details that are otherwise lost.
Conclusion
Sensitivity-aware Task Vector insertion (STV) provides a robust and highly efficient framework for many-shot multimodal ICL. By identifying exactly where and what to inject into a model's activation space, STV enables LMMs to benefit from the equivalent of a 400-shot setup while remaining within standard memory and latency constraints. Future work may extend this logic to other modalities such as video and audio-centric models.
Summary updated