Transformer
Concept

Ashish Vaswani and his coauthors introduced the transformer in 2017, in a paper titled “Attention Is All You Need.” They dropped the approaches that machine translation models had relied on until then (recurrent and convolutional networks) and built the whole network on the attention mechanism. They tested the new architecture on English-to-German and English-to-French translation.
An example from Google’s Machine Learning Glossary shows how attention works. In the sentence “The animal didn’t cross the street because it was too tired,” a model processing the word “it” gives the most weight to the word “animal.” That weighting is how the model figures out what “it” refers to. A transformer stacks many layers that each use this kind of attention. Large language models, including GPT and Gemini, are built on this architecture.
In my articles
In my February 2025 article on generative AI, I compare transformers to a very attentive reader who remembers not just the last sentence but also earlier plot threads and can connect them. That comparison captures the attention mechanism well, because the model can reach back to distant words, not just neighboring ones. In the article, I name transformers alongside GANs as a foundation of generative AI.
Sources
Related articles
Related entries
Last checked:
All entriesLLM (large language model)
An LLM, or large language model, is a program that has been trained on vast amounts of text and can generate answers and other writing.
GAN (generative adversarial network)
A GAN, or generative adversarial network, is a pair of neural networks trained together. A generator creates new examples, and a discriminator judges whether they look real.
Generative AI
Generative AI is a kind of artificial intelligence that creates new content, such as text, images, music, speech, or video, in response to a prompt.