arXiv:2608.28696cs.CVAug 2026

Manuscript Offprint

arXiv:2608.28696

Instruction Distillation: Text Instructions as Visual Examples

Hardik Jindal, Soumyabrata Pal, Sayak Ray Chowdhury

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Visual in-context learning (ICL) with multimodal large language models (MLLMs) is effective for fine-grained visual classification, but each retrieved image example consumes several hundred context tokens, making large-KK settings prohibitively expensive at inference scale. We propose instruction distillation: an offline procedure in which the MLLM itself generates, for each individual training image, a structured identification instruction encoding general appearance cues, features that differentiate the class from visually similar ones, and a common confusion point. Unlike prior work that produces a single description per class, our instructions are generated per training image, preserving the intra-class visual diversity that per-class descriptions collapse. At inference time, we study five configurations sharing a single CLIP retrieval index: zero-shot, image ICL, instruction-only ICL, and two hybrid variants in which retrieved neighbors are split between images and instructions. Across seven fine-grained benchmarks and two MLLM backbones, instruction based pipelines match, or exceeds image ICL at K=1K=1 and reduces per-query tokens by 2.9×2.9\times and inference latency by 3.3×3.3\times at K=5K=5. Hybrid configurations further show that visual and textual ICL signals are complementary, images give visual patterns to learn and see, while instructions give explicit rules and logic. When both of these are provided, the quality of context improves, which is noticeable in the performance.

1 Introduction

Multimodal large language models (MLLMs) can perform visual classification in a few-shot setting: given a handful of image-label pairs as in-context examples, they classify novel images substantially more accurately than under zero-shot prompting (Alayrac et al., 2022; Zong et al., 2024). This visual in-context learning (ICL) paradigm is particularly effective for fine-grained recognition,

Figure

Figure 1: Instruction Distillation. Images are replaced by text-based instructions and passed as context during inference. It results in an improved accuracy score with reduced token consumption.

where categories exhibit high inter-class visual similarity, and the model must attend to subtle discriminative cues, such as surface texture, structural configuration, or preparation style.

The standard recipe is retrieval-augmented: for each test image, the KK most similar training images are retrieved via CLIP (Radford et al., 2021) and placed in the model's context. This works (Jiang et al., 2024; Liu et al., 2022), but carries a hidden cost that becomes prohibitive at scale. Each image consumes roughly 550 tokens in the form of visual patch embeddings, so 5 in-context images cost ≈3,400\approx 3,400 tokens per query, nearly six times the cost of zero-shot inference. At deployment, this token overhead translates directly into latency and compute costs, and places a hard ceiling on how many examples a practitioner can afford to include.

A natural alternative is to replace the images with text. Several recent lines of work have shown that class-level textual descriptions, attribute lists, GPT-generated category descriptions, or concept bottlenecks can substitute for or augment visual features in zero-shot classification with CLIP-style models (Menon and Vondrick, 2023; Pratt et al., 2023; Yang et al., 2023). We ask a different question, in a different regime: inside an MLLM, can per-example text, distilled offline from each individual training image, serve as the in-context signal in place of the image itself?

The answer is not obvious in either direction. On one hand, text is cheap (≈ 95 tokens per identification rule vs. ≈ 550 per image), and an MLLM that articulates its own visual reasoning may produce a context signal better aligned with how the model attends to images at inference. On the other hand, fine-grained discrimination: distinguishing an Abyssinian cat from a Bengal cat, or a 707-320 aircraft from an A320, is the regime where one expects visual grounding to be irreplaceable.

Contributions. We propose instruction distillation:¹ an offline procedure in which the MLLM itself is prompted, for each training image, to produce a structured identification rule capturing (i) general appearance cues for the depicted class, (ii) features that differentiate it from visually similar classes, and (iii) a common confusion point with a concrete visual test. At inference time, the top-KK training images are retrieved via CLIP similarity exactly as in image ICL, but their distilled instructions are placed in the model's context instead of images (Figure 1). These instructions are pregenerated; nothing is generated at inference time, which might add to latency. The key design choice is that instructions are generated per image, not per class: a single class can exhibit substantial intra-class visual variation, and grounding each instruction in a specific training instance preserves this diversity through retrieval, which class-level descriptions (e.g., Menon and Vondrick (2023)) cannot.

We evaluate two MLLM backbones across seven fine-grained benchmarks under five inference configurations: zero-shot; image ICL; instruction ICL; and two hybrid variants with opposite modality orderings, holding the CLIP retrieval index fixed so any accuracy difference is attributable to modality rather than retrieval. The hybrid pipelines are motivated by two observations about retrieval. In the first, retrieval quality degrades down the ranked list: top neighbors are visually informative and best supplied as images, while lower-ranked ones introduce noise (irrelevant textures, viewpoint variation, near-miss classes) and are better distilled into text. The second inverts this on the grounds that in fine-grained settings, the top-ranked neighbors often look nearly identical to the query yet belong to a different class, so showing their images first can prime the model with a misleading visual pattern. We instead present the top neighbors as instructions, forcing the model to reason about discriminative features before seeing any pixels. We find that:

  • Instruction ICL matches image ICL at K=1K=1 across all seven benchmarks and exceeds it on five of them, with a striking +57.9% gain on EuroSAT (Helber et al., 2019), consistent with the hypothesis that, in the low-KK regime, a single retrieved image often presents an unrepresentative view of its class, whereas a distilled text rule encodes the general discriminative structure.

  • Instruction ICL reduces per-query input tokens by 2.9×2.9\times at K=5K=5 and scales profitably to K=25K=25 within the budget that image ICL exhausts at K=5K=5, as seen in Table 1

  • Instruction ICL also cuts wall-clock inference latency, and its one-time generation cost is recovered at scale: at K=5K=5, mean per-query latency drops 3.27×3.27\times (0.549s to 0.168s) and throughput improves 9.49×9.49\times, exceeding the 2.9×2.9\times token-count ratio because image tokens are more expensive to process per token than text tokens (Appendix H).

  • Visual and textual ICL signals are complementary under a fixed token budget: hybrid configurations consistently outperform either modality alone on benchmarks where both are individually useful, as seen in Figure 3 (per-dataset bar-chart view in Appendix D, Figure 5). This shows that it is a compositional effect. Images give visual patterns to learn and see, while instructions give explicit rules and logic. When both of these are provided, the quality of context improves.

Together, these results reframe the role of in-context examples in MLLM visual classification: the question is not whether to use images or text, but what information the model needs from an example, and for many tasks, that information can be supplied at a fraction of the cost by letting the model articulate its own visual rules in advance.