Generative Multimodal Models are In-Context Learners

Quan Sun, Yufeng Cui, Xiaosong Zhang, Fan Zhang, Qiying Yu, Yueze Wang, Yongming Rao, Jingjing Liu, Tiejun Huang, Xinlong Wang

Abstract

Researchers from BAAI and partner universities have introduced Emu2, a 37-billion parameter generative multimodal model that brings large language model (LLM)-style in-context learning to the visual domain. By scaling up a unified "predict-the-next-element" objective, Emu2 demonstrates a remarkable ability to solve new multimodal tasks—from visual prompting to subject-driven generation—using only a few examples or simple instructions. This paper details the architecture, training methodology, and emergent capabilities of Emu2, highlighting its performance as a generalist interface for multimodal understanding and generation.

Introduction: The Challenge of Multimodal In-Context Learning

While large language models like GPT-4 have mastered In-Context Learning (ICL)—the ability to learn a new task on the fly from a few examples—multimodal models have historically lagged behind. Most existing vision-language systems are "specialists" trained on specific datasets or require extensive fine-tuning for new tasks.

The authors of Emu2 argue that this lack of flexibility stems from a lack of scale and a fragmented training approach. They set out to prove that by scaling a generative multimodal model and using a unified training objective, they can unlock emergent ICL capabilities that allow a single model to act as a "generalist" interface for both understanding and generating interleaved text, images, and video.

Emu2 Architecture: A Unified Generative Framework

Emu2 is built on a massive 37-billion parameter architecture designed for multimodal sequence modeling. Its core components include:

  • Visual Encoder: Based on EVA-02-CLIP, it tokenizes images into continuous embeddings.
  • Multimodal Modeling: A LLaMA-33B backbone serves as the "brain," trained with a unified autoregressive objective: predict the next element (whether it's a text token or a visual embedding).
  • Visual Decoder: Based on SDXL, this component "detokenizes" the model's output embeddings back into high-quality images or videos.

Unlike its predecessor (Emu), Emu2 simplifies the vision-language interface by using mean pooling and a linear projection instead of more complex "C-Formers." The model was trained in two main stages: large-scale generative pretraining followed by instruction tuning to create two specialized variants: Emu2-Chat (for dialogue and understanding) and Emu2-Gen (for controllable image/video generation).

Training Methodology and Datasets

The authors utilized a diverse array of massive datasets to ensure broad generalization:

  • Pretraining: LAION-2B and CapsFusion-120M (image-text), WebVid-10M (video-text), and interleaved data from Multimodal-C4 and YT-Storyboard-1B.
  • Grounded Data: GRIT-20M and CapsFusion-grounded-100M were used to teach the model spatial awareness (bounding boxes).
  • Text-only: Data from the Pile was included to maintain the model's pure linguistic reasoning.
  • Evaluation: The model was tested on standard benchmarks like VQAv2, OKVQA, and RefCOCO, as well as comprehensive LMM (Large Multimodal Model) benchmarks like SEED-Bench, MM-Vet, and MMMU.

Emergent Capabilities and Key Insights

The most significant finding is that ICL capabilities—like following visual prompts (e.g., "look at the object in the red circle")—emerge clearly at the 37B scale but are often absent or weak in smaller models.

Emu2 demonstrates diverse capabilities including in-context completion, multimodal reasoning, and subject-driven generation.

By treating visual embeddings as just another type of "token" in a sequence, the model learns a shared representation space where vision and language are truly interleaved. The authors show that a generative objective (predicting pixels/embeddings) provides a stronger foundation for general-purpose models than discriminative objectives (like simple classification) used in many previous systems.

Furthermore, Emu2-Gen can perform "re-contextualization"—taking a specific subject from one image and placing it in a new, text-described scene—without the test-time fine-tuning required by models like DreamBooth.

Performance Evaluation

  • Few-Shot Superiority: Emu2 (37B) outperformed much larger models like Flamingo-80B and IDEFICS-80B on several few-shot visual question-answering tasks.
  • State-of-the-Art Chat: Emu2-Chat set new records on the MM-Vet and TouchStone benchmarks, demonstrating superior open-ended multimodal reasoning.
  • Grounding Excellence: On the RefCOCO benchmarks, Emu2-Chat achieved the best results among generalist models, showing a high degree of spatial precision.
  • High-Fidelity Generation: Emu2-Gen achieved a state-of-the-art CLIP-I score of 0.850 on DreamBench for zero-shot subject-driven generation, significantly outperforming previous methods in maintaining subject identity.

Conclusion and Future Directions

Despite its power, Emu2 faces challenges such as "hallucination" and struggles with highly complex tasks like accurately counting objects in dense crowds. While Emu2 is a leader among open-source models, there remains a performance gap compared to closed-source giants like GPT-4V. Future work will focus on improving data quality, reducing hallucinations, and further scaling the model to close the gap with proprietary systems.

Summary updated

BibTeX
@inproceedings{sun2023generative,
  author = {Quan Sun and Yufeng Cui and Xiaosong Zhang and Fan Zhang and Qiying Yu and Yueze Wang and Yongming Rao and Jingjing Liu and Tiejun Huang and Xinlong Wang},
  title = {{Generative Multimodal Models are In-Context Learners}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2023},
}
Figure