Table of Contents
Fetching ...

Multimodal Contrastive In-Context Learning

Yosuke Miyanishi, Minh Le Nguyen

TL;DR

This work tackles the interpretability of gradient-free in-context learning (ICL) in multimodal large language models by proposing Multimodal Contrastive In-Context Learning (MCICL). It combines a contrastive-learning interpretation of ICL via key–value distances, a bias-aware analytical framework for multimodal input formatting, and an on-the-fly Anchored-by-Text ICL method to enable effective, resource-conscious ICL in challenging tasks such as hateful memes detection. The authors validate their framework with extensive experiments across multiple VQA datasets, showing that semantic alignment via contrastive signals and careful handling of input formatting significantly improves ICL performance, while AbT ICL yields notable gains in resource-constrained settings. Collectively, MCICL provides theoretical and empirical insights into ICL mechanisms and offers practical strategies for designing more interpretable, efficient, and robust multimodal AI systems.

Abstract

The rapid growth of Large Language Models (LLMs) usage has highlighted the importance of gradient-free in-context learning (ICL). However, interpreting their inner workings remains challenging. This paper introduces a novel multimodal contrastive in-context learning framework to enhance our understanding of ICL in LLMs. First, we present a contrastive learning-based interpretation of ICL in real-world settings, marking the distance of the key-value representation as the differentiator in ICL. Second, we develop an analytical framework to address biases in multimodal input formatting for real-world datasets. We demonstrate the effectiveness of ICL examples where baseline performance is poor, even when they are represented in unseen formats. Lastly, we propose an on-the-fly approach for ICL (Anchored-by-Text ICL) that demonstrates effectiveness in detecting hateful memes, a task where typical ICL struggles due to resource limitations. Extensive experiments on multimodal datasets reveal that our approach significantly improves ICL performance across various scenarios, such as challenging tasks and resource-constrained environments. Moreover, it provides valuable insights into the mechanisms of in-context learning in LLMs. Our findings have important implications for developing more interpretable, efficient, and robust multimodal AI systems, especially in challenging tasks and resource-constrained environments.

Multimodal Contrastive In-Context Learning

TL;DR

This work tackles the interpretability of gradient-free in-context learning (ICL) in multimodal large language models by proposing Multimodal Contrastive In-Context Learning (MCICL). It combines a contrastive-learning interpretation of ICL via key–value distances, a bias-aware analytical framework for multimodal input formatting, and an on-the-fly Anchored-by-Text ICL method to enable effective, resource-conscious ICL in challenging tasks such as hateful memes detection. The authors validate their framework with extensive experiments across multiple VQA datasets, showing that semantic alignment via contrastive signals and careful handling of input formatting significantly improves ICL performance, while AbT ICL yields notable gains in resource-constrained settings. Collectively, MCICL provides theoretical and empirical insights into ICL mechanisms and offers practical strategies for designing more interpretable, efficient, and robust multimodal AI systems.

Abstract

The rapid growth of Large Language Models (LLMs) usage has highlighted the importance of gradient-free in-context learning (ICL). However, interpreting their inner workings remains challenging. This paper introduces a novel multimodal contrastive in-context learning framework to enhance our understanding of ICL in LLMs. First, we present a contrastive learning-based interpretation of ICL in real-world settings, marking the distance of the key-value representation as the differentiator in ICL. Second, we develop an analytical framework to address biases in multimodal input formatting for real-world datasets. We demonstrate the effectiveness of ICL examples where baseline performance is poor, even when they are represented in unseen formats. Lastly, we propose an on-the-fly approach for ICL (Anchored-by-Text ICL) that demonstrates effectiveness in detecting hateful memes, a task where typical ICL struggles due to resource limitations. Extensive experiments on multimodal datasets reveal that our approach significantly improves ICL performance across various scenarios, such as challenging tasks and resource-constrained environments. Moreover, it provides valuable insights into the mechanisms of in-context learning in LLMs. Our findings have important implications for developing more interpretable, efficient, and robust multimodal AI systems, especially in challenging tasks and resource-constrained environments.
Paper Structure (46 sections, 22 equations, 8 figures, 4 tables)

This paper contains 46 sections, 22 equations, 8 figures, 4 tables.

Figures (8)

  • Figure 1: Summary of the proposed method. Boxes represent data, while circles symbolize procedures and models. Images are taken from Hateful Memes kielaHatefulMemesChallenge2020 and MMBench liuMMBenchYourMultimodal2023 datasets.
  • Figure 2: The representative Anchor-by-Text ICL prompt. The system prompt is truncated for illustrative purpose.
  • Figure 3: Performance summary of LLaVA-Llama2. zsl and icl represent the corresponding learning type in the Methodology section.
  • Figure 4: Representational shift across the learning type. Suffixes 0 and 1 represents the weights for benign and hateful
  • Figure 5: Comparison of model responses to two-image inputs. Images obtained from official LLaVA repository. The LLaVA response is truncated for brevity (see our repository for the full output). The main difference is in the description (B) of the second image. LLaVA-LLama2 explained that the red toy stands beside a lake, confusing the two images. LLaVA 1.5, on the other hand, gave a description that only mentioned the content in the second image, suggesting that it could disentangle the two images.
  • ...and 3 more figures