---
title: Multi-Modal In-Context Learning
url: https://www.emergentmind.com/topics/multi-modal-in-context-learning-mm-icl
type: topic
---

# Multi-Modal In-Context Learning

Multi-Modal In-Context Learning (MM-ICL) generalizes the in-context learning (ICL) paradigm of large language models (LLMs) to settings where both visual and textual information serve as context and/or input. Rather than relying on traditional fine-tuning, MM-ICL enables large multimodal or vision–language models (VLMs, LVLMs, LMMs) to “learn” new tasks or domains at inference time simply by conditioning on a sequence of few-shot multimodal demonstrations (e.g., paired images, texts, tables, diagrams, and their outputs). MM-ICL has rapidly emerged as a principal research topic in multimodal AI, with specific focus on the design, retrieval, configuration, and interpretation of demonstration sequences, as well as the underlying mechanisms governing the effectiveness and limitations of the approach.

## 1. Definition and Core Paradigm

In MM-ICL, a model receives a prompt formed by interleaving $n$ support demonstrations, each typically a triplet of an image, text (e.g., question), and answer: $C = \{(I_i, T_i, R_i)\}_{i=1}^n$, followed by a query $(I_q, T_q)$. The model is expected to predict $R_q$ without parameter updates:
$$
R_q = VLM([C, (I_q, T_q)])
$$
The demonstrations may span different modalities such as text, images, tables, or a combination (“hybrid QA”), and the query is cast in the same format. Unlike fine-tuning, the model zero-shots or few-shots new tasks by analogy from the context window.

MM-ICL also subsumes hybrid pipelines where all modalities are projected into a shared token space and then consumed by a decoder-only transformer, or where an architecture includes a specialized prompt generator, retrieval network, or auxiliary cross-modal modules [2309.04790] [2309.07915].

## 2. Retrieval, Ordering, and Prompt Construction

The effectiveness of MM-ICL is tightly linked to the method of selection (retrieval), arrangement (ordering), and prompt design (construction) of in-context demonstrations.

### 2.1 Demonstration Retrieval

- Multi-modal encoders (e.g., CLIP-Vision, BridgeTower) yield shared embeddings $h_j = Encoder(x_j)$ for each candidate.
- Quality is measured as $Q_j = M(h_q, h_j)$, typically via cosine similarity.
- Diverse retrieval approaches include multi-stage methods such as first filtering by visual similarity and reranking by textual similarity (“MMICES” [2311.18021]), multi-modal retrievers [2410.20482], class-conditioned contrastive invariance for domain robustness (InvariantSelectPR [2405.12217]), and agentic retrieval plus structural alignment (ContextNav [2510.04560]).

### 2.2 Demonstration Ordering

- Intra-demonstration ordering (modality arrangement within each demo) proved impactful; placing the image first (“image-first” IOP) enhances performance [2410.20482].
- Inter-demonstration (sequence-level) ordering (e.g., by similarity or random) has relatively minor effect.
- Domain-mismatched demonstrations degrade performance by about 4%, affirming the need for in-domain contextualization [2410.20482].

### 2.3 Prompt Construction

- Explicit delimiters are less critical due to implicit modality switches.
- Introductory task instructions at the front of the prompt $P = I(\delta(x_{\sigma_1}), \ldots, \delta(x_{\sigma_k}))$ are most effective, outperforming summative or intra-demo instructions.

## 3. Advances in Model Architectures and MM-ICL-Specific Methods

Contemporary research explores model architectures and modules purpose-built for MM-ICL.

- End-to-end prompting without intermediate symbolic representation (removing the need for SQL) improves simplicity and error-resilience [2309.04790].
- MMICL constructs a context format with declared image tokens and interleaved multi-image data, feeding unified sequences to encoder–decoder models [2309.07915]. This alleviates language bias and supports chain-of-thought (CoT) where needed.
- Lightweight modules such as M$^2$IXT can be prepended to an LVLM, adding minimal parameters but yielding large performance boosts (e.g., 18% relative F1 gain for OFA) with up to $20\times$ parameter efficiency over baselines like Flamingo or MMICL [2310.05109].

A summary table organizes select MM-ICL approaches, their architectures, and unique strategies:

| Approach          | Architecture Highlights                  | MM-ICL Strategy                                     |
|-------------------|-----------------------------------------|-----------------------------------------------------|
| MMHQA-ICL [2309.04790]   | Modality unification + retriever + LLM | Type-specific prompt, end-to-end, no intermediate SQL|
| MMICL [2309.07915]       | Interleaved visual/text tokens, Q-former | Image declaration, unified context, multi-task ICL   |
| M$^2$IXT [2310.05109]    | Plug-in tuning, 40M–60M params extra    | Mixed tasks, lightweight, broad backbone support     |
| ContextNav [2510.04560]  | Agentic workflow + OGG                  | Automated scalable retrieval, noise-resilient curation|

