Uncovering mesa-optimization algorithms in Transformers

Johannes von Oswald, Maximilian Schlegel, Alexander Meulemans, Seijin Kobayashi, Eyvind Niklasson +8 more
9/11/2023
cs.LGcs.AI

No confident code implementation found for this paper.

Abstract

Some autoregressive models exhibit in-context learning capabilities: being able to learn as an input sequence is processed, without undergoing any parameter changes, and without being explicitly trained to do so. The origins of this phenomenon are still poorly understood. Here we analyze a series of Transformer models trained to perform synthetic sequence prediction tasks, and discover that standard next-token prediction error minimization gives rise to a subsidiary learning algorithm that adjusts the model as new inputs are revealed. We show that this process corresponds to gradient-based optimization of a principled objective function, which leads to strong generalization performance on unseen sequences. Our findings explain in-context learning as a product of autoregressive loss minimization and inform the design of new optimization-based Transformer layers.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{oswald2023uncovering,
  title  = {Uncovering mesa-optimization algorithms in Transformers},
  author = {Johannes von Oswald and Maximilian Schlegel and Alexander Meulemans and Seijin Kobayashi and Eyvind Niklasson and Nicolas Zucchet and Nino Scherrer and Nolan Miller and Mark Sandler and Blaise Agüera y Arcas and Max Vladymyrov and Razvan Pascanu and João Sacramento},
  year   = {2023},
  eprint = {2309.05858},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2309.05858v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2309.05858.svg)](https://codeofpaper.com/paper/2309.05858)

Discussion