Zero-Shot Translation of Attention Patterns in VQA Models to Natural Language

Leonard Salewski, A. Sophia Koepke, Hendrik P. A. Lensch, Zeynep Akata

Introduction

Deep learning models, particularly in complex tasks like Visual Question Answering (VQA), often operate as "black boxes." While researchers frequently use heatmaps—such as attention maps or attribution visualizations—to illustrate where a model is focusing, these visual cues are often ambiguous. A highlight over a kitchen counter, for instance, does not clarify whether the model identified a toaster, a knife, or simply the marble texture.

The challenge lies in converting these abstract internal states into human-readable natural language explanations. Traditionally, training a dedicated explanation model requires vast amounts of human-annotated data, including questions, images, answers, and written justifications. This research introduces ZS-A2T (Zero-Shot Attention-to-Text), a training-free framework designed to translate a VQA model's internal "thoughts" into natural language without any additional supervisory data.

The ZS-A2T Framework

ZS-A2T bridges the gap between vision-language models and Large Language Models (LLMs) using a clever "propose-and-rank" pipeline. The framework is "zero-shot" because it requires no fine-tuning on explanation datasets; it simply integrates with existing pre-trained models.

The ZS-A2T architecture detailing the attention rollout and attention-controlled guiding process.

As illustrated in the architecture above, the process follows these key steps:

  1. Attention Rollout: The framework extracts an attention map from the VQA model (specifically ALBEF) to identify image regions most relevant to the predicted answer.
  2. Image Masking: An "attention-masked image" is created by removing pixels that the model ignored.
  3. LLM Proposals: A pre-trained LLM (such as OPT) is prompted with the question and the predicted answer to suggest potential tokens for an explanation.
  4. Sentence Completion: For each candidate token, the LLM generates a full sentence continuation.
  5. VQA-Guided Ranking: Crucially, ZS-A2T re-uses the Image-Text Matching (ITM) head of the original VQA model to score how well each completed sentence matches the masked image.
  6. Decoding: The final output is selected by balancing the LLM's linguistic probability with the VQA model's visual grounding score.

Experimental Setup

The researchers evaluated ZS-A2T on two primary textual explanation benchmarks:

  • VQA-X: A subset of the VQA v2 dataset supplemented with human-written explanations.
  • GQA-REX: A dataset providing explanations for the GQA (Visual Reasoning) task, derived from scene graphs.

Key Insights

  • The "Self-Explaining" Model: By using the VQA model's own ITM head to rank LLM proposals against the masked image, the resulting explanation is inherently grounded in exactly what the VQA model "saw."
  • Contextualized Scoring: Unlike previous methods that score individual words, ZS-A2T scores full sentences. This is more effective because ITM heads are typically trained on complete linguistic structures rather than fragments.
  • Modularity: The framework is highly flexible; researchers can swap the LLM or the attribution method (e.g., moving from Attention Rollout to Grad-CAM) without altering the underlying logic.

Results and Performance

ZS-A2T sets a new state-of-the-art for zero-shot explanation generation, significantly outperforming existing methods across multiple metrics.

Quantitative comparison of ZS-A2T against other zero-shot and supervised frameworks on GQA-REX and VQA-X datasets.

As shown in the table above, ZS-A2T achieved a Bleu-4 score of 8.5 on the VQA-X dataset, more than doubling the performance of the previous best zero-shot method, Socratic Models (3.6). On GQA-REX, it achieved a Cider (C) score of 113.5, a massive leap from the 48.8 achieved by the MAGIC framework. Qualitatively, the model successfully identifies specific concepts; for example, correctly identifying a "pickup truck" rather than a generic "vehicle" because that specific concept was captured in the attention-masked region.

Conclusion and Future Directions

While ZS-A2T leads the zero-shot field, it still lags behind supervised models explicitly trained on human explanations. Occasional "common sense bias" remains a challenge, where the LLM's internal knowledge might override visual evidence (e.g., assuming a sitting person is "tired" without visual proof). Future work will focus on extending the framework to other architectures like ViLT or LXMERT and optimizing inference speed, as generating explanations token-by-token remains computationally intensive.

Summary updated

BibTeX
@inproceedings{salewski2023zero,
  author = {Leonard Salewski and A. Sophia Koepke and Hendrik P. A. Lensch and Zeynep Akata},
  title = {{Zero-Shot Translation of Attention Patterns in VQA Models to Natural Language}},
  booktitle = {DAGM},
  year = {2023},
  doi = {10.1007/978-3-031-54605-1\_25},
}
Figure