Papers
Topics
Authors
Recent
Gemini 2.5 Flash
Gemini 2.5 Flash
80 tokens/sec
GPT-4o
59 tokens/sec
Gemini 2.5 Pro Pro
43 tokens/sec
o3 Pro
7 tokens/sec
GPT-4.1 Pro
50 tokens/sec
DeepSeek R1 via Azure Pro
28 tokens/sec
2000 character limit reached

How do Transformers perform In-Context Autoregressive Learning? (2402.05787v2)

Published 8 Feb 2024 in stat.ML and cs.LG

Abstract: Transformers have achieved state-of-the-art performance in LLMing tasks. However, the reasons behind their tremendous success are still unclear. In this paper, towards a better understanding, we train a Transformer model on a simple next token prediction task, where sequences are generated as a first-order autoregressive process $s_{t+1} = W s_t$. We show how a trained Transformer predicts the next token by first learning $W$ in-context, then applying a prediction mapping. We call the resulting procedure in-context autoregressive learning. More precisely, focusing on commuting orthogonal matrices $W$, we first show that a trained one-layer linear Transformer implements one step of gradient descent for the minimization of an inner objective function, when considering augmented tokens. When the tokens are not augmented, we characterize the global minima of a one-layer diagonal linear multi-head Transformer. Importantly, we exhibit orthogonality between heads and show that positional encoding captures trigonometric relations in the data. On the experimental side, we consider the general case of non-commuting orthogonal matrices and generalize our theoretical findings.

User Edit Pencil Streamline Icon: https://streamlinehq.com
Authors (5)
  1. Michael E. Sander (10 papers)
  2. Raja Giryes (156 papers)
  3. Taiji Suzuki (119 papers)
  4. Mathieu Blondel (43 papers)
  5. Gabriel Peyré (105 papers)
Citations (5)
X Twitter Logo Streamline Icon: https://streamlinehq.com