학술

Conserving Relevance in Explaining Transformers with Layer-Wise Relevance Propagation

arXiv CS.AI
CC BY
이 매체는 공공·자유 라이선스로 본문을 직접 표시합니다.

Abstract

Layer-wise Relevance Propagation (LRP) is widely used in computer vision to explain the predictions of neural networks: the method propagates relevance layer by layer from the output back to the input pixels while conserving the total relevance. LRP has been extended to Transformers, but no existing extension simultaneously achieves numerical stability, distributes relevance to the query and key, and conserves relevance in Transformers. We build on Attention-Aware LRP (AttnLRP), which is numerically stable and distributes relevance to the query and key but does not conserve relevance in attention, owing to linearization error and the structural bias of softmax. To satisfy all three, we extend AttnLRP with two propagation rules, each of which eliminates one of these causes. (1) Softmax-IG is a softmax propagation rule based on Integrated Gradients that eliminates linearization error; its discretized version includes the softmax rule of AttnLRP as a special case, and its linearization error asymptotically converges to zero as the number of integration points grows. (2) Bias-to-V redirects the relevance that would otherwise flow into the structural bias to the value. In experiments using ten Vision Transformer models, we show that the propagation rules obtained by integrating both proposed rules into AttnLRP stably distribute relevance to the query and key while conserving total relevance in attention, and thus in Transformers, as the number of integration points increases. We also show that, for most models, explanation performance, as measured by a segmentation test, can be improved by incorporating one or both of the proposed propagation rules.
Additional Features

관련 뉴스