Skip to content

Transformer

Also called: transformer architecture, transformer model, transformers

Published:

Where did the Transformer come from?

Vaswani and colleagues introduced the Transformer in the 2017 paper "Attention Is All You Need" [1]. At the time, the leading sequence transduction models were built on complex recurrent or convolutional neural networks. The new architecture dropped recurrence and convolution altogether and relied on attention alone [1]. On the WMT 2014 English-to-German translation task it reached 28.4 BLEU while taking far less time to train [1].

How does a Transformer work?

It has two halves. An encoder turns the input text into an intermediate representation, and a decoder turns that representation into useful text [3]. Self-attention asks, for each token, how much every other token in the input affects how this one should be read [3].

A 2017 Google Research post explains why that matters. A recurrent network reads text one word at a time, so linking two distant words takes many sequential steps; a Transformer needs only a small, constant number of steps and parallelises well on hardware such as GPUs and TPUs [2]. The post's example is the word "bank", which can mean a financial institution or a riverside. When the sentence mentions a river, the Transformer can connect "bank" to "river" in a single step and pick the right meaning [2].

Where are Transformers used?

Machine translation was the first target [1]. Today large language models are built on the architecture, and a full Transformer can contain hundreds of billions or even trillions of parameters [3].

Frequently asked questions

Who invented the Transformer?

It was proposed by Vaswani and colleagues, a team that included Google researchers, in the 2017 paper Attention Is All You Need.

Is a Transformer the same as a large language model?

No. The Transformer is the architecture; a large language model is a trained model built on it.

Sources

  1. Attention Is All You Need — arXiv
  2. Transformer: A Novel Neural Network Architecture for Language Understanding — Google Research
  3. LLMs: What's a large language model? — Google for Developers