Visual In-Context Learning for Large Vision-Language Models

Yucheng Zhou, Xiang Li, Qianning Wang, Jianbing Shen

Abstract

Large Vision-Language Models (LVLMs) often struggle with multi-modal In-Context Learning (ICL) due to the cross-modal gap and inefficient token usage. This paper introduces Visual In-Context Learning (VICL), a framework that transforms visual demonstrations into intent-oriented text summaries. By aligning visual information with the model's primary linguistic processing path, VICL significantly enhances reasoning performance and enables efficient scaling of demonstrations.

Introduction: The Multi-modal ICL Challenge

While Large Language Models (LLMs) excel at learning from a few examples, their multi-modal counterparts face significant hurdles. The authors identify three primary issues:

  1. The Cross-Modal Gap: Visual and text embeddings reside in separate vector spaces, hindering seamless integration.
  2. Deep Interaction Latency: Multi-modal interactions typically occur only in the model's deeper layers, making it hard for visual cues to guide early reasoning.
  3. Token Bloat: High-resolution images consume excessive context window space, limiting the number of possible demonstrations.
Motivation: The cross-modal gap and late-layer interaction in LVLMs.

Methodology: The VICL Framework

The VICL framework bypasses raw image processing in the final prompt through a three-stage pipeline:

  1. Visual Demonstration Retrieval (VDR): A "Retrieval & Rerank" strategy uses a Vision Transformer (ViT) for initial similarity search and CLIP for semantic reranking against the query image.
  2. Intent-Oriented Image Summarization (IOIS): An LVLM generates a text summary of each retrieved image, specifically focused on task-relevant features (e.g., emotional cues for emotion recognition).
  3. Intent-Oriented Demonstration Composition (IODC): These text summaries are paired with labels to form a purely linguistic demonstration, reducing token count and aligning with the model's core strengths.
The VICL Pipeline: From retrieval to intent-oriented demonstration composition.

Key Insights and Analysis

VICL's success is rooted in its ability to leverage the linguistic maturity of LVLMs. Information flow analysis reveals that text-based summaries act as "anchors" in the early layers, allowing the model to aggregate information for label words much earlier than raw visual inputs. Furthermore, performance continues to scale as more text-based demonstrations are added, avoiding the plateau seen in standard ICL. The study also noted a "Head Advantage," where the first example in the prompt exerts the strongest influence on the final prediction.

Results and Performance

Evaluation across five datasets (including EmoSet and CIFAR10) showed that VICL consistently outperforms zero-shot and standard ICL approaches across multiple models, including LLaVA-7B/13B, MiniGPT-4, and Qwen-VL. For instance, on EmoSet with LLaVA-13B, VICL achieved an accuracy of 0.72, more than doubling the 0.32 accuracy of standard methods. The framework also demonstrated strong "In-Context Unlearning" capabilities, reaching an accuracy of 0.77 on the unlearning set compared to 0.57 for standard ICL.

Conclusion

VICL represents a paradigm shift in multi-modal reasoning by converting visual examples into task-specific text summaries. This approach effectively bridges the cross-modal gap and optimizes token usage, paving the way for more robust and scalable visual in-context learning.

Summary updated

BibTeX
@inproceedings{zhou2024visual,
  author = {Yucheng Zhou and Xiang Li and Qianning Wang and Jianbing Shen},
  title = {{Visual In-Context Learning for Large Vision-Language Models}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2024},
  doi = {10.18653/v1/2024.findings-acl.940},
}
Figure