Definition
A transformer is the neural network architecture behind almost all modern large language models. Introduced by Google researchers in 2017 in the paper "Attention Is All You Need", it processes a whole sequence of words at once and uses a mechanism called attention to decide how much each word should influence the interpretation of every other word. That design trains efficiently on modern hardware, which is why it scaled to today's model sizes.
You will never configure a transformer in a boardroom, but it explains behaviour you will notice. Because a transformer attends to everything in its input, the wording and order of a prompt matter. Because it processes tokens, cost and speed depend on how much text you send. Because attention has a fixed size, every model has a context window. The T in GPT stands for transformer, and it is inside Claude, Gemini and the open-weight models too.
Since 2017 the transformer has been refined rather than replaced: variants that cut memory use, mixture-of-experts designs that activate only part of the network per token, and hybrids that mix in other layer types. Alternatives exist and are studied actively, but as of 2026 the transformer remains the dominant architecture. The misconception is that the architecture is the moat. Data, training recipe and post-training matter as much.
In practice
When your support assistant answers a customer question by pulling the right detail from a 40-page policy pasted into the prompt, that is transformer attention at work, linking the question to the relevant paragraph.
Why it matters
Transformers are why AI improved so fast after 2018. Understanding that they work on tokens and attention helps you understand pricing, context limits and why prompt wording changes results.
Frequently asked questions
- What does attention mean in a transformer?
- Attention is a mechanism that lets the model weigh how relevant each part of the input is to each other part. When processing the word "it" in a sentence, attention helps the model decide which earlier noun "it" refers to. Stacked over many layers, this builds rich representations of meaning.
- Are all large language models transformers?
- Nearly all production models in 2026 are transformers or close variants, including the GPT, Claude, Gemini, Llama, Qwen and Mistral families. Research into alternative architectures continues, and some hybrid designs are in use, but the transformer remains the standard.