Skip to main content
QUICK REVIEW

[Paper Review] AtMan: Understanding Transformer Predictions Through Memory Efficient Attention Manipulation

Björn Deiseroth, Mayukh Deb|arXiv (Cornell University)|Jan 19, 2023
Topic ModelingComputer Science16 citations
TL;DR

AtMan introduces a memory-efficient, perturbation-based XAI method that steers transformer predictions by manipulating attention scores, enabling explanations for large multimodal models with minimal extra memory and improved accuracy over gradient-based baselines in text and image-text tasks.

ABSTRACT

Generative transformer models have become increasingly complex, with large numbers of parameters and the ability to process multiple input modalities. Current methods for explaining their predictions are resource-intensive. Most crucially, they require prohibitively large amounts of extra memory, since they rely on backpropagation which allocates almost twice as much GPU memory as the forward pass. This makes it difficult, if not impossible, to use them in production. We present AtMan that provides explanations of generative transformer models at almost no extra cost. Specifically, AtMan is a modality-agnostic perturbation method that manipulates the attention mechanisms of transformers to produce relevance maps for the input with respect to the output prediction. Instead of using backpropagation, AtMan applies a parallelizable token-based search method based on cosine similarity neighborhood in the embedding space. Our exhaustive experiments on text and image-text benchmarks demonstrate that AtMan outperforms current state-of-the-art gradient-based methods on several metrics while being computationally efficient. As such, AtMan is suitable for use in large model inference deployments.

Motivation & Objective

  • Motivate the need for scalable explainability in large generative transformers where backpropagation-based XAI is memory-intensive.
  • Propose AtMan, a memory-efficient attention-manipulation perturbation method that yields input relevancy maps for open-vocabulary generation.
  • Demonstrate that AtMan reduces perturbation requirements and scales to large models without extra memory overhead.
  • Evaluate AtMan on text and image-text benchmarks showing competitive or superior performance to gradient-based XAI methods.

Proposed method

  • Formulate explainability as identifying input parts most affecting the model’s output via perturbations.
  • Shift perturbation space from input space to embedded token space by perturbing attention scores rather than weights.
  • Define single-token attention suppression: scale attention contributions for a given token by a factor f to steer predictions.
  • Extend to correlated token suppression using cosine similarity in embedding space to suppress redundancies across tokens.
  • Provide closed-form equations for modifying pre-softmax attention H via a suppression matrix per token (Eq. 4) and for accumulating explanations as a vector of influence scores (Eq. 5).
  • Apply correlated token suppression (Eq. 6) to account for token neighborhoods and reduce noisy attributions.
  • Demonstrate scalability and memory efficiency through experiments on text and image-language models, comparing against gradient-based XAI baselines.
(a) “What am I looking at?”
(a) “What am I looking at?”

Experimental results

Research questions

  • RQ1Can AtMan provide competitive explanations on language and vision-language models compared to gradient-based XAI methods?
  • RQ2Is AtMan scalable to large autoregressive transformers and multimodal models without prohibitive memory costs?
  • RQ3Does Correlated Token Suppression improve robustness of explanations in multimodal settings?
  • RQ4Do AtMan explanations align with human-annotated or ground-truth explanatory signals in QA/VQA benchmarks?

Key findings

  • AtMan outperforms gradient-based baselines on text QA and image-text VQA benchmarks in mean average precision and related metrics.
  • AtMan maintains memory usage comparable to a forward pass, enabling deployment on large-scale models where gradient-based XAI fails due to memory constraints.
  • AtMan demonstrates competitive performance across MAGMA variants (6B, 13B, 30B) and BLIP, indicating model-agnostic applicability.
  • Correlated token suppression improves explanation quality by leveraging cosine similarity in embedding space to suppress redundant information.
  • Experiments on SQuAD (text) and OpenImages (visual) show AtMan yielding higher precision/recall than IxG, IG, GradCAM, and Chefer in most evaluated settings.
  • On large-scale hardware (80GB A100), AtMan remains feasible where gradient-based methods exceed memory limits, illustrating scalability.
(b) AtMan in the transformer architecture.
(b) AtMan in the transformer architecture.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.