AI GLOSSARY · AI CONCEPTS
Transformer
Definition
A Transformer is an attention-based neural network architecture introduced in 2017. The original design uses no recurrent or convolutional layers; later variants can combine attention with those mechanisms. BERT uses a bidirectional Transformer encoder.
Also called: transformers, transformer AI, transformers AI, AI transformer, transformer model, transformer architecture.
In plain language
In machine learning, a Transformer is a neural network design built around attention. The original 2017 architecture used attention rather than recurrence or convolutions to connect positions in a sequence. It still contains feed-forward layers. Later variants include segment recurrence (Transformer-XL) or convolutional layers (Conformer). BERT uses a Transformer encoder for language understanding.
Technical definition
Vaswani and colleagues proposed the Transformer in 2017 (arXiv v1, 12 June 2017) as a network architecture based solely on attention mechanisms, dispensing with recurrence and convolutions. Section 3.1 of the paper describes encoder and decoder stacks of identical layers. The architecture uses multi-head attention, position-wise feed-forward networks, residual connections with layer normalization, and positional encodings. In the decoder, self-attention is modified to prevent positions from attending to subsequent positions; the paper calls this masking. BERT uses a multi-layer bidirectional Transformer encoder with a masked language model pre-training objective.
Worked examples in this catalogue
Catalogue examples point at a skill, guide or coding tool listed on this site, with what to run and what you see. An example marked illustrative describes the item from its own documentation; it was not executed for this page. Platform Scores are our assessment under a published method, not a safety guarantee.
Guide · Illustrative, not executed
What Is an LLM? The Facts Agent Users Need
- What you see
- The guide's worked Transformer example contrasts source-side attention, decoder causal masking and BERT's masked-token objective.
- Why it exercises the concept
- Use the worked example to distinguish an architecture from a training objective; its words stand in for tokens.
The original Transformer was proposed in the 2017 paper Attention Is All You Need. Its architecture uses attention to connect sequence positions, without recurrent or convolutional layers; that exclusion does not describe every later Transformer variant.
How it shows up when you use agents
The linked guide contains a worked example of the original Transformer encoder and decoder, followed by a BERT masked-token example. It contrasts the attention connections that a causal mask blocks with the input token that a masked-language-model exercise hides. The example is illustrative, not an execution of either model.
Common confusions
- Every position versus allowed positions. In the original paper, each position in the encoder can attend to all positions in the previous encoder layer, while the decoder is modified to prevent positions from attending to subsequent positions.
- Transformer versus BERT's training objective. BERT uses a bidirectional Transformer encoder and is pre-trained with a masked language model rather than a traditional left-to-right language model.
- Transformer versus LLM. The large-language-model entry lists BERT-style masked bidirectional pretraining and recurrent architectures such as RWKV among LLM designs.
Related terms
Show all 41 related terms
Terms that mention Transformer
45 terms mention this one
- AI art
- AI music
- AI translator
- Attention mechanism
- Autoregressive model
- AWQ quantization
- Beam search
- BERT
- Convolutional neural network (CNN)
- Diffusion transformer (DiT)
- Encoder-decoder
- Feature engineering
- FlashAttention
- FLUX (image model)
- Gemma
- GPT (generative pre-trained transformer)
- GPTQ
- Imagen (Google)
- KV cache
- Large language model (LLM)
- Llama (Meta)
- LoRA (low-rank adaptation)
- Long short-term memory (LSTM)
- Mixture of experts (MoE)
- Model hub
- Multi-head attention
- Natural language processing (NLP)
- Natural language understanding (NLU)
- Neural network
- Positional encoding
- Principal component analysis (PCA)
- Quantization
- Recurrent neural network (RNN)
- Sequence-to-sequence model (seq2seq)
- Small language model (SLM)
- smolagents
- Sparse attention
- Speculative decoding
- Text generation
- Text generation web UI
- Top-k sampling
- Transformers library (Hugging Face)
- AI video generation
- Vision transformer (ViT)
- Whisper (OpenAI)
Guides that mention Transformer
More in AI concepts
Sources
- Attention Is All You Need — Vaswani et al.; first submitted 2017, arXiv v7, 2023, arXiv (accessed 2026-11-24)
- BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding — Devlin et al.; arXiv v2, 2019, arXiv (accessed 2026-11-24)
- Transformer-XL: Attentive Language Models Beyond a Fixed-Length Context, Dai et al. (arXiv) (accessed 2026-11-24)
- Conformer: Convolution-augmented Transformer for Speech Recognition, Gulati et al. (arXiv) (accessed 2026-11-24)
Definitions are written by Skill Almanac from these sources and were checked against them on 2026-11-24. Wikipedia is never the only source.
Review record
Last verified
Drafted by Claude and Codex (automated drafting); sources and example targets checked by Independent automated source review (OpenAI Codex); not human peer review on 2026-11-24. Last verified .
Change log (19)
- : First version.
- : Initial reference entry with scoped definitions, primary references and illustrative examples.
- : Replaced with Codex's final reviewed version from the staged-approval cohort; earlier history kept above. Still a draft: not indexable.
- : Accuracy pass: short and opening now place the Transformer in machine learning, using wording from the arXiv paper and its subject listing.
- : Accuracy pass: removed unsourced claims about what a Transformer does or does not tell you (chatbot, text generation, correctness).
- : Accuracy pass: replaced 'causal mask' with the paper's word 'masking' and narrowed the decoder claim to the paper's sentence.
- : Accuracy pass: narrowed encoder and decoder stacks to section 3.1 and 'encoder-only BERT' to the page's 'bidirectional Transformer encoder'.
- : Accuracy pass: removed the editor note about search volume from reader-facing text.
- : Accuracy pass: guide example now says only what the guide covers (model versus agent) and that it does not discuss Transformers.
- : Accuracy pass: skill example now mirrors the catalog one-liner (open-weight model on a given GPU, Mac or PC).
- : Accuracy pass: removed own-reasoning lines (attention versus correctness, other meanings, agent advice) that no cited source supports.
- : US spelling; per-example caveats removed (the page states once that examples are illustrative); related terms filled. No verified claim changed.
- : Replaced the tangential catalog illustration with a sourced architecture example in the companion guide; exact revision review pending.
- : Codex closed the four reported factual/example/link findings after source and rendered checks; owner approval and publication remain separate.
- : Codex internal correction check is recorded separately; independent review remains pending and is not implied by that check.
- : Codex bdaf816 patch applied (guide-based worked example); plain section now says solely attention concerns connecting positions and feed-forward layers remain. Verification reset to pending.
- : Independent reviewer required scoping no-recurrence/no-convolution wording to the original architecture; added Transformer-XL and Conformer primary counterexamples. Re-review pending.
- : Independent automated factual and example-source review completed; exact-version technical release checks recorded separately. Publication remains disabled.
- : Automated review completed; approved for the staged public release. Search indexing is controlled by the release configuration.