| 
        
          
            | 
 
 
  
Trained Transformers Learn Linear Models In-Context
Speaker: Ruiqi Zhang, UC BerkeleyTime: Monday, January 16, 2024,  10:00AM - 11:00 AM, Eastern Time
 Zoom Link: contact ymao@uottawa.ca
 
 
Abstract:
Attention-based neural networks such as transformers have demonstrated a remarkable ability to exhibit in-context learning (ICL): Given a short prompt sequence of tokens from an unseen task, they can 
formulate relevant per-token and next-token predictions without any parameter updates. By embedding a sequence of labeled training data and unlabeled test data as a prompt, this allows for transformers 
to behave like supervised learning algorithms. Indeed, recent work has shown that when training transformer architectures over random instances of linear regression problems, these models’ predictions 
mimic those of ordinary least squares.
 
In this talk, we will discuss the dynamics of ICL in transformers with a single linear self-attention layer trained by gradient flow on linear regression tasks. We show that despite non-convexity, 
gradient flow with a suitable random initialization finds a global minimum of the objective function. At this global minimum, when given a test prompt of labeled examples from a new prediction task, 
the transformer achieves prediction error competitive with the best linear predictor over the test prompt distribution. We additionally characterize the robustness of the trained transformer to a 
variety of distribution shifts and show that although a number of shifts are tolerated, shifts in the covariate distribution of the prompts are not. Motivated by this, we consider a generalized ICL 
setting where the covariate distributions can vary across prompts. We show that although gradient flow succeeds at finding a global minimum in this setting, the trained transformer is still brittle 
under mild covariate shifts. We complement this finding with experiments on large, nonlinear transformer architectures which we show are more robust under covariate shifts.
 Paper Link
  Speaker's BioRuiqi Zhang is a second-year Ph.D. student in the department of Statistics at UC Berkeley. He mainly focuses on deep learning theory and reinforcement learning theory. He is currently doing research on 
the theory of foundation models and in-context learning.
 |  
            | 
 |  
 
 
 
 |