What Factors Affect Multi-Modal In-Context Learning? An In-Depth Exploration

Libo Qin, Qiguang Chen, Hao Fei, Zhi Chen, Min Li, Wanxiang Che

Abstract

Multi-modal In-Context Learning (MM-ICL) has emerged as a powerful paradigm for Vision-Language Models (VLLMs), allowing them to perform complex tasks using a few-shot prompting approach without parameter updates. However, the specific factors influencing MM-ICL performance remain poorly understood. This paper presents a systematic investigation into the mechanics of MM-ICL, evaluating 20 strategies across three critical dimensions: demonstration retrieval, ordering, and prompt construction. Our findings reveal that multi-modal alignment is a more significant performance driver than model scale, and that the internal structure of demonstrations—specifically an "image-first" sequence—is vital for success.

1. Introduction

In-context learning (ICL) has transformed the utility of Large Language Models (LLMs), enabling rapid adaptation to new tasks via natural language prompts. As these models evolve into Multi-modal Large Language Models (VLLMs), the scope of ICL has expanded to include interleaved image and text data. Despite its growing adoption, MM-ICL has largely been treated as a "black box," with prompt engineering relying on trial and error. This study addresses this gap by providing a comprehensive "post-mortem" of the factors that dictate MM-ICL efficacy.

2. Methodology

The researchers decomposed the MM-ICL process into three distinct stages, testing 20 different strategies across six representative VLLMs, including GPT-4V, Gemini-Pro, and Qwen-VL.

2.1 Demonstration Retrieval

The study compared various methods for selecting the most effective examples from a validation set. This included evaluating textual, visual, and multi-modal encoders to determine which modality provides the best signal for retrieving relevant context.

2.2 Demonstration Ordering

The authors distinguished between two types of ordering:

  • Inter-demonstration ordering: The sequence in which different examples are presented to the model.
  • Intra-demonstration ordering: The internal sequence of modalities within a single example (e.g., whether the image should precede the text or vice versa).

2.3 Prompt Construction

The final stage involved optimizing the "wrapper" of the prompt. This included testing the necessity of explicit delimiters (e.g., [REQUEST], [RESPONSE]) and the optimal placement of task instructions (Introductory, Summative, or per-example).

3. Experimental Setup and Datasets

The evaluation utilized two primary benchmarks to ensure a broad task coverage:

  • $M^3IT$: A large-scale dataset for multi-modal instruction tuning, covering image captioning (COCO), Visual Question Answering (VQA-v2), and image classification (ImageNet).
  • $M^3CoT$: A benchmark focused on multi-step multi-modal chain-of-thought reasoning, such as ScienceQA.

To maintain statistical significance while managing computational overhead, the authors sampled 500 items per sub-dataset across four major task categories.

4. Key Findings

The systematic exploration yielded several counter-intuitive insights into how VLLMs process in-context information.

4.1 The Primacy of Multi-Modal Alignment

A significant finding was that model scale (parameter count) is not the primary determinant of MM-ICL success. Models ranging from 8B to 100B+ parameters showed that performance is more closely tied to multi-modal alignment. Retrievers that effectively bridge the gap between image and text embeddings outperformed those relying on a single modality.

4.2 The "Image-First" Advantage

In terms of intra-demonstration ordering, placing the image before the text (Image $\rightarrow$ Text) consistently yielded better results. This suggests that VLLMs perform better when they establish a visual context before interpreting the associated textual instructions or labels.

4.3 Implicit Delimiters and Instruction Placement

Unlike text-only ICL, where explicit delimiters are crucial for performance, MM-ICL models appear to treat the "modality switch" (the transition from pixels to tokens) as a natural separator. Furthermore, Introductory Instructions—placed at the very beginning of the prompt—were found to be more effective than placing instructions at the end or repeating them within each example.

5. Quantitative Results

  • Retrieval Gains: Multi-modal retrievers achieved an average performance increase of 3.84% over random selection. In specific models like Qwen-VL, the gains were even more pronounced.
  • Domain Sensitivity: The use of out-of-domain examples led to a performance degradation of approximately 4%, highlighting the importance of task-relevant retrieval.
  • The Three-Example Peak: Performance generally peaked at three demonstrations. Adding more examples often led to "cognitive overload" and a subsequent decline in accuracy, particularly in complex reasoning tasks.
  • Similarity Metrics: Cosine similarity proved superior to L2 distance for example selection, indicating that the orientation of the embedding vector is more critical than its magnitude.

6. Conclusion and Future Work

This study moves MM-ICL from a heuristic-based "alchemy" toward a structured engineering discipline. While providing a robust roadmap, the authors note several areas for future exploration, including the extension of these rules to video and audio modalities, the impact of complex visual prompting (e.g., bounding boxes), and the performance of MM-ICL in non-English contexts.

Summary updated

BibTeX
@inproceedings{qin2024what,
  author = {Libo Qin and Qiguang Chen and Hao Fei and Zhi Chen and Min Li and Wanxiang Che},
  title = {{What Factors Affect Multi-Modal In-Context Learning? An In-Depth Exploration}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=REVdYKGcfb},
}
Figure