추상화의 발생: 트랜스포머에서 맥락 학습을 위한 개념 인코딩 및 디코딩 메커니즘
Emergence of Abstractions: Concept Encoding and Decoding Mechanism for In-Context Learning in Transformers
December 16, 2024
저자: Seungwook Han, Jinyeop Song, Jeff Gore, Pulkit Agrawal
cs.AI
초록
인간은 복잡한 경험을 빠른 학습과 적응을 가능케 하는 기본적인 추상화로 단순화합니다. 마찬가지로, 자기회귀 트랜스포머는 문맥 내 학습(ICL)을 통해 적응적 학습을 보여주는데, 이는 어떻게 가능한지에 대한 의문을 제기합니다. 본 논문에서는 트랜스포머가 내부 추상화를 형성하고 활용하는 방식을 연구하여 ICL을 설명하기 위해 개념 부호화-복호화 메커니즘을 제안합니다. 합성 ICL 작업에서, 작은 트랜스포머의 훈련 역학을 분석하고 개념 부호화와 복호화의 결합된 발생을 보고합니다. 모델이 서로 다른 잠재적 개념(예: "문장에서 첫 번째 명사 찾기")을 구별 가능한 표현으로 부호화하고 조건적 복호화 알고리즘을 동시에 구축하며 ICL 성능을 향상시키는 것을 관찰합니다. 우리는 다양한 규모의 사전 훈련된 모델(Gemma-2 2B/9B/27B, Llama-3.1 8B/70B)을 통해 이 메커니즘의 존재를 검증합니다. 더 나아가, 메커니즘적 개입과 통제된 세밀 조정을 통해 개념 부호화의 품질이 ICL 성능과 인과적 관련성 및 예측성이 있는 것을 시연합니다. 우리의 경험적 통찰력은 대형 언어 모델의 표현을 통해 이러한 모델의 성공과 실패 모드를 더 잘 이해하는 데 기여합니다.
English
Humans distill complex experiences into fundamental abstractions that enable
rapid learning and adaptation. Similarly, autoregressive transformers exhibit
adaptive learning through in-context learning (ICL), which begs the question of
how. In this paper, we propose concept encoding-decoding mechanism to
explain ICL by studying how transformers form and use internal abstractions in
their representations. On synthetic ICL tasks, we analyze the training dynamics
of a small transformer and report the coupled emergence of concept encoding and
decoding. As the model learns to encode different latent concepts (e.g.,
``Finding the first noun in a sentence.") into distinct, separable
representations, it concureently builds conditional decoding algorithms and
improve its ICL performance. We validate the existence of this mechanism across
pretrained models of varying scales (Gemma-2 2B/9B/27B, Llama-3.1 8B/70B).
Further, through mechanistic interventions and controlled finetuning, we
demonstrate that the quality of concept encoding is causally related and
predictive of ICL performance. Our empirical insights shed light into better
understanding the success and failure modes of large language models via their
representations.