The Devil is in the Detail: Simple Tricks Improve Systematic Generalization of Transformers
Róbert Csordás, Kazuki Irie, Jürgen Schmidhuber
Abstract
Recently, many datasets have been proposed to test the systematic generalization ability of neural networks. The companion baseline Transformers, typically trained with default hyper-parameters from standard tasks, are shown to fail dramatically. Here we demonstrate that by revisiting model configurations as basic as scaling of embeddings, early stopping, relative positional embedding, and Universal Transformer variants, we can drastically improve the performance of Transformers on systematic generalization. We report improvements on five popular datasets: SCAN, CFQ, PCFG, COGS, and Mathematics dataset. Our models improve accuracy from 50% to 85% on the PCFG productivity split, and from 35% to 81% on COGS. On SCAN, relative positional embedding largely mitigates the EOS decision problem (Newman et al., 2020) , yielding 100% accuracy on the length split with a cutoff at 26. Importantly, performance differences between these models are typically invisible on the IID data split. This calls for proper generalization validation sets for developing neural networks that generalize systematically. We publicly release the code to reproduce our results 1 .
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
48 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- Going Beyond Linear Transformers with Recurrent Fast Weight Programmers cites The Neural Data Router: Adaptive Control Flow in Transformers Improves Systematic Generalization
- The Neural Data Router: Adaptive Control Flow in Transformers Improves Systematic Generalization cites Going Beyond Linear Transformers with Recurrent Fast Weight Programmers
- Going Beyond Linear Transformers with Recurrent Fast Weight Programmers cites Linear Transformers Are Secretly Fast Weight Programmers
- Making Transformers Solve Compositional Tasks cites COGS: A Compositional Generalization Challenge Based on Semantic Interpretation
- Making Transformers Solve Compositional Tasks cites Measuring Compositional Generalization: A Comprehensive Method on Realistic Data
- COGS: A Compositional Generalization Challenge Based on Semantic Interpretation cites Measuring Compositional Generalization: A Comprehensive Method on Realistic Data
- Choose a Transformer: Fourier or Galerkin cites Linear Transformers Are Secretly Fast Weight Programmers
- The Impact of Positional Encoding on Length Generalization in Transformers cites Making Transformers Solve Compositional Tasks
- The Neural Data Router: Adaptive Control Flow in Transformers Improves Systematic Generalization cites Making Transformers Solve Compositional Tasks
- The Neural Data Router: Adaptive Control Flow in Transformers Improves Systematic Generalization cites Measuring Compositional Generalization: A Comprehensive Method on Realistic Data
Cited by top-tier papers48
- Choose a Transformer: Fourier or GalerkinShuhao CaoNeurIPS 2021 · 516 citations
- The Impact of Positional Encoding on Length Generalization in TransformersAmirhossein Kazemnejad, Inkit Padhi, Karthikeyan Natesan Ramamurthy, Payel Das et al.NeurIPS 2023 · 444 citations
- Going Beyond Linear Transformers with Recurrent Fast Weight ProgrammersKazuki Irie, Imanol Schlag, Róbert Csordás, Jürgen SchmidhuberNeurIPS 2021 · 101 citations
- Making Transformers Solve Compositional TasksSantiago Ontañón, Joshua Ainslie, Zachary Fisher, Vaclav CvicekACL 2022 · 87 citations
- The Neural Data Router: Adaptive Control Flow in Transformers Improves Systematic GeneralizationRóbert Csordás, Kazuki Irie, Jürgen SchmidhuberICLR 2022 · 70 citations
Builds on18
- Deep Double Descent: Where Bigger Models and More Data HurtPreetum Nakkiran, Gal Kaplun, Yamini Bansal, Tristan Yang et al.ICLR 2020 · 1,108 citations
- Measuring Compositional Generalization: A Comprehensive Method on Realistic DataDaniel Keysers, Nathanael Schärli, Nathan Scales, Hylke Buisman et al.ICLR 2020 · 401 citations
- Linear Transformers Are Secretly Fast Weight ProgrammersImanol Schlag, Kazuki Irie, Jürgen SchmidhuberICML 2021 · 394 citations
- Improving Transformer Optimization Through Better InitializationXiao Shi Huang, Felipe Pérez, Jimmy Ba, Maksims VolkovsICML 2020 · 181 citations
- COGS: A Compositional Generalization Challenge Based on Semantic InterpretationNajoung Kim, Tal LinzenEMNLP 2020 · 149 citations
Related papers
- Data Factors for Better Compositional GeneralizationXiang Zhou, Yichen Jiang, Mohit BansalEMNLP 2023 · 2 citations
- CAPE: Encoding Relative Positions with Continuous Augmented Positional EmbeddingsTatiana Likhomanenko, Qiantong Xu, Gabriel Synnaeve, Ronan Collobert et al.NeurIPS 2021 · 74 citations
- Improve Transformer Models with Better Relative Position EmbeddingsZhiheng Huang, Davis Liang, Peng Xu, Bing XiangEMNLP Findings 2020 · 114 citations
- Harnessing Dataset Cartography for Improved Compositional Generalization in TransformersOsman Batur Ince, Tanin Zeraati, Semih Yagcioglu, Yadollah Yaghoobzadeh et al.EMNLP Findings 2023 · 2 citations
- Language Models Need Inductive Biases to Count InductivelyYingshan Chang, Yonatan BiskICLR 2025
