arXiv:2610.30913cs.CVOct 2026

Manuscript Offprint

arXiv:2610.30913

Watch and Learn: Teaching Visual In-Context Learning by Removing Textual Shortcuts

Nimrod Shabtay, Asaf Yehudai, Avihu Dekel, Eli Schwartz, Raja Giryes

Abstract

Vision-language models (VLMs) struggle with in-context learning compared to their textual counterparts. Our preliminary study shows that VLMs rely on textual shortcuts and underutilize the visual demonstrations. We therefore hypothesize that VLMs are insufficiently trained to perform visual in-context learning (vICL). To this end, we construct MIME, a task-agnostic vICL training set without textual shortcuts. We ensure the instruction does not state the rule linking the demonstration images to their answers, so the model must infer it from the visual demonstrations. Fine-tuning on MIME improves vICL accuracy by 8.1–18.0 points across three VLMs, preserves single-image performance, and improves multi-image and text-only in-context learning. In contrast, stating the rule in the training data sharply reduces this gain. We further propose DTAD (Demonstration Text Attention Dropout), which randomly withholds demonstration labels during training so that the VLM must infer the rule from the demonstration images. While achieving comparable vICL accuracy to fine-tuning on MIME, DTAD yields more consistent attention to the demonstration images. On TrueMICL, Qwen3-VL-8B trained on MIME matches frontier models such as Claude Opus 5, and surpasses them with DTAD. Finally, adding MIME to the instruction-tuning mix of LLaVA-1.5-13B more than doubles its vICL accuracy without hurting single-image abilities, whereas a same-size multi-image set improves it only slightly. These results suggest that vICL data should be a standard component of VLM training.

1 Introduction

In-context learning is a defining emergent capability of large language models (LLMs): given a handful of demonstrations, an LLM infers the latent task and applies it to a new query without any parameter update (Brown et al., 2020; Todd et al., 2024; Olsson et al., 2022). Vision-language models (VLMs) are built on LLMs and are routinely prompted with few-shot demonstrations, yet they struggle with visual in-context learning (vICL), where the task must be inferred from the demonstration images rather than from the accompanying text (Baldassini et al., 2024; Chen et al., 2025b; Santos et al., 2025; Wang and Li, 2026; Jia et al., 2025). One plausible cause is the pretraining data. In text, the demonstration-query-answer structure occurs naturally at pretraining scale (Han et al., 2023; Hahn and Goyal, 2023; Chen et al., 2024), whereas its multimodal analogue is likely absent (Doveh et al., 2024).

Prior work on improving vICL follows three approaches. The first is motivated by the finding that VLMs attend to the demonstration text rather than the demonstration images (Chen et al., 2025c; Jia et al., 2025), and rebalances attention toward the images. Chen et al. (2025c) train an attention-reweighting layer (DARA), while Wang and Li (2026) reweight attention at inference time (MGI). The second extracts task-specific steering or task vectors from many-shot activations (Huang et al., 2024; Li et al., 2025). The third fits demonstration-retrieval policies per task (Zhang et al., 2023; Doveh et al., 2024, 2025). All three are tailored to a specific task or model, and none of them yields a general vICL ability.

We start by asking why VLMs struggle with vICL ( §2§2). On two TrueMICL tasks, Qwen3-VL-8B reaches near-perfect accuracy (99.8%) when the demonstrations are given as text, or when it first transcribes the images itself. Hence, neither perception nor core in-context learning is the bottleneck. Instead, the model relies on textual shortcuts. Its accuracy falls from 78.3% to 44.8% when the task-specific instruction is replaced with a generic one that gives no hint about the task. The model thus underutilizes the visual demonstrations, even when the task can only be learned from them. We therefore hypothesize that VLMs are insufficiently trained to perform vICL, and that training on dedicated vICL data without textual shortcuts will teach them to attend to and learn from the demonstration images.

Accordingly, we curate MIME (Multi-source In-

Figure

Figure 1: We fine-tune on MIME, synthetic in-context instances whose task is a hidden rule that must be inferred from the demonstrations. Despite being synthetic, MIME improves results on unseen real-world benchmarks. DTAD, which masks demonstration answers, produces more stable attention patterns that focus on the demonstration images.

duction from Mute Episodes), a diverse, task-agnostic vICL training set ( §3.1§3.1). It spans five sources with different rule types and visual domains, so the model cannot solve it by learning a single task. We construct each instance so that no text states the rule linking the demonstration images to their answers, and the model can infer it only from the demonstrations. To further shift attention from the demonstration text to the demonstration images, we propose DTAD (Demonstration Text Attention Dropout, §3.2§3.2). During fine-tuning, DTAD randomly withholds each demonstration's label. A demonstration without its label can inform the query only through its image, so the model must learn to read the demonstration images.

In our experiments, fine-tuning on MIME improves average vICL accuracy by 8.1–18.0 points across 11 tasks and three VLMs, whereas DARA and MGI leave the base model unchanged ( §4.2§4.2). Training on MIME also preserves single-image performance and improves multi-image and text-only in-context learning ( §4.5§4.5). This suggests that the model learns a general way of reading demonstrations rather than an image-specific patch. DTAD matches the accuracy of fine-tuning on MIME while attending to the demonstration images more strongly and more consistently across tasks and shot counts ( §5.4§5.4). It is also more robust to changes in the prompt format ( §A.2.2§A.2.2). On TrueMICL, Qwen3-VL-8B trained on MIME matches frontier models such as Claude Opus 5, and surpasses them with DTAD.

Our analysis attributes these gains to the design of MIME ( §5§5). Models trained on MIME depend on their demonstrations. Shuffling either the images or the labels hurts them more than the base model, showing that they learn the rule from the image-label pairs ( §5.1§5.1). Hiding the rule is necessary. Training on the same instances with the rule stated sharply reduces the gain, and the model then attends to the demonstration images less than the base model in the mid-to-late layers ( §5.2§5.2).

MIME also belongs in instruction tuning, not only in post-hoc fine-tuning. We retrain LLaVA-1.5-13B (Liu et al., 2023) on its original instruction-tuning mix, adding either MIME or a same-size set of multi-image conversations ( §4.3§4.3). MIME more than doubles TrueMICL accuracy (18.9 to 39.7) with no single-image regression, whereas the multi-image data barely helps (21.5) and lowers POPE by 30 points. These results suggest that vICL data should be a standard component of VLM training.

References (22)