Macaw-LLM: Multi-Modal Language Modeling with Image, Audio, Video, and Text Integration

Chenyang Lyu, Minghao Wu, Longyue Wang, Xinting Huang, Bingshuai Liu, Zefeng Du, Shuming Shi, Zhaopeng TuarXiv 2023

Abstract

Although instruction-tuned large language models (LLMs) have exhibited remarkable capabilities across various NLP tasks, their effectiveness on other data modalities beyond text has not been fully studied. In this work, we propose Macaw-LLM, a novel multi-modal LLM that seamlessly integrates visual, audio, and textual information. Macaw-LLM consists of three main components: a modality module for encoding multi-modal data, a cognitive module for harnessing pretrained LLMs, and an alignment module for harmonizing diverse representations. Our novel alignment module seamlessly bridges multi-modal features to textual features, simplifying the adaptation process from the modality modules to the cognitive module. In addition, we construct a large-scale multi-modal instruction dataset in terms of multi-turn dialogue, including 69K image instances and 50K video instances. We have made our data, code and model publicly available, which we hope can pave the way for future research in multi-modal LLMs and expand the capabilities of LLMs to handle diverse data modalities and address complex real-world scenarios.

Introduction

While text-based large language models (LLMs) have reached incredible heights, the real world is inherently multi-modal. Most existing attempts to bridge the gap between vision/audio and text rely on a "two-stage" training process: first, they train a projection layer to align features, and then they perform instruction fine-tuning. This can be computationally expensive and prone to error propagation between stages.

Macaw-LLM seeks to solve both the architectural complexity and the data scarcity problem by introducing a novel multi-modal LLM that integrates four distinct modalities—image, audio, video, and text—into a single, unified framework.

The Macaw-LLM mascot illustrates the model's ability to process diverse modalities including audio, text, and visual data.

System Architecture

The architecture of Macaw-LLM consists of three core modules designed to function as a cohesive unit:

  1. Modality Module: This acts as the "sensory organs" of the system. It uses pre-trained experts to encode data: CLIP (ViT-B/16) for images and video frames, and Whisper-Base for audio signals.
  2. Alignment Module: This is the paper's primary innovation. Instead of a simple linear projection, it uses Multi-Head Self-Attention (MHSA) to align the encoded features with the LLM’s own embedding matrix. By treating the LLM's embeddings as the "anchor," the model learns to represent visual and auditory data as "soft tokens" that the language model can naturally process.
  3. Cognitive Module: The "brain" of the system is LLaMA-7B, which processes the integrated sequence of multi-modal and textual tokens to generate a response.

Unlike previous models, Macaw-LLM uses one-step instruction fine-tuning. All parameters are tuned simultaneously to minimize negative log-likelihood, promoting a more coherent alignment across all modalities at once.

Multi-Modal Instruction Dataset

The authors curated a massive multi-modal instruction dataset to train the model, utilizing the generative power of GPT-3.5-Turbo to turn simple captions into complex Q&A pairs. This dataset includes:

  • Text: ~52K instances from the Alpaca dataset.
  • Image: ~69K instances generated from MS COCO captions.
  • Video: ~50K instances generated from Charades and AVSD video captions.
  • Audio: Currently integrated via the video data (the model analyzes the audio track of the video files).

The final training set used for the study was a balanced mix of 150,000 examples.

Key Insights and Results

The most striking idea in Macaw-LLM is using the LLM’s existing embedding layer as the universal language for alignment. By forcing images and sounds to "speak" the language of the LLM's internal embeddings, the model can leverage its pre-trained linguistic knowledge more effectively.

Macaw-LLM's visual reasoning allows it to interpret artistic and complex visual information.

Qualitative evidence showcases the model's sophisticated capabilities:

  • Visual Reasoning: The model can identify specific objects (e.g., "two giraffes") and infer context, such as determining that a photo was likely taken during the daytime based on lighting.
  • Nuanced Understanding: In one example, the model correctly identifies "snow" outside a door even when only a tiny portion of the white ground is visible.
  • Video & Audio Integration: Macaw-LLM can count moving objects in a video and simultaneously use the audio track to determine if a dog in the frame is barking or remaining silent.

Limitations and Future Work

The authors acknowledge several hurdles for future development. Current evaluation is primarily qualitative, highlighting the need for more rigorous, quantitative benchmarks. Additionally, the model is currently optimized for single-turn interactions and struggles with long-range context in multi-turn dialogues. Like all LLMs, Macaw-LLM is susceptible to "hallucinating" details and has not yet been fully stress-tested for toxicity or fairness.

Future directions include expanding the corpus to include multi-turn and multilingual dialogues and exploring more direct utilization of audio-only instructions.

Summary updated

BibTeX
@misc{lyu2023macaw,
  author = {Chenyang Lyu and Minghao Wu and Longyue Wang and Xinting Huang and Bingshuai Liu and Zefeng Du and Shuming Shi and Zhaopeng Tu},
  title = {{Macaw-LLM: Multi-Modal Language Modeling with Image, Audio, Video, and Text Integration}},
  year = {2023},
  eprint = {2306.09093},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2306.09093},
}
Figure