# Transformer

- **Canonical URL:** https://getaimath.com/dictionary/transformer/
- **Topics:** [LLM Fundamentals](https://getaimath.com/dictionary/category/llm-fundamentals/), [Transformer Architecture](https://getaimath.com/dictionary/category/transformer-architecture/)
- **Also called:** Transformer Architecture
- **Last updated:** 2026-11-25

## What is Transformer?

**In one sentence:** A Transformer is a type of neural network design that reads all the words in a passage at once and works out how they relate, using attention.

Older language models read one word at a time, like reading through a straw. Transformers look at the whole sentence together and decide which words matter most to each other. This makes them better at understanding meaning and much faster to train on powerful chips. The design was introduced in a 2017 paper called "Attention Is All You Need."

![How ChatGPT & Claude Talk: Super-Powered Autocomplete — Simple cartoon diagram showing a sentence chopped into Lego word blocks (tokens), an AI brain weighing the odds of the next word ("mat" 75%, "couch" 18%, "roof" 5%), and snapping "mat" onto the end of the sentence.](https://getaimath.com/diagrams/llm-fundamentals.png)
*Napkin Diagram (LLM Fundamentals): Language models don’t plan whole essays at once—they play a super-smart game of "guess the very next word" over and over.*

## What is an example of Transformer?

In "The cat sat because it was tired," a Transformer learns that "it" refers to "the cat."

## Why does Transformer matter?

Almost every modern LLM, including GPT, Claude and Gemini, is built on the Transformer.

## Related Concepts

- [Language Model](https://getaimath.com/dictionary/language-model/): A language model is an AI that learns how language works so it can predict or produce words and sentences.
- [GPT (Generative Pre-trained Transformer)](https://getaimath.com/dictionary/gpt-generative-pre-trained-transformer/): GPT stands for Generative Pre-trained Transformer, a family of language models by OpenAI that generate text after being pre-trained on huge amounts of data.
- [Self-Attention](https://getaimath.com/dictionary/self-attention/): Self-attention lets every word in a sentence look at every other word and decide which ones matter most for understanding it.
- [Multimodal Model](https://getaimath.com/dictionary/multimodal-model/): A multimodal model is an AI that can understand or create more than one kind of data, like text, images, audio and video.
- [Encoder](https://getaimath.com/dictionary/encoder/): An encoder is the part of a model that reads an input and turns it into a set of numbers that capture its meaning.
- [Attention Mechanism](https://getaimath.com/dictionary/attention-mechanism/): An attention mechanism is a way for a model to focus on the most useful parts of its input when producing each piece of output.

---
Source: The AI Math Dictionary (https://getaimath.com/dictionary/transformer/)
