# Transformer architecture

Learn how the Transformer architecture uses attention to relate elements in a sequence and why an architecture is not a finished product.

Canonical URL: https://thecompanybrain.com.br/en/glossary/transformer-architecture
Authors: Luiz Gardelin
Updated: 2026-11-14T18:37:31.173Z

The Transformer architecture is a way of organizing a neural network to transform sequences of representations into other sequences. Its characteristic component is self-attention, a mechanism that combines information from different elements within the same sequence. The name describes a [model architecture](/en/glossary/model-architecture), rather than an application, an assistant brand, or a guarantee of performance. [Source: Google, Transformer](https://developers.google.com/machine-learning/glossary#Transformer).

## What attention does

Text can be represented as a sequence of tokens, each associated with numerical values. In a self-attention layer, the representation of an element is updated using the relevance of other elements in the sequence. Attention is a calculation of relationships between representations. The name does not mean that the system pays attention consciously. [Source: Google, self-attention](https://developers.google.com/machine-learning/glossary#self-attention).

As a hypothetical illustration, consider “The team received the request and then forwarded it.” Interpreting “it” requires relating the pronoun to other elements in the sentence. Self-attention provides a mechanism for combining this kind of information; the illustration does not claim that every model will resolve every ambiguity correctly.

A Transformer may contain an encoder, a decoder, or both. Broadly, these components transform representations of the input and produce representations for the output. Naming the architecture therefore does not, by itself, establish whether the model was developed for classification, generation, or another task. [Source: Google, Transformer components](https://developers.google.com/machine-learning/glossary#Transformer).

## Hypothetical organizational decision

An organization compares two solutions for organizing written requests. Both describe themselves as using Transformers. One may have been prepared to classify requests, while the other generates summaries. The team would need to evaluate each task using its own examples rather than choose on the basis of the architecture's name.

Architecture contributes to a model's operation, but it does not determine every [training](/en/glossary/model-training) choice, the data available, or the controls in the application. Understanding the term helps explain the technical basis of many [large language models](/en/glossary/large-language-model). A decision about use still requires examining demonstrated behavior, the information being used, and the solution's limits in the intended process.

## Sources

- [Machine Learning Glossary: Transformer](https://developers.google.com/machine-learning/glossary#Transformer): Conceptual explanation of attention and encoder/decoder variants, without generalizing one implementation to the entire family.
- [Machine Learning Glossary: Self-attention](https://developers.google.com/machine-learning/glossary#self-attention)
- [Machine Learning Glossary: Attention](https://developers.google.com/machine-learning/glossary#attention)

## Related reading

- [Artificial neural network](/en/glossary/artificial-neural-network)
- [Large language model](/en/glossary/large-language-model)
- [Token](/en/glossary/token)
- [AI hallucination](/en/glossary/ai-hallucination)
- [AI prompt](/en/glossary/ai-prompt)
- [Algorithmic bias](/en/glossary/algorithmic-bias)
