1. Home
  2. Glossary
  3. Transformer
AI glossary · Models & training

Transformer

Transformer: The transformer is the neural network architecture behind nearly all modern language models. Its key idea, called attention, lets the model weigh every word in a passage against every other word, so it can track meaning across long stretches of text.

Before transformers, language models read text one word at a time and struggled to remember what came earlier in a sentence, let alone a document. The transformer, introduced by Google researchers in the 2017 paper 'Attention Is All You Need,' processes all the words at once and learns which ones matter to each other.

That mechanism is called attention. When the model reads 'the invoice was late because it was misrouted,' attention is what connects 'it' back to 'invoice' rather than 'late.' Stack dozens of attention layers and the model can follow references, tone, and structure across thousands of words.

Transformers also train efficiently on GPUs because the work can be done in parallel, which is what made models with billions of parameters affordable. The T in GPT stands for transformer, and the same design has been adapted for images, audio, and protein structures.

Example at work

When you paste a long customer email thread into an assistant and ask what the customer actually wants, the transformer's attention layers are what let the model connect a complaint on page one to a concession offered on page three, and produce a summary that reflects the whole exchange rather than the last message.

Why it matters

You will never configure a transformer yourself, but knowing the term explains why today's AI can handle long documents and why it is sensitive to how you structure a prompt. Clear headings, explicit references, and putting the key instruction where the model cannot miss it all play to how attention works.

Related terms