How Do Transformers Learn to Represent Symmetries?

Eduardo Santos-Escriche, Valerie Engelmayer, Ya-Wei Eileen Lin, Stefanie Jegelka

Abstract

Training Transformer-based architectures with finite data augmentation has become an increasingly popular approach in geometric machine learning. Despite its empirical success, the interplay between the Transformer architecture, invariance to different symmetries, and augmentation budgets remains underexplored. In this paper, we study the ability of a vanilla Transformer to learn various symmetries through finite data augmentation for point cloud datasets. We identify an ordering of increasing *learnability* across the following symmetry groups: *(i)* non-angle-preserving symmetries, *(ii)* angle-preserving symmetries, and *(iii)* base angle-preserving subgroups, such as translation, rotation, and scale. For the base angle-preserving groups, we further investigate the Transformer's extrapolation behavior and conduct a structural analysis of the trained models, allowing us to identify interpretable mechanisms that induce invariance. Finally, we extend our analysis to equivariant functions and show that the detected mechanisms for approximate invariance can also provide a key building block for learned equivariance. Our implementation is available at [https://github.com/valerie-engel/transformers_learn_symmetries](https://github.com/valerie-engel/transformers\_learn\_symmetries).
BibTeX
@inproceedings{santosescriche2026how,
  author = {Eduardo Santos-Escriche and Valerie Engelmayer and Ya-Wei Eileen Lin and Stefanie Jegelka},
  title = {{How Do Transformers Learn to Represent Symmetries?}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=nBGsp2c8X6},
}
Figure