Transformer

Attention & transformers · neural · 2017 · text · images · speech · multimodal

What it is

Stacked blocks of multi-head self-attention plus a position-wise feed-forward network, with residual connections and normalization.

When to use it

The substrate for essentially all frontier models — language, vision, audio, protein, time series.

Caveats

Self-attention cost grows quadratically with sequence length, and the architecture has few built-in assumptions, so it usually needs large datasets or pretraining to beat simpler models. Training is sensitive to learning-rate warm-up, normalization placement and initialization.

Key ideas

  • Permutation-invariant, so positional information must be injected separately
  • The FFN holds most of the parameters; attention does the mixing
  • Encoder-only, decoder-only and encoder-decoder are the three layouts

Related architectures

Original paper

Attention Is All You Need (2017, arXiv)

Lessons that cover it

Browse all 198 architectures

The architecture landscape, in one place.

Two things get called “ML architecture”: the classical statistical model families, and the neural network wirings. Both are here, tagged by what they are and what data they eat.

Start from your problem

Architectures

0 shortlisted