본문 바로가기

Paper review/Skimming paper review

Transformer Interpretability Beyond Attention Visualization

https://arxiv.org/abs/2012.09838

 

Transformer Interpretability Beyond Attention Visualization

Self-attention techniques, and specifically Transformers, are dominating the field of text processing and are becoming increasingly popular in computer vision classification tasks. In order to visualize the parts of the image that led to a certain classifi

arxiv.org

TL;DR

CNN based model과 다르게 Transformer based model은 기존에 많이 사용하던 Grad-CAM이 잘 쓰이지 않음. 이는 CNN의 pooling과 같은 연산이 없고 skip connection과 attention matrix에 의존하기 때문이고 Grad-CAM에서는 CNN의 lower layer를 사용하지 않고 deep layer에서 따로 추출해서 사용하는데 transformer에서는 이러한 과정을 정립하기 어려움.

현재 많이 사용되는 visualization method는 attention map을 visualize하는 정도인데 이런 방식은 각 layer에 있는 attention heads의 correlation을 반영하지 못함.

따라서 저자는 Attention map의 gradient와 deep Taylor decomposition 기반의 relevance propagation score를 Hadamard product 결과의 기댓값의 positive value를 Identity matrix에 더함. 최종적으로 전부 다 곱하여 만들어낸 행렬 C를 사용.

 

개인적으로 알고있었던 XAI visualize method는 CAM과 Grad-CAM이 전부였는데 relevance score를 알게 되어서 괜찮았다. 하지만 ViT의 attention mechanism이 residual과 attention matrix에 의존해서 (필자는 ReLU가 아닌 GeLU를 사용하여 attention score의 negative value의 해석이 어려워짐도 있다고 생각함) 오히려 설명가능성이 떨어진다는 사실도 알게 되었다.

ViT의 16x16 patch embedding도 conventional한 CNN based XAI method를 적용하지 못하게 하는 원인이지 않을까?

 

Reference

https://velog.io/@sjinu/%EB%85%BC%EB%AC%B8%EB%A6%AC%EB%B7%B0Transformer-Interpretability-Beyond-Attention-Visualization

https://www.sciencedirect.com/science/article/pii/S0031320316303582

'Paper review > Skimming paper review' 카테고리의 다른 글

Deformable Convolutional Networks  (0) 2023.01.13