HackerPapers

arXiv:1807.03819cs.CL

Universal Transformers

Mostafa Dehghani, Stephan Gouws, Oriol Vinyals, Jakob Uszkoreit, Łukasz Kaiser

Abstract

Recurrent neural networks (RNNs) sequentially process data by updating their state with each new data point, and have long been the de facto choice for sequence modeling tasks. However, their inherently sequential computation makes them slow to train. Feed-forward and convolutional architectures have recently been shown to achieve superior results on some sequence modeling tasks such as machine translation, with the added advantage that they concurrently process all inputs in the sequence, leading to easy parallelization and faster training times. Despite these successes, however, popular feed-forward sequence models like the Transformer fail to generalize in many simple tasks that recurrent models handle with ease, e.g. copying strings or even simple logical inference when the string or formula lengths exceed those observed at training time. We propose the Universal Transformer (UT), a parallel-in-time self-attentive recurrent sequence model which can be cast as a generalization of the Transformer model and which addresses these issues. UTs combine the parallelizability and global receptive field of feed-forward sequence models like the Transformer with the recurrent inductive bias of RNNs. We also add a dynamic per-position halting mechanism and find that it improves accuracy on several tasks. In contrast to the standard Transformer, under certain assumptions, UTs can be shown to be Turing-complete. Our experiments show that UTs outperform standard Transformers on a wide range of algorithmic and language understanding tasks, including the challenging LAMBADA language modeling task where UTs achieve a new state of the art, and machine translation where UTs achieve a 0.9 BLEU improvement over Transformers on the WMT14 En-De dataset.

arXiv comments
Published at ICLR2019
Journal reference
DOI
Subjects
cs.CLComputation and Language cs.LGMachine Learning stat.MLMachine Learning (Statistics)

On Hacker News

Linked by 7 identifiable commenters in 7 comments across 6 threads, from Nov 2018 to Dec 2025.

Comments linking this paper, per year.

Discussed in comments6 threads

    • Thanks, this was helpful! Reading the seminal paper[0] on Universal Transformers also gave some insights: > UTs combine the parallelizability and global receptive field of feed-forward sequence models like the Transformer with the recurrent inductive bias of RNNs. Very…

      omneityView on HNParent context

    • Right. There should really be a vanilla Transformer baseline. With recurrence: The idea has been around: https://arxiv.org/abs/1807.03819 There are reasons why it hasn't really been picked up at scale, and the method tends to do well on synthetic tasks.

      shawntanView on HNParent context

    • Very cool to see the effectiveness of recurrence on ARC. For those interested in recurrence, here are other works that leverage a similar approach for other types of problems: Language modeling: Scaling up Test-Time Compute with Latent Reasoning: A Recurrent Depth Approach…

      atrudeauView on HNParent context

    • TL;DR the “high” “low” level modules don’t matter much, and the rest of the architecture is similar to Universal Transformers https://arxiv.org/abs/1807.03819

      edView on HNParent context

    • In case you find Attention (and specially transformers) interesting I have some saved links introducing the topic: http://www.peterbloem.nl/blog/transformers https://nostalgebraist.tumblr.com/post/185326092369/the-tran...…

      kuuView on HNParent context

    • - Neural turing machines: https://arxiv.org/abs/1410.5401 - Universal transformers: https://arxiv.org/abs/1807.03819 These are just 2 of most well known.

      solomatovView on HNParent context

Submitted to Hacker News

Connected through shared HN threads, not inferred similarity or a recommendation.