True Multimodal In-Context Learning Needs Attention to the Visual Context

DARA Method Animation

Multimodal Large Language Models (MLLMs), built on powerful language backbones, have enabled Multimodal In-Context Learning (MICL)—adapting to new tasks from a few multimodal demonstrations consisting of images, questions, and answers. Despite showing noticeable improvement on standard vision-language datasets, current MLLMs struggle to leverage visual information in the demonstrations. Specifically, they tend to neglect visual cues and over-rely on textual patterns, leading to mere text imitation rather than genuine multimodal adaptation. This behavior makes MICL still unimodal and largely restricts its practical utility.

MICL and Visual Context Neglect

Multimodal In-Context Learning (MICL) enables models to adapt to new tasks from few multimodal demonstrations. However, current MLLMs struggle to effectively utilize visual information in demonstrations, tending to overlook visual cues and over-rely on textual patterns. This results in textual pattern imitation rather than genuine multimodal adaptation.

MICL Problem Illustration
Examples of using MICL to solve image captioning from MSCOCO (top) and Clock Math from our proposed dataset, TrueMICL (bottom). Generating captions relies more on task recognition and can be answered based on text patterns in demos, without deep understanding of demo images. However, our task requires task learning where the model needs to learn the relationship between text and images in the demos.

This limitation is often concealed by improved performance on tasks that do not require deep visual context understanding. For example, models can generate reasonable captions for query images even without referencing demo images, as they rely on textual pattern following rather than multimodal understanding.

DARA: Dynamic Attention Reallocation

To address the visual context neglect in MICL, we introduce Dynamic Attention Reallocation (DARA), an efficient fine-tuning strategy that encourages models to attend to visual context by rebalancing attention across visual and textual tokens. DARA introduces a set of learnable attention-balancing parameters that dynamically regulate the influence of visual and textual tokens during attention computation.

Lightweight and Efficient

DARA is remarkably lightweight, introducing only a small number of learnable parameters for rapid adaptation. We insert DARA into the first transformer layer of the language backbone, specifically targeting attention score matrices in all attention heads. Given 5 images (4-shot demos + query) and 32 attention heads, the total number of learnable parameters is only 5×32=160. With around 100 parameters, DARA achieves up to 10% improvement on downstream tasks.

Visualization of DARA's Reallocation Effects

To better understand how DARA affects attention, we present both qualitative and quantitative visualizations showing DARA's impact on attention patterns.

Spatial Attention Analysis

The spatial attention heatmap shows that without DARA, both demonstration and query images receive minimal attention, as indicated by predominantly blue regions. After applying DARA, attention over image tokens increases markedly (more red/yellow areas), indicating enhanced attention to visual input and improved visual grounding.

Attention Heatmaps
Attention heatmaps over input images without (top) and with (bottom) applying DARA. DARA enhances visual attention both qualitatively, showing increased focus on image regions.

Quantitative Attention Distribution

We quantitatively compare attention allocation across different modality tokens. Without DARA, the model allocates only 28% of attention to image tokens, focusing primarily on text. With DARA, this increases to 46.7%, demonstrating a substantial shift toward visual content during response generation.

Attention Distribution Chart
Normalized attention ratios over image and text tokens without and with applying DARA. DARA significantly increases attention allocation to visual content from 28% to 46.7%.

Head-wise Attention Amplification

The learned attention amplification factors across different attention heads and images reveal structured visual emphasis. DARA induces clear redistribution: demo images consistently receive factors larger than 1, encouraging stronger reliance on context, while different heads specialize in different aspects - for example, Head 1 emphasizes Demo 2 (1.27), while Head 5 emphasizes Demo 4 (1.32).

Head-wise Analysis
Learned attention amplification factors across 8 heads and 5 images in the first transformer layer of Qwen2-VL. Values larger than 1 indicate attention amplification on visual tokens, showing DARA's selective, context-aware visual attention during MICL.

TrueMICL: A Dedicated MICL Dataset

We introduce TrueMICL, a MICL-dedicated dataset designed with a critical principle: correct responses must rely on comprehensive understanding of multimodal context, especially visual information. Unlike existing MICL datasets that focus on task recognition, TrueMICL emphasizes task learning where models must understand relationships between visual and textual elements.

Dataset Design Principles

