When can transformers reason with abstract symbols?

Enric Boix-Adserà, O. Saremi, Emmanuel Abbe, Samy Bengio, Etai Littwin +1 more
2/12/2026

No official code found. Best implementation: eboix/relational-reasoning (8 stars, last commit 2024-04-16).

Abstract

We investigate the capabilities of transformer models on relational reasoning tasks. In these tasks, models are trained on a set of strings encoding abstract relations, and are then tested out-of-distribution on data that contains symbols that did not appear in the training dataset. We prove that for any relational reasoning task in a large family of tasks, transformers learn the abstract relations and generalize to the test set when trained by gradient descent on sufficiently large quantities of training data. This is in contrast to classical fully-connected networks, which we prove fail to learn to reason. Our results inspire modifications of the transformer architecture that add only two trainable parameters per head, and that we empirically demonstrate improve data efficiency for learning to reason.

View on arXivView PDF

Code Implementations(1)

Code for "When can transformers reason on abstract symbols?

81Shell, PythonOct 15, 20232 years ago

Similar Papers

Cite this paper

@article{boixadser2026when,
  title  = {When can transformers reason with abstract symbols?},
  author = {Enric Boix-Adserà and O. Saremi and Emmanuel Abbe and Samy Bengio and Etai Littwin and Josh Susskind},
  year   = {2026},
  eprint = {2310.09753},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2310.09753},
  journal = {ICLR 2023 2023}
}

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

Discussion