Skip to main content
QUICK REVIEW

[논문 리뷰] Dissecting Recall of Factual Associations in Auto-Regressive Language Models

Mor Geva, Jasmijn Bastings|arXiv (Cornell University)|2023. 04. 28.
Topic Modeling인용 수 5
한 줄 요약

이 논문은 추론 중 정보 흐름을 분석함으로써 자동회귀 언어 모델이 사실 정보를 어떻게 검색하는지 분석한다. 표적화된 어텐션 간섭을 통해 삼단계 메커니즘을 규명한다: 초기 MLP 레이어에서 주어진 표현이 풍부해지고, 관계 정보가 예측 토큰으로 전파되며, 상위 트랜스포머 레이어에서 주어진 표현-속성 매핑을 인코딩한 어텐션 헤드를 통해 정확한 속성이 추출된다. 이는 GPT-2에서 약 70%의 예측과 150개의 헤드에서 관찰된다.

ABSTRACT

Transformer-based language models (LMs) are known to capture factual knowledge in their parameters. While previous work looked into where factual associations are stored, only little is known about how they are retrieved internally during inference. We investigate this question through the lens of information flow. Given a subject-relation query, we study how the model aggregates information about the subject and relation to predict the correct attribute. With interventions on attention edges, we first identify two critical points where information propagates to the prediction: one from the relation positions followed by another from the subject positions. Next, by analyzing the information at these points, we unveil a three-step internal mechanism for attribute extraction. First, the representation at the last-subject position goes through an enrichment process, driven by the early MLP sublayers, to encode many subject-related attributes. Second, information from the relation propagates to the prediction. Third, the prediction representation "queries" the enriched subject to extract the attribute. Perhaps surprisingly, this extraction is typically done via attention heads, which often encode subject-attribute mappings in their parameters. Overall, our findings introduce a comprehensive view of how factual associations are stored and extracted internally in LMs, facilitating future research on knowledge localization and editing.

연구 동기 및 목표

  • 자기회귀 언어 모델이 추론 과정에서 사실 정보를 어떻게 검색하는지 내부 메커니즘을 이해하는 것.
  • 주어진 정보와 관계 정보가 융합되어 사실 예측을 생성하는 트랜스포머 계산의 핵심 지점들을 특정하는 것.
  • MLP와 다중헤드 자기어텐션(MHSA) 서브층이 속성 표현을 구성하고 추출하는 데 수행하는 역할을 조사하는 것.
  • 주어진 표현-속성 매핑이 어텐션 헤드 파라미터에 인코딩되어 있는지, 그리고 예측에 기여하는 방식을 규명하는 것.
  • 향후 지식 편집 및 국소화 작업을 위한 투명하고 해석 가능한 지식 회상의 시각을 제공하는 것.

제안 방법

  • 저자들은 특정 입력 위치로의 어텐션을 차단함으로써 마지막 토큰에서 다양한 레이어에 걸쳐 중요도를 평가하는 표적화된 어텐션 끄기 간섭을 사용한다.
  • 주어진 정보와 관계 신호가 융합되는 핵심 레이어에서 표현 변화를 측정함으로써 정보 흐름을 분석한다.
  • 각 레이어와 헤드에 인코딩된 정보를 근사하기 위해 히든 표현을 어휘 공간으로 투영한다.
  • 예측된 속성이 헤드 출력의 상위 10개 토큰에 포함되는지 확인함으로써 주어진 표현-속성 매핑을 인코딩하는 어텐션 헤드를 식별하고 분석한다.
  • GPT-2와 GPT-J와 같은 디코더 전용 모델을 중심으로 분석하며, 모델이 다음 토큰을 정확히 예측한 경우를 대상으로 한다.
  • 기능적 역할을 평가하기 위해 시스템적으로 구성 요소를 손상시키는 유전 분석을 모델로 한 역공학적 접근을 사용한다.
Figure 1: Illustration of our findings: given subject-relation query, a subject representation is constructed via attributes’ enrichment from MLP sublayers (A), while the relation propagates to the prediction (B). The attribute is then extracted by the MHSA sublayers (C).
Figure 1: Illustration of our findings: given subject-relation query, a subject representation is constructed via attributes’ enrichment from MLP sublayers (A), while the relation propagates to the prediction (B). The attribute is then extracted by the MHSA sublayers (C).

실험 결과

연구 질문

  • RQ1주어진 정보와 관계 정보가 사실 예측을 가능하게 하기 위해 어느 레이어와 위치에서 융합되는가?
  • RQ2MLP인지 MHSA 서브층 중에서 주어진 표현을 속성 정보로 풍부하게 하는 데 주로 기여하는 것은 무엇인가?
  • RQ3추론 과정에서 최종 속성이 주어진 표현으로부터 어떻게 추출되는가?
  • RQ4주어진 표현-속성 매핑이 어텐션 헤드 파라미터에 얼마나 깊이 인코딩되어 있는가?
  • RQ5다양한 사실 정보에 걸쳐 일관된 내부 메커니즘이 존재하는가?

주요 결과

  • 초기 MLP 서브층을 통해 마지막 주어 토큰 위치에서 주어진 표현이 풍부한 속성 정보를 포함하는 표현으로 구성되며, 이는 주로 주어진 정보와 관련된 정보의 근원이다.
  • 계산 과정에서 두 가지 핵심 지점이 규명되었다: 첫째, 관계 표현이 예측 토큰으로 전파되고, 둘째, 주어진 표현의 풍부한 표현이 통합된다.
  • 최종 속성 추출은 상위 MHSA 서브층이 관계를 키로 사용하여 풍부한 주어 표현을 질의함으로써 수행된다.
  • 약 70%의 사실 예측에서 어텐션 헤드가 직접 파라미터에 주어진 표현-속성 매핑을 인코딩하며, GPT-2에서는 이와 같은 헤드가 총 150개로 확인되었으며 대부분 상위 레이어에 분포되어 있다.
  • 속성 추출 메커니즘은 강력하고 일관된 특성을 보이며, 관계 정보가 어텐션 메커니즘을 통해 주어진 표현에서 정확한 속성을 검색하도록 이끈다.
  • 연구 결과는 사실 지식이 중간 레이어의 MLP에만 저장되어 있는 것이 아니라, 파rameterized 어텐션 헤드를 통해 능동적으로 검색된다는 점을 드러내며, 이는 이전의 지식 저장에 대한 가정을 도전한다.
Figure 3: Attributes rate at different positions across layers (starting from layer 1), in GPT-2 and GPT-J .
Figure 3: Attributes rate at different positions across layers (starting from layer 1), in GPT-2 and GPT-J .

더 나은 연구,지금 바로 시작하세요

논문 읽기부터 검토까지, 연구 시간을 획기적으로 줄여보세요.

카드 등록 없음 · 무료 플랜 제공

이 리뷰는 AI가 만들고, 인간 에디터가 검토했습니다.