Skip to main content
QUICK REVIEW

[논문 리뷰] How does GPT-2 compute greater-than?: Interpreting mathematical abilities in a pre-trained language model

Michael Hanna, Ollie Liu|arXiv (Cornell University)|2023. 04. 30.
Topic ModelingComputer Science인용 수 14
한 줄 요약

이 논문은 GPT-2 small이 모델 내의 최소 인과 회로를 식별하고 MLP와 주의(heads)가 연도 구간에서 더 큰 값의 연산에 기여하는 방식을 설명함으로써 연도 구간에 대한 greater-than 연산을 수행하는 능력을 분석합니다.

ABSTRACT

Pre-trained language models can be surprisingly adept at tasks they were not explicitly trained on, but how they implement these capabilities is poorly understood. In this paper, we investigate the basic mathematical abilities often acquired by pre-trained language models. Concretely, we use mechanistic interpretability techniques to explain the (limited) mathematical abilities of GPT-2 small. As a case study, we examine its ability to take in sentences such as "The war lasted from the year 1732 to the year 17", and predict valid two-digit end years (years > 32). We first identify a circuit, a small subset of GPT-2 small's computational graph that computes this task's output. Then, we explain the role of each circuit component, showing that GPT-2 small's final multi-layer perceptrons boost the probability of end years greater than the start year. Finally, we find related tasks that activate our circuit. Our results suggest that GPT-2 small computes greater-than using a complex but general mechanism that activates across diverse contexts.

연구 동기 및 목표

  • 사전 학습된 언어 모델이 명시적 훈련 없이 수학적 능력을 어떻게 보이는지 조사한다.
  • GPT-2 small에 메카니스틱 해석 가능성을 적용하여 간단한 수학 과제에 대한 내부 회로를 밝힌다.
  • greater-than 연산을 계산하는 데 필요한 최소 구성요소를 식별한다.
  • 주의(heads)와 MLP가 숫자 정보를 전달하고 처리하는 역할을 특징짓는다.

제안 방법

  • GPT-2가 시작 연도 YY보다 끝 연도가 더 큰 확률을 할당하는 연도-구간 예측 과제를 정의한다.
  • path patching을 사용하여 데이터세트(01-dataset)를 만들고 패칭 구성요소가 로짓 및 확률 차이에 미치는 영향을 측정한다.
  • 회로를 고립시키기 위해 주의 헤드와 MLPs(MLPs 8–11)로부터의 로짓에 대한 직접 기여를 패칭하여 회로 구성 요소를 점진적으로 식별한다.
  • 회로를 로짓 렌즈(logit lens) 분석 및 MLP 내 뉴런 수준 기여를 통해 설명한다.
  • 타깃 데이터 세트 패칭 실험으로 회로의 충분성을 평가하고, 회로 외부 구성요소를 교차 패칭하여 필요성을 평가한다.
Figure 1: Year-span prediction example ( XX =17 and YY =32) with sample (in)valid output years.
Figure 1: Year-span prediction example ( XX =17 and YY =32) with sample (in)valid output years.

실험 결과

연구 질문

  • RQ1GPT-2 small 내의 최소한의 인과 회로가 연도-구간 프롬프트에서 greater-than 연산을 설명할 수 있는가?
  • RQ2이 작업에서 어떤 구성요소(주의 헤드, MLP, 뉴런)가 계산에 필요하고 충분한가?
  • RQ3식별된 회로 구성 요소가 시작 연도 YY를 전달하고 비교를 계산하는 방식은 어떻게 상호 작용하는가?
  • RQ4발견된 회로가 유사한 형식과 출력 공간을 가진 관련 프롬프트에도 일반화되는가?
  • RQ5결과가 memory화와 일반화 중 어떤 것이 GPT-2의 수학적 능력의 출처인지 구분하는가?

주요 결과

  • MLP 8–11 및 a9.h1(주의 헤드)로 구성된 회로가 로짓의 greater-than 계산을 대체로 설명한다.
  • 주의 헤드가 시작 연도 YY를 다운스트림 MLP로 전달하는 것으로 보이며, 이들이 직접 어떤 출력 연도가 YY보다 큰지를 계산한다.
  • MLP 10(또는 더 덜한 정도의 MLP 9 및 MLP 11)이 greater-than 결정에 가장 직접적으로 기여하며, 뉴런 수준 분석은 이 작동이 MLP 내의 여러 뉴런에 분산되어 있음을 보여준다.
  • 패칭 경로 실험은 회로가 대체로 충분함(원래의 확률 차이의 약 72.7%)을 보여주고, 회로 외부의 에지를 교란하면 필요성이 입증된다(-컨트롤에서 -36.6%).
  • 로짓 렌즈 분석은 MLP 9–11이 YY보다 큰 연도를 가중치로 올려 상삼각 패턴을 형성해 끝-문장 위치에서 비교를 구현한다는 것을 보여준다.
Figure 3: A : The computational graph of GPT-2, run on our normal dataset. B : GPT-2, where the (MLP 10, logits) path is patched to receive 01 -input. C : GPT-2, where the (Attn 10, MLP 10, logits) path receives 01 -input. Nodes receiving normal input have blue output; nodes receiving 01 -input have
Figure 3: A : The computational graph of GPT-2, run on our normal dataset. B : GPT-2, where the (MLP 10, logits) path is patched to receive 01 -input. C : GPT-2, where the (Attn 10, MLP 10, logits) path receives 01 -input. Nodes receiving normal input have blue output; nodes receiving 01 -input have

이 논문 읽기

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

누빈트에서 이 논문 읽기

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