Opkomst van Abstracties: Mechanisme voor Conceptcodering en -decodering voor In-Context Leren in Transformers
Emergence of Abstractions: Concept Encoding and Decoding Mechanism for In-Context Learning in Transformers
December 16, 2024
Auteurs: Seungwook Han, Jinyeop Song, Jeff Gore, Pulkit Agrawal
cs.AI
Samenvatting
Mensen destilleren complexe ervaringen tot fundamentele abstracties die snelle leerprocessen en aanpassing mogelijk maken. Op dezelfde manier vertonen autoregressieve transformers adaptief leren door middel van in-context leren (ICL), wat de vraag oproept hoe dit gebeurt. In dit artikel stellen we een conceptcodering-ontcijferingsmechanisme voor om ICL te verklaren door te bestuderen hoe transformers interne abstracties vormen en gebruiken in hun representaties. Op synthetische ICL-taken analyseren we de trainingsdynamiek van een kleine transformer en rapporteren we de gelijktijdige opkomst van conceptcodering en -ontcijfering. Naarmate het model leert om verschillende latente concepten (bijv. "Het eerste zelfstandig naamwoord in een zin vinden") in afzonderlijke, onderscheidbare representaties te coderen, bouwt het tegelijkertijd conditionele ontcijferingsalgoritmen op en verbetert het zijn ICL-prestaties. We bevestigen het bestaan van dit mechanisme bij vooraf getrainde modellen van verschillende schalen (Gemma-2 2B/9B/27B, Llama-3.1 8B/70B). Verder tonen we door mechanistische ingrepen en gecontroleerde finetuning aan dat de kwaliteit van conceptcodering oorzakelijk gerelateerd is aan en voorspellend is voor ICL-prestaties. Onze empirische inzichten werpen licht op een beter begrip van de succes- en faalmodi van grote taalmodellen via hun representaties.
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.