ChatPaper.aiChatPaper

CausalLM is niet optimaal voor in-context leren.

CausalLM is not optimal for in-context learning

August 14, 2023
Auteurs: Nan Ding, Tomer Levinboim, Jialin Wu, Sebastian Goodman, Radu Soricut
cs.AI

Samenvatting

Recente empirische bevindingen geven aan dat in-context leren op basis van transformers beter presteert bij gebruik van een prefix-taalmodel (prefixLM), waarbij in-context voorbeelden allemaal naar elkaar kunnen 'attenteren', vergeleken met causale taalmodelen (causalLM), die gebruikmaken van auto-regressieve aandacht die voorkomt dat in-context voorbeelden naar toekomstige voorbeelden kunnen 'attenteren'. Hoewel dit resultaat intuïtief is, wordt het niet begrepen vanuit een theoretisch perspectief. In dit artikel nemen we een theoretische benadering en analyseren we het convergentiegedrag van prefixLM en causalLM onder een bepaalde parameterconstructie. Onze analyse toont aan dat beide LM-types lineair convergeren naar hun stationaire punten, maar dat terwijl prefixLM convergeert naar de optimale oplossing van lineaire regressie, de convergentiedynamiek van causalLM die van een online gradient descent-algoritme volgt, wat niet gegarandeerd optimaal is, zelfs niet als het aantal voorbeelden oneindig toeneemt. We ondersteunen onze theoretische beweringen met empirische experimenten op synthetische en echte taken en met verschillende soorten transformers. Onze experimenten bevestigen dat causalLM consistent onderpresteert ten opzichte van prefixLM in alle instellingen.
English
Recent empirical evidence indicates that transformer based in-context learning performs better when using a prefix language model (prefixLM), in which in-context samples can all attend to each other, compared to causal language models (causalLM), which use auto-regressive attention that prohibits in-context samples to attend to future samples. While this result is intuitive, it is not understood from a theoretical perspective. In this paper we take a theoretical approach and analyze the convergence behavior of prefixLM and causalLM under a certain parameter construction. Our analysis shows that both LM types converge to their stationary points at a linear rate, but that while prefixLM converges to the optimal solution of linear regression, causalLM convergence dynamics follows that of an online gradient descent algorithm, which is not guaranteed to be optimal even as the number of samples grows infinitely. We supplement our theoretical claims with empirical experiments over synthetic and real tasks and using various types of transformers. Our experiments verify that causalLM consistently underperforms prefixLM in all settings.
PDF181February 8, 2026