[论文解读] AtMan: Understanding Transformer Predictions Through Memory Efficient Attention Manipulation
AtMan 引入一种内存高效的基于扰动的 XAI 方法,通过操作注意力分数来引导变换器预测,使得对大规模多模态模型在文本和图像-文本任务中能在极少额外内存开销下获得解释,并在准确性上优于基于梯度的基线。
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.
研究动机与目标
- 在大型生成型变换器中动机可扩展的可解释性需求,其中反向传播基础的 XAI 会占用大量内存。
- 提出 AtMan,一种内存高效的注意力操作扰动方法,可为开放词汇生成输出输入相关性图。
- 证明 AtMan 在降低扰动需求方面具有可扩展性,可在不增加额外内存开销的情况下扩展到大型模型。
- 在文本与图像-文本基准上评估 AtMan,显示其性能与基于梯度的 XAI 方法相当甚至更优。
提出的方法
- 将可解释性表述为通过扰动识别对模型输出影响最大的输入部分。
- 通过扰动注意力分数而非权重,将扰动空间从输入空间转移到嵌入 token 空间。
- 定义单一 token 的注意力抑制:将给定 token 的注意力贡献按因子 f 进行尺度缩放以影响预测。
- 扩展为使用嵌入空间中的余弦相似度来抑制相关 token,以抑制 token 之间的冗余。
- 给出对 pre-softmax 注意力 H 进行修改的逐 token 抑制矩阵的封闭式方程(Eq. 4),以及将解释累积为影响分数向量的方程(Eq. 5)。
- 应用相关 token 抑制(Eq. 6)以考虑 token 邻域并减少嘈杂的归因。
- 通过文本和图像-语言模型的实验展示可扩展性与内存效率,并与基于梯度的 XAI 基线进行比较。

实验结果
研究问题
- RQ1AtMan 是否能够在语言模型和语言-视觉模型上提供与基于梯度的 XAI 方法相竞争的解释?
- RQ2AtMan 是否对大型自回归变换器和多模态模型具有可扩展性,且不会带来难以承受的内存成本?
- RQ3相关 token 抑制是否提升多模态场景下解释的鲁棒性?
- RQ4AtMan 的解释是否与 QA/VQA 基准中的人工注释或真实解释信号对齐?
主要发现
- AtMan 在文本 QA 和图像文本 VQA 基准的平均精度及相关指标上优于基于梯度的基线。
- AtMan 的内存使用保持与前向传播相当,使其能够在由于内存限制而难以进行梯度基 XAI 的大型模型上部署。
- AtMan 在 MAGMA 变体(6B、13B、30B)和 BLIP 上表现具有竞争力,表明模型无关适用性。
- 相关 token 抑制通过在嵌入空间利用余弦相似度来抑制冗余信息,从而提高解释质量。
- 在 SQuAD(文本)和 OpenImages(视觉)的实验中,AtMan 在大多数评估设定下比 IxG、IG、GradCAM、Chefer 获得更高的精度/召回率。
- 在大规模硬件(80GB A100)上,AtMan 在梯度基方法超出内存限制的情况下仍然可行,彰显可扩展性。

阅读本论文
在 Nubint 阅读器中打开原文,边读边就任意段落提问。
在 Nubint 中阅读本论文本解读由 AI 根据论文原文生成,引用前请核对原文。