The Devil is in the Detail: Simple Tricks Improve Systematic Generalization of Transformers

Róbert Csordás, Kazuki Irie, Jürgen Schmidhuber
8/26/2021
165 citations
cs.LGcs.AIcs.NE
transformer-attention

Official code: RobertCsordas/transformer_generalization (65 stars, Python, MIT, PyTorch, last commit 2022-12-16).

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.

Show full abstract

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.

View on arXivView PDF

Code Implementations(1)

PyTorchMIT

The official repository for our paper "The Devil is in the Detail: Simple Tricks Improve Systematic Generalization of Transformers". We significantly improve the systematic generalization of transformer models on a variety of datasets using simple tricks and careful considerations.

6514Python, ShellAug 25, 20213 years agoMIT
deep-learninggeneralizationmachine-learningpaperpytorch+2 more

Similar Papers

Cite this paper

@article{csords2021devil,
  title  = {The Devil is in the Detail: Simple Tricks Improve Systematic Generalization of Transformers},
  author = {Róbert Csordás and Kazuki Irie and Jürgen Schmidhuber},
  year   = {2021},
  eprint = {2108.12284},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2108.12284}
}

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

Discussion