Skip to main content
QUICK REVIEW

[논문 리뷰] AttnLRP: Attention-Aware Layer-Wise Relevance Propagation for Transformers

Reduan Achtibat, Sayed Mohammad Vakilzadeh Hatefi|arXiv (Cornell University)|2024. 02. 08.
Advanced Memory and Neural ComputingEngineering인용 수 9
한 줄 요약

AttnLRP는 비선형 트랜스포머 어텐션에 대해 Layer-wise Relevance Propagation를 확장하여 입력 및 잠재 표현에 대해 충실하고 효율적인 기여도 해석을 제공하고 뉴런 수준의 이해를 가능하게 한다.

ABSTRACT

Large Language Models are prone to biased predictions and hallucinations, underlining the paramount importance of understanding their model-internal reasoning process. However, achieving faithful attributions for the entirety of a black-box transformer model and maintaining computational efficiency is an unsolved challenge. By extending the Layer-wise Relevance Propagation attribution method to handle attention layers, we address these challenges effectively. While partial solutions exist, our method is the first to faithfully and holistically attribute not only input but also latent representations of transformer models with the computational efficiency similar to a single backward pass. Through extensive evaluations against existing methods on LLaMa 2, Mixtral 8x7b, Flan-T5 and vision transformer architectures, we demonstrate that our proposed approach surpasses alternative methods in terms of faithfulness and enables the understanding of latent representations, opening up the door for concept-based explanations. We provide an LRP library at https://github.com/rachtibat/LRP-eXplains-Transformers.

연구 동기 및 목표

  • 잠재 표현을 포함한 대규모 트랜스포머 모델에 대한 신뢰할 만한 기여도 해석의 동기를 부여한다.
  • 트랜스포머의 비선형 어텐션을 다루기 위해 LRP를 확장한다.
  • 오픈 소스 AttnLRP 구현을 제공하고 향상된 신뢰성과 효율성을 입증한다.
  • AttnLRP가 모델 추론의 flax에서 잠재 뉴런을 어떻게 드러내고 상호 작용하는지 시연한다.

제안 방법

  • Deep Taylor Decomposition 프레임워크 내에서 비선형 어텐션에 대한 새로운 효율적인 LRP 규칙을 유도한다.
  • 선형 계층에는 epsilon-와 gamma-LRP 변형을 적용하고 어텐션 구성요소에 선택적으로 적용한다.
  • 보존성과 안정성을 유지하기 위해 softmax, 행렬 곱셈 및 정규화 계층에 대한 특수 규칙을 개발한다.
  • 어텐션 모듈 내부 및 외부의 잠재 뉴런에 대한 기여도를 가능하게 한다.
  • GitHub에 오픈 소스 구현을 제공한다.
  • AttnLRP와 함께 Activation Maximization을 통해 뉴런 수준의 이해를 시연한다.

실험 결과

연구 질문

  • RQ1트랜스포머 모델 전반에서 AttnLRP 설명이 최첨단 기여도 방법과 비교하여 얼마나 충실한가?
  • RQ2시간과 메모리 측면에서 AttnLRP의 효율성은 perturbation 기반 설명과 비교하여 얼마나 우수한가?
  • RQ3AttnLRP가 잠재 뉴런 표현을 드러내고 조작하여 모델의 추론을 이해할 수 있는가?
  • RQ4ViT와 LLM에서 입력 토큰과 잠재 특징 모두에 대한 기여도 품질을 AttnLRP가 향상시키는가?

주요 결과

  • AttnLRP는 ViT, Llama 2, Flan-T5 설정에서 신뢰성 면에서 일관되게 기준 방법을 능가한다.
  • Gamma-LRP 변형은 비전 트랜스포머의 충실도를 향상시키고 기여도에서 잡음을 줄인다.
  • AttnLRP는 잠재 뉴런의 신뢰 가능한 기여도 추정이 가능하도록 하여 개념 기반 설명과 뉴런 수준의 조작을 용이하게 한다.
  • Perturbation 기반 방법과 비교할 때 LRP 기반 설명은 계산 효율성(역전파 기반) 및 메모리 특성에서 우호적이다.
  • AttnLRP를 이용한 ActMax 가이드 분석은 해석 가능한 인코딩을 드러내고 잠재 뉴런에 대한 표적 개입을 가능하게 한다.
  • 오픈 소스 AttnLRP 구현은 프로젝트 저장소에서 이용 가능하다.

이 논문 읽기

누빈트 뷰어에서 원문을 열고, 읽으면서 궁금한 곳을 바로 물어보세요.

누빈트에서 이 논문 읽기

이 리뷰는 AI가 논문 원문을 바탕으로 만들었습니다. 인용하기 전에 원문을 확인해 주세요.