[논문 리뷰] How Does BERT Answer Questions? A Layer-Wise Analysis of Transformer Representations
이 논문은 BERT의 은닉 상태를 계층별로 분석하여 QA 추론이 어떻게 나타나는지 이해하려고 하며, 위상처럼 변환이 일어나고 미세 조정이 의미 능력에 미치는 영향이 제한적임을 보여준다.
Bidirectional Encoder Representations from Transformers (BERT) reach state-of-the-art results in a variety of Natural Language Processing tasks. However, understanding of their internal functioning is still insufficient and unsatisfactory. In order to better understand BERT and other Transformer-based models, we present a layer-wise analysis of BERT's hidden states. Unlike previous research, which mainly focuses on explaining Transformer models by their attention weights, we argue that hidden states contain equally valuable information. Specifically, our analysis focuses on models fine-tuned on the task of Question Answering (QA) as an example of a complex downstream task. We inspect how QA models transform token vectors in order to find the correct answer. To this end, we apply a set of general and QA-specific probing tasks that reveal the information stored in each representation layer. Our qualitative analysis of hidden state visualizations provides additional insights into BERT's reasoning process. Our results show that the transformations within BERT go through phases that are related to traditional pipeline tasks. The system can therefore implicitly incorporate task-specific information into its token representations. Furthermore, our analysis reveals that fine-tuning has little impact on the models' semantic abilities and that prediction errors can be recognized in the vector representations of even early layers.
연구 동기 및 목표
- QA 작업 동안 BERT가 계층을 따라 토큰 표현을 어떻게 변환하는지 조사한다.
- 다른 계층이 QA에서 서로 다른 추론 단계를 수행하는지 밝힌다.
- QA를 위한 미세 조정이 내부 계층 표현에 어떤 영향을 미치는지 평가한다.
- 은닉 상태를 사용하여 QA 예측이 왜, 어디에서 실패하는지 식별하는 도구를 제공한다.
제안 방법
- 차원 축소와 군집화를 사용하여 토큰 벡터의 층별 질적 시각화를 수행한다.
- 각 계층에 대해 일련의 프로빙 작업( Named Entity Labeling, Coreference Resolution, Relation Classification)뿐만 아니라 QA 특정 작업들(Question Type Classification, Supporting Fact Identification)을 적용한다.
- Edge Probing을 사용하여 핵심 NLP 작업을 층별 분류 문제로 변환한다.
- SQuAD, HotpotQA, 및 bAbI의 미세 조정된 BERT 모델과 사전 학습된 대응 모델을 비교한다.
- 다른 트랜스포머에 대한 통찰의 전이 가능성을 평가하기 위해 GPT-2를 질적 비교 대상으로 포함한다.
실험 결과
연구 질문
- RQ1트랜스포머 모델은 사람처럼 분해적으로 질문에 답할 수 있는가?
- RQ2다층 트랜스포머에서 특정 계층이 QA 중에 다른 작업을 해결하는가?
- RQ3미세 조정이 네트워크의 내부 상태와 계층 기능에 어떤 영향을 미치는가?
- RQ4계층별 분석이 모델이 올바른 답을 예측하지 못하는 이유를 설명하는 데 도움이 될 수 있는가?
주요 결과
- 은닉 상태에는 전통적인 NLP 작업과 유사한 단계로 진행되는 해석 가능한 정보가 포함되어 있다.
- 초기 계층은 일반 언어 속성을 인코딩하고, 후기 계층은 QA를 위한 작업 특화 정보를 통합한다.
- Named Entity Labeling은 가장 앞선 계층에서 향상되고, Coreference Resolution 및 Relation Classification은 후기 계층에서 정점에 도달하며, Question Type 정보는 작업 의존적이다.
- 질문과 Supporting Facts는 계층 간 벡터 공간에서 일치하며, 상위 계층에서 답 추출에 적합한 관련 토큰을 정렬한다.
- 미세 조정은 핵심 NLP 능력에 미치는 영향이 제한적이며, 사전 학습에 이미 대부분의 정보가 존재하고 미세 조정 중에는 가벼운 가중치 변화만 발생한다.
- 위치 임베딩은 나중 계층까지 영향력을 유지하여 트랜스포머 표현에서 순차 정보를 뒷받침한다.
더 나은 연구,지금 바로 시작하세요
논문 읽기부터 검토까지, 연구 시간을 획기적으로 줄여보세요.
카드 등록 없음 · 무료 플랜 제공
이 리뷰는 AI가 만들고, 인간 에디터가 검토했습니다.