On Speculative Decoding for Multimodal Large Language Models

Mukul Gagrani, Raghavv Goel, Wonseok Jeon, Junyoung Park, Mingu Lee, Christopher LottarXiv 2024 · DOI

Introduction

Multimodal Large Language Models (MLLMs), such as LLaVA, have demonstrated remarkable capabilities in understanding and reasoning over visual and textual data. However, their deployment is often hampered by slow inference speeds. Like standard Large Language Models (LLMs), MLLMs generate tokens auto-regressively, making them heavily bottlenecked by memory bandwidth.

Speculative Decoding (SPD) has emerged as a powerful technique to accelerate text-only LLMs by using a small "draft" model to predict multiple tokens, which are then verified in parallel by a larger "target" model. Applying SPD to multimodal contexts raises a critical question: must the draft model also process visual information to be an effective predictor? This research investigates the feasibility of using tiny, language-only draft models to accelerate multimodal inference.

Methodology

The researchers implemented a speculative decoding framework using LLaVA-7B as the target model. To explore the necessity of visual input for the drafting phase, they developed a 115M-parameter draft model based on the LLaMA-2 architecture.

Overview of the speculative decoding framework for MLLMs, illustrating the interaction between the draft and target models.

The study compared four draft model configurations:

  1. base-LLaMA: A raw 115M model pre-trained on text.
  2. chat-LLaMA: The base model fine-tuned for instruction following.
  3. ft-llava-text: A language-only version fine-tuned on the LLaVA dataset without access to image tokens.
  4. ft-llava: A full multimodal draft model equipped with a small image adapter.

The core innovation lies in demonstrating that the ft-llava-text model, despite being "image-blind," can effectively serve as a proxy for the multimodal target model.

Key Insights: The "Image-Blind" Advantage

The most significant finding is that a draft model does not necessarily need visual context to provide useful predictions. Much of the generated text in multimodal tasks consists of linguistic "connective tissue"—prepositions, common nouns, and predictable word completions—that are highly dependent on the preceding text rather than the image itself.

By utilizing a language-only draft model, the system avoids the computational overhead of a second vision encoder or adapter during the drafting phase. Furthermore, the research highlights that alignment is crucial: fine-tuning the draft model on the same instruction set as the target model (ft-llava-text) significantly improves "block efficiency" (the number of accepted tokens per cycle) compared to generic base models.

Experimental Results

The models were evaluated across three benchmarks: LLaVA Instruct 150K, COCO (for captioning), and ScienceQA (for visual scientific reasoning).

Performance metrics across different datasets, showing Memory-Bound Speedup (MBSU), Block Efficiency, and Token Rate for various draft model configurations.

The results demonstrate a substantial performance boost:

  • Speedup: The 115M draft model achieved a Memory-Bound Speedup (MBSU) of up to 2.37x.
  • Efficiency: With a block size of 5, the target model typically accepted 2 to 3 tokens per cycle.
  • Fidelity: Speculative decoding ensures zero accuracy loss; the final output remains mathematically identical to standard auto-regressive decoding. Qualitative analysis further confirmed that the draft model could successfully predict complex sequences based solely on linguistic context.

Interestingly, while the full multimodal draft model (ft-llava) showed marginal gains in specific tasks like COCO captioning, the added complexity of training and running an image adapter for the draft model yielded minimal benefits over the text-only version.

Conclusion and Future Work

This work proves that speculative decoding is a highly effective strategy for accelerating MLLMs, even when using tiny, language-only draft models. Future research directions include exploring speculative decoding with sampling-based methods, extending the framework to multi-image or video models, and implementing tree-based decoding to further increase token acceptance rates.

Summary updated

BibTeX
@misc{gagrani2024speculative,
  author = {Mukul Gagrani and Raghavv Goel and Wonseok Jeon and Junyoung Park and Mingu Lee and Christopher Lott},
  title = {{On Speculative Decoding for Multimodal Large Language Models}},
  year = {2024},
  eprint = {2404.08856},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2404.08856},
}
Figure