The old path
Recurrent state carried information through the sequence one position at a time.
Interactive AI guide
Recurrent sequence models processed positions in order. Earlier attention systems improved translation by letting a recurrent decoder select different parts of the input, but recurrence still organized the computation.
Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan Gomez, Lukasz Kaiser, and Illia Polosukhin asked a sharper question: could attention itself carry the sequence model?
Their 2017 paper replaced sequence-aligned recurrence and convolution with stacked attention and feed-forward blocks. Its big model reached 28.4 BLEU on English-to-German translation after 3.5 days on eight P100 GPUs.
Recurrent state carried information through the sequence one position at a time.
Every position could compare itself directly with every available position.
The Transformer began as an encoder-decoder translation model, not a chatbot.
Attention did not begin in 2017. Bahdanau, Cho, Bengio, and others had already used learned attention with recurrent models. The Transformer made attention the central routing computation.
One position compares a query with every key, then gathers the corresponding values.
The query describes what the current position is looking for.
Dot products compare that query with every available key.
Softmax turns signed scores into positive weights that sum to one.
The values are blended according to those weights.
Attention is not the entire Transformer. A complete block also needs feed-forward layers, residual paths, normalization, positional information, and learned projections.
Interactive attention lab
Choose a query, reveal its scores, and watch context become a weighted mixture.
Choose the token that will ask for context.
For cross, river is the strongest match. Every available value still contributes to the mixture.
What you are seeing: one attention head with tiny hand-set two-dimensional vectors. They make every calculation inspectable. Real models learn much larger projections, and individual coordinates do not have guaranteed human-readable meanings.
Masking happens before softmax. A causal decoder replaces future scores with minus infinity, so their weights become zero. During generation, the model still produces one new token after another.
The original model paired attention with position, residual paths, normalization, and per-token transformations.
Self-attention alone does not know which token came first.
Each head uses separate learned projections and can route different relationships.
Decoder positions cannot inspect output tokens that have not been generated.
Attention mixes positions. The following network transforms each position independently.
Recurrence, learned alignment, deep representations, residual learning, and accelerated matrix operations all shaped the result.
Backpropagation assigns credit through a trainable stack.
LSTM improves learning across longer sequences.
Encoder-decoder networks scale neural translation.
A recurrent decoder searches the source for relevant positions.
Data, compute, and end-to-end learning converge at scale.
The Transformer removes sequence-aligned recurrence and convolution.
Encoder-only and decoder-only Transformers become foundation-model families.
The 2017 blueprint became a family of encoders, decoders, multimodal systems, and large pretrained models.
Each position could build its next representation from the parts of the sequence most useful to it.
The mechanism, historical distinctions, architecture details, and modern bridge in this guide come from these primary publications.
The selected lineage is intentionally compact. It does not represent every researcher, architecture, dataset, training method, hardware advance, or critique that shaped attention-based machine learning.