Case & CodeA FIELD GUIDE TO AI
Start learning
Beginner

Transformer

Also: transformers

In plain words

The design most modern language models use. Its trick is letting every word in a passage look at every other word to work out what matters.

The fuller definition

A transformer is a neural-network architecture built around attention mechanisms and other layers that process relationships among elements in a sequence.

A small neural-network schematic
Input valuesLearned transformationsOutputs

Lines represent computational connections with learned values. This tiny diagram illustrates a neural network; a transformer or mixture-of-experts model has additional structures not shown here.

A concrete example

A language model uses surrounding tokens to help represent an ambiguous word before predicting what follows.

The distinction that matters

Not every transformer has the same design, context length, or supported input types.

Related terms

Where it is taught

What actually happens when you ask AI a question?

Source and further reading

Google · Machine Learning Glossary

The definition and example are written for this library. The link gives background, official documentation or legal authority as labelled. Legal scope depends on the jurisdiction and current text; product features depend on release and settings.

Lessons, terms, practical guides and sources ESC