Improving Transformer Models by Reordering their Sublayers

By Ofir Press, Noah A. Smith, Omer Levy. 2019

99 citations recorded by the source corpus.

Multilayer transformer networks consist of interleaved self-attention and feedforward sublayers. Could ordering the sublayers in a different pattern lead to better performance? We generate randomly ordered transformers and train them with the language modeling objective. We observe that some of these models are able to achieve better performance than the interleaved baseline, and that those successful variants tend to have more self-attention at the bottom and more feedforward sublayers at the top. We propose a new transformer pattern that adheres to this property, the sandwich transformer, and show that it improves perplexity on multiple word-level and character-level language modeling benchmarks, at no cost in parameters, memory, or training time. However, the sandwich reordering pattern does not guarantee performance gains across every task, as we demonstrate on machine translation models. Instead, we suggest that further exploration of task-specific sublayer reorderings is needed in order to unlock additional gains.

Subfields: Artificial Intelligence, Model Architectures, Optimization & Training

How researchers see this paper

The researchers whose trusted networks rank it highest, strongest advocate first. Every researcher gets a different order.

In Artificial Intelligence

  1. Noah A. Smith
  2. Luke S. Zettlemoyer
  3. Jonathan Berant
  4. Mohit Bansal
  5. Percy Liang
  6. Yejin Choi
  7. Graham Neubig
  8. Michael Lewis

In Model Architectures

  1. Yoav Levine
  2. Michael Lewis
  3. Noah A. Smith
  4. Ofir Press
  5. Mor Geva
  6. Daniel Jannai
  7. Amnon Shashua
  8. Noam Wies

In Optimization & Training

  1. Michael Lewis
  2. Ofir Press
  3. Noah A. Smith
  4. Szymon Migacz
  5. Alex Fit-Florea
  6. Damian Pascual
  7. Yoav Levine
  8. Roger Wattenhofer

Citations in the corpus