PromptForge
AI Glossary

Models & architecture

Transformer

Also known as: transformers, self-attention

Definition

The transformer is the neural network architecture behind virtually all modern language models. Its key innovation is self-attention, which lets every token directly consider every other token in the input.

Introduced in 2017, the transformer replaced recurrent architectures that processed text sequentially. Self-attention allows the model to weigh relationships between all positions simultaneously, which both captures long-range dependencies better and parallelises efficiently on GPUs.

That parallelism is arguably the more consequential property: it made training on internet-scale data economically feasible, which is what enabled the capability jumps that followed.

Self-attention costs scale quadratically with sequence length, which is the fundamental reason context windows were historically small and why extending them is an active research area.

Related terms

Put this into practice

Understanding the term is step one. Our free courses and tools let you actually use it.