## 4. Critical Analyses and Theoretical Insights

Recent studies rigorously investigate MM-ICL’s operational principles and its shortcomings.

- MM-ICL in current vision-language models is “primarily driven by text” with little influence from visual input in the demonstrations for many tasks [2311.18021] [2404.15736]. Attention analysis shows that demonstration images are only indirectly accessible via self-attention once their descriptive text is seen.
- In some tasks, such as key information extraction or those requiring fine-grained visual cues, visual similarity–driven demonstration selection is essential; for more text-driven tasks, language similarity dominates [2407.00902].
- Advanced retrieval methods (such as RICES) often confer limited practical gain over a simple k-nearest-neighbor/majority-vote baseline, especially in classification, as models tend to “recency bias” or “copy” the final demonstration’s answer [2404.15736].
- Models can be unduly influenced by textual demonstration alignment, even overriding pre-training priors (“flipped” annotation sensitivity), except in more safety-aligned LLMs (e.g., GPT-4o) [2407.00902].

Empirical and ablation results indicate that most performance gains in MM-ICL stem from sound text contextualization, prompt organization, and demonstration quality, with multi-modal fusion still an open research direction.

## 5. Applications, Robustness, and Limitations

MM-ICL has been successfully applied in diverse scenarios:

- Hybrid question answering over text, tables, and images [2309.04790], long-form video audio description [2311.17435], scene text recognition [2311.13120], and robust domain adaptation in healthcare [2405.12217].
- State-of-the-art performance is reported on MultimodalQA (F1 65.8), with robust transfer under domain shifts (e.g., 34.2% accuracy improvement in 7-shot on Camelyon17 with InvariantSelectPR).
- Memory-augmented generation and meta-training (e.g., Geo-LLaVA) enable handling of long contexts, spatial reasoning, or few-shot adaptation in previously hard problems (solid geometry QA) [2412.10455].

However, several limitations persist:

- MM-ICL is often insensitive to demonstration-level information beyond surface similarity or label copying, especially under distribution shift or format mismatch [2506.07936].
- Effectiveness is limited by deficiencies in vision encoders when faced with domain shifts; non-robust nearest neighbor selection can degrade rather than improve adaptation [2405.12217].
- As demonstration size increases, context-length restrictions become critical—work on multimodal task vectors (MTV) suggests that compressing demo information into internal model activations can enable many-shot ICL while bypassing the token limit [2406.15334].

## 6. Emerging Directions and Future Perspectives

Research at the intersection of task mapping, dynamic context configuration, and agentic orchestration points toward new MM-ICL paradigms:

- Models such as SabER integrate task-aware attention to select and autoregressively arrange ICDs, facilitating robust task mapping [2503.04839], while TACO dynamically configures demo sequences using a task guider for global mapping cohesion [2505.17098].
- ContextNav formalizes MM-ICL context management as a graph-based workflow (Operational Grammar Graph), enabling closed-loop, self-adaptive orchestration of retrieval and denoising with agentic planning [2510.04560].
- Unified transformer architectures process interleaved, quantized multimodal sequences (image, text, and even table data) using mixture-of-experts or sparse attention, reducing task interference and enabling “any-to-any” generation [2312.02520].
- Innovations such as MimIC (mimic in-context learning) approximate the in-context shift effect via per-head, query-dependent, post-attention shifts for robust, sample-efficient mapping [2504.08851].

The field is trending toward a principled formulation of MM-ICL that balances the precision of cross-modal representation, the interpretability of task mapping, scalability through context compression, and resilience via adaptive, contextually aware pipelines. Major open questions remain regarding true reasoning with multimodal context beyond mimetic or majority-vote behaviors, the optimal fusion of modalities for diverse tasks, and breaking scaling bottlenecks imposed by model pretraining and prompt window limits.

## 7. Summary Table: Factors Affecting MM-ICL Effectiveness

| Factor                    | Empirical Finding                                                | Implication                          |
|---------------------------|------------------------------------------------------------------|--------------------------------------|
| Modality of demonstrations| Text usually dominates; visuals only critical for some tasks     | Retrieval/ordering must reflect task |
| Context construction      | Image-first intra-demo order, strong introductory instruction    | Better initial visual grounding      |
| Retriever type            | Multi-modal retrievers outperform single-modality; domain-match necessary | Alignment more important than scale  |
| Prompt structure          | Delimiters less critical; instruction placement key              | Standardized prompt templates needed |
| Increasing demonstration shots | Marginal or negative gain under domain shift/distribution mismatch | Task-adaptive, compressed context needed |

These patterns, as documented in systematic empirical studies [2410.20482] [2404.15736] [2506.07936], inform best practices and future research—emphasizing the need for adaptable, task-aware, and robustly orchestrated MM-ICL strategies for large-scale, real-world multimodal reasoning systems.

Source: https://www.emergentmind.com/topics/multi-modal-in-context-learning-mm-icl