Towards Multimodal In-Context Learning for Vision & Language Models

Sivan Doveh, Shaked Perek, Muhammad Jehanzeb Mirza, Amit Alfassy, Assaf Arbelle, Shimon Ullman, Leonid KarlinskyarXiv 2024 · DOI

TL;DR

This paper tackles the challenge of improving In-Context Learning (ICL) in Vision-Language Models (VLMs). The authors propose a novel multi-turn curriculum-based training strategy that significantly boosts VLMs' ability to learn from few-shot examples, achieving up to a 21.03% performance increase. They also introduce new benchmarks to better evaluate this crucial capability.

What Problem Does This Paper Address?

Large Language Models (LLMs) have demonstrated remarkable abilities, including In-Context Learning (ICL), where they can perform new tasks by simply being shown a few examples within the prompt. Vision-Language Models (VLMs), which combine visual and textual understanding, have achieved impressive zero-shot performance on various tasks. However, this paper highlights a significant gap: current state-of-the-art VLMs often struggle with ICL, meaning they don't effectively leverage few-shot demonstrations when presented with interleaved image and text data. This limitation hinders their ability to adapt to new, nuanced tasks without extensive retraining. The authors aim to bridge this gap by enhancing the ICL capabilities of existing VLMs.

Methods

The core of the proposed solution is a "multi-turn curriculum-based learning methodology" applied during the visual instruction tuning phase. This approach builds upon existing VLM architectures (encoder-projector-decoder) and leverages a multi-turn conversation format. Key aspects include:

  • Semantically Coherent ICL Tasks: The training data is carefully curated to ensure that all "shots" (examples) within a single ICL instruction share a common semantic concept. This contrasts with some prior methods that used mixed, less coherent data.
  • Multi-Turn Conversation Format: The training data is structured as conversations, allowing the model to learn from previous turns (shots) to predict the current turn's response. This naturally supports an "any-shot" learning paradigm, where the model can handle varying numbers of examples at inference time.
  • Curriculum-Based Learning: The training progresses through stages, potentially starting with simpler tasks or pre-training, and then moving to more complex multi-turn conversations with diverse data mixes.
  • Data Mixing Strategies: The authors investigate and emphasize the importance of effective data mixing strategies to maximize ICL performance and generalization.

Datasets

The paper utilizes several datasets for training and evaluation:

  • Training Data:
    • SEED benchmark [31]: Partitions 1-5 are used to create ICL instructions, with tasks 1-4 for training and a portion of task 5 for evaluation. Tasks 6-8 are used for testing generalization to unseen ICL tasks.
  • VL-Checklist [64]: Tasks 0-12 are used to create training ICL instructions, with data split into non-overlapping training and testing sets.
  • LLaVA visual instruction tuning dataset [38]: Used for general visual instruction replay to preserve base model capabilities.
  • Evaluation Benchmarks:
    • Fine-grained few-shot visual recognition datasets: Stanford Dogs [23], CUBS [57], FOOD-101 [5], Stanford Cars [24], Flowers [46]. These are used for evaluating generalization to unseen tasks.
  • SEED-Bench-2 [30]: Specific tasks (e.g., Instance Counting, relation, interaction, reasoning) are used for evaluation.
  • VL-Checklist [64]: Used for evaluating ICL capabilities across various task types (QA, multiple-choice, captioning).
  • New Benchmarks: The authors contribute new benchmarks for ICL evaluation in VLMs, specifically focusing on "open vocabulary few-shot visual recognition" and semantically coherent ICL tasks.

Key Insights and Ideas

  • ICL is a Weakness in Current VLMs: Despite impressive zero-shot performance, state-of-the-art VLMs significantly underperform when presented with few-shot demonstrations, especially when the demonstrations are semantically coherent.
  • Semantic Coherence is Crucial: Simply mixing diverse data sources isn't enough. Ensuring a shared semantic concept across ICL examples is key to effective learning and generalization.
  • Multi-Turn Conversations are Powerful: Structuring training as multi-turn conversations naturally leads to "any-shot" learning capabilities, allowing models to adapt to varying numbers of examples at inference.
  • Curriculum Learning Matters: A well-designed curriculum, including effective data mixes and potentially replaying base model data, is essential for maximizing ICL performance without sacrificing core capabilities.
  • New Benchmarks are Needed: Existing benchmarks often don't adequately test the semantic coherence aspect of ICL in VLMs, necessitating new evaluation sets.

Key Results

The proposed method achieved significant improvements:

  • Performance Boost: A substantial 21.03% (and 11.3% on average) ICL performance boost over the strongest VLM baselines.
  • Leading Baseline Performance: The proposed model outperformed the leading baseline, Llava-1.6 13B, by 8.29% on average across fine-grained few-shot tasks.
  • Generalization: The model demonstrated strong generalization to unseen ICL tasks and datasets.
  • Preservation of Base Capabilities: The ICL tuning process, especially with the replay of base model data, successfully preserved the model's core capabilities, as measured by the MME benchmark.
  • Shot Sensitivity: The model's performance positively improved with an increasing number of shots, confirming its ability to leverage in-context information.

Limitations and Future Work

  • Computational Cost: While the proposed method is described as "simple," achieving optimal results likely requires significant computational resources for training and data curation.
  • Context Length: The current implementation is limited by the LLM's context length (2K tokens), which restricts the number of shots and sequence length.
  • Future Work:
    • Exploring ICL instruction tuning with longer LLM contexts to enable longer any-shot sequences.
  • Further investigation into optimal ICL instruction data mixes and additional ICL task types.
  • Developing more sophisticated shared ICL semantics.
  • Re-using the proposed ideas for other multimodal models.

Summary updated

BibTeX
@misc{doveh2024towards,
  author = {Sivan Doveh and Shaked Perek and Muhammad Jehanzeb Mirza and Amit Alfassy and Assaf Arbelle and Shimon Ullman and Leonid Karlinsky},
  title = {{Towards Multimodal In-Context Learning for Vision \& Language Models}},
  year = {2024},
  eprint = {2403.12736},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2403.12736},
}
Figure