MetaVL: Transferring In-Context Learning Ability From Language Models to Vision-Language Models

Masoud Monajatipoor, Liunian Harold Li, Mozhdeh Rouhsedaghat, Lin Yang, Kai-Wei Chang

Introduction

In-context learning (ICL) has emerged as a hallmark of Large Language Models (LLMs), enabling them to adapt to new tasks through a few demonstrations provided in the prompt. However, extending this capability to Vision-Language (VL) models has traditionally been viewed as a byproduct of extreme scale. State-of-the-art models like Flamingo require billions of parameters and vast datasets to exhibit robust ICL.

MetaVL challenges this paradigm by investigating whether ICL is strictly an emergent property of scale or if it can be explicitly taught in the language domain and subsequently transferred to the vision-language domain. By meta-training a relatively small language model (375M parameters) on diverse text tasks, the researchers demonstrate that ICL ability is a transferable skill that can significantly enhance VL performance without the need for massive computational resources.

Methodology

The MetaVL framework employs a three-stage training pipeline designed to preserve and transfer meta-learned reasoning skills.

  1. Language Meta-Training: The process begins with a GPT-2 Medium model (375M parameters). Unlike standard pre-training, this model undergoes meta-training using the MetaICL approach across 142 distinct NLP tasks. The objective is specifically tailored for ICL: given $k$ examples of a task, the model must predict the label for the $(k+1)$-th instance.
  2. Visual Grounding: To incorporate visual information, a visual encoder (CLIP-RN50x16) is paired with a simple Multi-Layer Perceptron (MLP) "visual prefix." This module projects visual features into the language model's embedding space.
  3. Frozen Transfer: During the final alignment phase on the COCO dataset, the meta-trained language model remains frozen. Only the visual encoder and MLP prefix are trained. This architectural choice ensures that the "learning to learn" capabilities acquired during meta-training are not overwritten by the new visual modality.
The MetaVL architecture: Stage 1 involves language meta-training, followed by visual grounding and frozen transfer to create the final vision-language model.

Key Insights

A central finding of this work is that ICL is a modality-agnostic skill. A model trained to utilize demonstrations in text can immediately apply that logic to multimodal contexts once visual features are aligned.

Furthermore, the researchers identified that maintaining frozen weights in the language model is critical. Experiments with "adapter layers"—trainable parameters inserted into the LM—actually led to a decrease in ICL performance. This suggests that the specific internal representations developed during meta-training are fragile and easily disrupted if the LM is allowed to drift during visual alignment.

Results and Evaluation

MetaVL was evaluated against the "Frozen" baseline (a 7B-parameter model) across several complex visual reasoning benchmarks, including VQA, OK-VQA, and GQA.

  • Efficiency and Scale: Despite being 1/20th the size of the baseline, MetaVL achieved a score of 31.96 on the GQA dataset, compared to 25.76 for the 7B-parameter model.
  • Semantic Accuracy: Human evaluations on OK-VQA revealed a dramatic improvement. MetaVL scored 19.22, nearly triple the baseline's 6.41. This indicates that MetaVL's outputs were often semantically correct and contextually relevant, even when they did not match the exact ground-truth string.
  • Few-Shot Scaling: The model demonstrated a clear upward trend in accuracy as the number of in-context shots increased from zero to three, confirming its ability to effectively leverage provided examples to refine its predictions.
Qualitative examples of MetaVL performing in-context learning across various visual question-answering tasks.

Conclusion

MetaVL demonstrates that explicit meta-training for in-context learning is a powerful alternative to massive scaling. By treating ICL as a transferable skill rather than an emergent property, the authors enable high-performance visual reasoning in compact models. Future work will explore the limits of this approach by scaling the base language model and investigating its applicability to more diverse generative multimodal tasks.

Summary updated

BibTeX
@inproceedings{monajatipoor2023metavl,
  author = {Masoud Monajatipoor and Liunian Harold Li and Mozhdeh Rouhsedaghat and Lin Yang and Kai-Wei Chang},
  title = {{MetaVL: Transferring In-Context Learning Ability From Language Models to Vision-Language Models}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2023},
  doi = {10.18653/v1/2023.acl-short.43},
}
Figure