When can transformers compositionally generalize in-context?

Seijin Kobayashi, Simon Schug, Yassir Akram, Florian Redhardt, Johannes von Oswald +3 more
7/17/2024
cs.LGcs.NE

No confident code implementation found for this paper.

Abstract

Many tasks can be composed from a few independent components. This gives rise to a combinatorial explosion of possible tasks, only some of which might be encountered during training. Under what circumstances can transformers compositionally generalize from a subset of tasks to all possible combinations of tasks that share similar components? Here we study a modular multitask setting that allows us to precisely control compositional structure in the data generation process. We present evidence that transformers learning in-context struggle to generalize compositionally on this task despite being in principle expressive enough to do so. Compositional generalization becomes possible only when introducing a bottleneck that enforces an explicit separation between task inference and task execution.

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{kobayashi2024when,
  title  = {When can transformers compositionally generalize in-context?},
  author = {Seijin Kobayashi and Simon Schug and Yassir Akram and Florian Redhardt and Johannes von Oswald and Razvan Pascanu and Guillaume Lajoie and João Sacramento},
  year   = {2024},
  eprint = {2407.12275},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2407.12275v1}
}

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/2407.12275.svg)](https://codeofpaper.com/paper/2407.12275)

Discussion