Skip to main content
QUICK REVIEW

[논문 리뷰] Arithmetic Without Algorithms: Language Models Solve Math With a Bag of Heuristics

Yaniv Nikankin, Anja Reusch|arXiv (Cornell University)|2024. 10. 28.
Computability, Logic, AI AlgorithmsComputer Science인용 수 3
한 줄 요약

이 논문은 대규모 언어 모델이 산술 추론을 학습된 알고리즘이나 기억력이 아닌 '해결 전략의 집합'—즉, 특정 수치 범위나 패턴에 대해 로그릿을 증가시키는 단순한 패턴 기반 규칙을 구현하는 희소한 수의 뉴런으로 구성된 방식으로 해결한다는 것을 드러낸다. 이 메커니즘은 훈련 초반에 나타나며 대부분의 모델 정확도를 설명하며, LLM의 알고리즘 일반화에 대한 기존의 가정을 도전한다.

ABSTRACT

Do large language models (LLMs) solve reasoning tasks by learning robust generalizable algorithms, or do they memorize training data? To investigate this question, we use arithmetic reasoning as a representative task. Using causal analysis, we identify a subset of the model (a circuit) that explains most of the model's behavior for basic arithmetic logic and examine its functionality. By zooming in on the level of individual circuit neurons, we discover a sparse set of important neurons that implement simple heuristics. Each heuristic identifies a numerical input pattern and outputs corresponding answers. We hypothesize that the combination of these heuristic neurons is the mechanism used to produce correct arithmetic answers. To test this, we categorize each neuron into several heuristic types-such as neurons that activate when an operand falls within a certain range-and find that the unordered combination of these heuristic types is the mechanism that explains most of the model's accuracy on arithmetic prompts. Finally, we demonstrate that this mechanism appears as the main source of arithmetic accuracy early in training. Overall, our experimental results across several LLMs show that LLMs perform arithmetic using neither robust algorithms nor memorization; rather, they rely on a "bag of heuristics".

연구 동기 및 목표

  • 대규모 언어 모델(LLMs)이 산술 추론을 강력한 알고리즘 또는 훈련 데이터의 기억에 기반하여 해결하는지 여부를 조사하는 것.
  • LLMs의 산술 추론 내부 메커니즘을 뉴런 수준에서 역공학적으로 분석하는 것.
  • 해결 전략 기반 메커니즘이 훈련 과정에서 언제, 어떻게 나타나는지 규명하는 것.
  • 개별 뉴런이 산술 정확도에 기여하는 방식을 분류하고 정량화하는 것.
  • 알고리즘 기반 추론을 통한 일반화가 이루어진다는 가정을 도전하기 위해, 해석 전략 패턴에 의존한다는 것을 입증하는 것.

제안 방법

  • 인과 분석을 사용하여 LLMs의 산술 추론을 담당하는 최소한의 회로를 고립한다.
  • 산술 회로 내부의 개별 뉴런을 분석하여 특정 입력 패턴에 대해 활성화되는 뉴런을 식별한다.
  • 활성화 패턴에 따라 뉴런을 결과 범위 기반, 패턴 기반, 또는 모듈로 기반 규칙 등 해석 전략 유형으로 분류한다.
  • 제거 및 충실도 분석을 통해 각 해석 전략 유형이 모델 정확도에 기여하는 정도를 평가한다.
  • 훈련 단계별로 해석 전략의 출현을 추적하여 이 메커니즘이 언제 주도적 역할을 하는지 파악한다.
  • 일관성 있는 결과를 확보하기 위해 여러 LLMs(Llama3-8B, GPT-J 등)을 대상으로 실험을 수행한다.
Figure 1: Bag of heuristics visualization. We show that transformer LLMs solve arithmetic prompts by combining several unrelated heuristics, each activating according to rules based on the input values of operands, and boosting the logits of corresponding result tokens. These heuristics are manifest
Figure 1: Bag of heuristics visualization. We show that transformer LLMs solve arithmetic prompts by combining several unrelated heuristics, each activating according to rules based on the input values of operands, and boosting the logits of corresponding result tokens. These heuristics are manifest

실험 결과

연구 질문

  • RQ1LLMs는 산술을 강력하고 일반화 가능한 알고리즘으로 해결하는가, 아니면 훈련 예제의 기억에 의존하는가?
  • RQ2LLMs의 산술 추론 배경에 있는 내부 메커니즘—특히 개별 뉴런의 역할—은 무엇인가?
  • RQ3해석 전략 뉴런은 모델 정확도에 어떻게 기여하며, 이는 성능을 설명하는 데 충분한가?
  • RQ4훈련 과정에서 '해결 전략의 집합' 메커니즘이 언제 나타나는가?
  • RQ5해석 전략 뉴런은 훈련 분포를 초월해 일반화되는가?

주요 결과

  • 각각 다른 해석 전략을 구현하는 희소한 뉴런 집합이 모델의 산술 정확도 대부분을 차지한다.
  • 이 메커니즘은 알고리즘적이지 않으며, 특정 결과 범위에 대해 로그릿을 증가시키거나 숫자 패턴을 일치시키는 등 서로 관련 없는 해석 전략 규칙들의 조합이다.
  • 해석 전략 뉴런은 특정 입력 패턴에 대해 활성화된다—예를 들어, 답이 240에서 270 사이일 경우 한 뉴런이 이 범위의 결과에 대해 로그릿을 증가시킨다.
  • '해결 전략의 집합' 메커니즘은 훈련 초반에 나타나며 주도적인 역할을 하므로, 이는 초기 단계부터 주요 메커니즘이라고 볼 수 있다.
  • 충실도 분석을 통해 무작위로 조합된 해석 전략 유형의 조합이 산술 프롬프트에 대한 모델 행동의 대부분을 설명한다.
  • 사전 정의된 해석 전략 유형에 부합하지 않는 뉴런은 정확도에 거의 기여하지 않으며, 이는 해석 전략 메커니즘이 정확한 성능을 위해 충분하고 필수적임을 시사한다.
(a)
(a)

이 논문 읽기

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

누빈트에서 이 논문 읽기

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