CausalLM is not optimal for in-context learning

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Ding, Nan, Levinboim, Tomer, Wu, Jialin, Goodman, Sebastian, Soricut, Radu
Format: Preprint
Published: 2023
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866916132536975360
author Ding, Nan
Levinboim, Tomer
Wu, Jialin
Goodman, Sebastian
Soricut, Radu
author_facet Ding, Nan
Levinboim, Tomer
Wu, Jialin
Goodman, Sebastian
Soricut, Radu
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2308_06912
institution arXiv
publishDate 2023
record_format arxiv
spellingShingle CausalLM is not optimal for in-context learning
Ding, Nan
Levinboim, Tomer
Wu, Jialin
Goodman, Sebastian
Soricut, Radu
Machine Learning
Computation and Language
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.
title CausalLM is not optimal for in-context learning
topic Machine Learning
Computation and Language
url https://arxiv.org/abs/2308.06912