To this end, we have designed a novel MICL-dedicated dataset, TrueMICL, guided by the following principles:

  1. Context Dependency: The task must be unsolvable without the context images. This ensures that models cannot rely solely on textual patterns or prior knowledge.
  2. Novelty: The task should introduce novel image-text relationships that are uncommon in pre-training or instruction tuning, to effectively challenge task learning ability.
  3. Perceivable Visual Information: The necessary information extracted from the images should not be overly complex, ensuring that the visual encoder can perceive it accurately. This allows us to focus on MICL ability rather than visual perception challenges.
  4. Compatibility with Backbone: The task should push the boundaries of multimodal in-context learning without exceeding the language backbone's capabilities.
  5. Configurability and Extensibility: This pipeline should be easily configured to generate more data samples with different levels of difficulty.

TrueMICL comprises 867 samples across 4 task types and 7 distinct tasks, covering mathematical reasoning, pattern finding, and novel visual concept learning. The dataset is designed to be scalable and configurable for different levels of difficulty.

Dataset Examples

The table below shows representative examples from TrueMICL, illustrating how each task requires understanding the relationship between images and text in demonstrations to correctly answer queries.

Category Task Demo 1 Demo 2 Query Label Explanation
Math Reasoning Operator Induction OI Demo 1 0 OI Demo 2 12 OI Query 8 Multiplying the two numbers in the image
Clock Math CM Demo 1 14 CM Demo 2 3 CM Query 20 Adding the two numbers in the clock
Concept Binding Outlier Detection SC Demo 1 Green SC Demo 2 Black SC Query Red The outlier color in the image
CLEVR Count CL Demo 1 2 CL Demo 2 5 CL Query 2 The number of spheres
Pattern Finding Sudoku SD Demo 1 918 SD Demo 2 217 SD Query 470 The missing number in between
Palindrome PN Demo 1 7 PN Demo 2 9 PN Query 9 To form palindrome number
Novel Concept Character Classification CC Demo 1 Flora CC Demo 2 Walter CC Query Flora The same character in the demo

Table: An overview of task examples in TrueMICL. The label to the query requires the model to learn the relationship between images and text in the demonstrations.

Experimental Results

Our comprehensive experiments across various MLLMs demonstrate the effectiveness of both DARA and TrueMICL. Current MLLMs find TrueMICL evaluation tasks quite challenging, and DARA significantly improves MICL performance on both our evaluation tasks and standard VL tasks.

Experimental Results
Comparison of different methods on TrueMICL dataset showing significant improvements with DARA fine-tuning across multiple model architectures.

Key Findings

Takeaways

🎯 Main Contributions

  • Visual Context Neglect Problem: We identify and address a critical limitation in current MLLMs - their tendency to neglect visual information in multimodal demonstrations, leading to superficial text imitation rather than genuine multimodal learning.
  • DARA Method: Our Dynamic Attention Reallocation approach provides an efficient solution with minimal parameters (as few as 160), achieving up to 10% performance improvements by strategically rebalancing attention toward visual content.
  • TrueMICL Benchmark: We introduce a rigorous evaluation dataset specifically designed to test true multimodal in-context learning capabilities, revealing significant gaps in current model performance.

💡 Key Insights

  • Attention Matters: Visualization analysis confirms that DARA successfully redirects model attention from text-dominant (28%) to more balanced multimodal processing (46.7% visual attention).
  • Parameter Efficiency: DARA demonstrates that targeted architectural modifications can be more effective than large-scale parameter tuning, requiring 40-50× fewer parameters than LoRA to achieve similar performance.
  • Evaluation Gap: Standard VL benchmarks fail to capture true MICL capabilities, highlighting the need for dedicated evaluation frameworks like TrueMICL.

🚀 Future Implications

  • Practical Impact: DARA's lightweight design makes it easily deployable in resource-constrained environments while providing consistent improvements across different model architectures.
  • Research Direction: Our work opens new avenues for investigating attention mechanisms in multimodal learning and designing more effective MICL evaluation protocols.
  • Broader Applications: The principles behind DARA can potentially be extended to other multimodal tasks beyond in-context learning, wherever visual attention reallocation is beneficial.

BibTeX

@misc{chen2024neglected,
  title={From Neglected to Indispensable: Emphasizing the Visual Context for Multimodal In-Context Learning},
  author={Shuo Chen and Jianzhe Liu and Zhen Han and Yan Xia and Daniel Cremers and Philip Torr and Volker Tresp and Jindong Gu}
  year={2024},
  conference={COLM 2025},
  primaryClass={cs.CV}
}

Acknowledgement

This template is adapted from Eyes Wide Shut.