Glossary

Transformer (AI Model Architecture)

A transformer model is the neural network design behind ChatGPT, Claude and Gemini. Here is how it works, in plain English, with a simple example.

A transformer model is a type of neural network that reads a whole sequence of text (or image patches, or audio) at once and works out how every piece relates to every other piece. It is the design behind almost every major AI chatbot today, including ChatGPT, Claude, Gemini and Llama. The "T" in GPT stands for transformer.

Google researchers introduced the architecture in a 2017 paper titled "Attention Is All You Need." It was built for translation, but it turned out to scale far better than anything before it.

Key takeaways

  • A transformer processes all the words in a passage in parallel, instead of one at a time.
  • Its core trick is self-attention, which lets each word "look at" the others to work out meaning.
  • Nearly every modern large language model is a transformer, and the design now powers image, audio and video models too.

How does a transformer model work?

First, the input is split into tokens, small chunks of text such as words or parts of words. Each token becomes a list of numbers that captures its meaning, and the model adds information about where it sits in the sentence.

Then the tokens pass through a stack of identical layers. Each layer does two jobs:

  1. Self-attention. Every token checks every other token and decides which ones matter for its meaning. You can read more in our entry on the attention mechanism.
  2. A feed-forward step. Each token's updated numbers go through a small neural network that refines them further.

Stack dozens of these layers and the model builds up a rich picture of the text. A chatbot then uses that picture to predict the most likely next token, adds it, and repeats.

Older designs, called recurrent networks, read text one word after another, like a person reading with a finger under each line. That made them slow to train and forgetful over long passages. Transformers read the whole page at once, which suits the graphics chips used to train AI.

A simple example

Take the sentence "The trophy didn't fit in the suitcase because it was too big." To know what "it" means, a model has to link "it" to "trophy" and to "big." A transformer's attention layers make exactly that kind of link, across any distance in the text.

Why do transformers show up in the news?

Almost every headline about a new AI model is really about a bigger or cleverer transformer. Labs compete on how many parameters their transformers have, how much text they can read at once, and how cheaply they run. Variants such as "mixture of experts," used in models like Meta's Llama 4, are tweaks to the basic transformer recipe rather than replacements for it.

Why It Matters

Knowing that nearly every major chatbot shares one blueprint should make you calmer about launch-day hype. Most new models are bigger, cheaper or better-tuned transformers, not a new kind of machine, so judge them on what they do for your work rather than on the announcement. The design also explains why hardware matters so much: transformers read text in parallel, which suits the graphics chips used to train AI. If an alternative such as state space models ever takes over, that will be real news.

Frequently asked questions

Is ChatGPT a transformer?

Yes. GPT stands for Generative Pre-trained Transformer. ChatGPT runs on a series of transformer models trained by OpenAI and then tuned to hold conversations.

Are there alternatives to the transformer?

Researchers are testing other designs, such as state space models, which aim to handle very long inputs more cheaply. Some newer models mix these with transformer layers. For now, though, the transformer remains the default choice for leading AI systems.

Researched and written by The AI Telegraph staff and checked against primary sources. See our editorial policy. Spotted an error? Tell us.