Language Grounded QFormer for Efficient Vision Language Understanding

Moulik Choraria, Nitesh Sekhar, Yue Wu, Xu Zhang, Prateek Singhal, Lav R. VarshneyarXiv 2023 · DOI

Abstract

Modern Vision-Language Models (VLMs) often struggle with the efficiency of aligning visual features with frozen Large Language Models (LLMs). This paper introduces the Grounded QFormer, an architecture that improves efficiency by injecting visual information directly into the semantic intermediate layers of an LLM rather than the raw input layer. By grounding the QFormer with text instructions and utilizing intermediate latent conditioning, the proposed model achieves superior performance in image captioning and Visual Question Answering (VQA) with significantly reduced training data and computational overhead compared to state-of-the-art models like BLIP-2.

Introduction

The current paradigm for building VLMs, exemplified by models like BLIP-2 and InstructBLIP, involves using a bridge module—the QFormer—to connect a frozen vision encoder with a frozen LLM. A significant challenge in this approach is the massive multi-stage pretraining required to align these modalities. The authors identify a fundamental "semantic-syntactic disparity": standard QFormers, often initialized from language models like BERT, produce semantically rich representations. Forcing these high-level features into the low-level, syntactic input embedding layer of an LLM is inherently inefficient.

Methodology: The Grounded QFormer

To address the alignment mismatch, the authors propose the Grounded QFormer, characterized by three key architectural innovations:

  1. Intermediate Latent Conditioning: Instead of feeding visual tokens into the LLM's first layer, they are projected into the LLM’s intermediate latent space. This leverages the fact that QFormer features naturally align better with deeper LLM layers.
  2. Language Grounding: Unlike standard models where the QFormer processes images in isolation, the Grounded QFormer receives the text instruction (prompt) as input. This allows the module to extract visual features specifically relevant to the task at hand.
  3. Encoder Bypass: For encoder-decoder models like Flan-T5, the LLM's encoder is bypassed during the second stage of training, with grounded visual features fed directly to the decoder, enhancing memory efficiency and inference speed.
Comparison between the standard QFormer architecture (a) and the proposed Grounded QFormer (b).

Analysis of Cross-Modal Alignment

The motivation for intermediate conditioning is supported by an analysis of the latent spaces of vision and language models. Using Mutual KNN alignment, the researchers found that the deepest layers of vision models (e.g., CLIP) and language models (e.g., T5) exhibit much higher similarity than their respective early layers. This "Deep-to-Deep Alignment" suggests that the semantic representations formed at the end of the vision pipeline are most compatible with the middle-to-late processing stages of the LLM.

Heatmap showing Mutual KNN alignment across different layers of vision and language models, highlighting stronger alignment in deeper layers.

Experimental Results

The Grounded QFormer was evaluated on standard benchmarks including COCO Captions, VQAv2, and OKVQA. Despite using a smaller base model (FlanT5-base) and far less pretraining data than competitors, the results were significant:

  • VQA Performance: Accuracy in single-task VQA improved from 57.72% with a standard QFormer to 63.25% with the Grounded version.
  • Zero-Shot Generalization: On the OKVQA benchmark, the Grounded model achieved 38.96% accuracy, surpassing the much larger BLIP-2 OPT-6.7B (36.4%) despite having fewer parameters.
  • Efficiency: The architectural changes led to a 2.1% speedup per training epoch and faster convergence to peak performance.

Conclusion and Future Work

The Grounded QFormer demonstrates that semantic grounding and intermediate layer injection are powerful tools for efficient VLM training. While currently optimized for encoder-decoder architectures, preliminary results suggest these principles apply to decoder-only models like Llama. Future research will focus on scaling these methods to larger decoder-only architectures and identifying the optimal "sweet spot" layer for feature injection across various LLMs.

Summary updated

BibTeX
@misc{choraria2023language,
  author = {Moulik Choraria and Nitesh Sekhar and Yue Wu and Xu Zhang and Prateek Singhal and Lav R. Varshney},
  title = {{Language Grounded QFormer for Efficient Vision Language Understanding}},
  year = {2023},
  eprint = {2311.07449},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2311.07449},
}
Figure