The transformer is the neural-network architecture introduced in 2017’s Attention Is All You Need and used by essentially every modern large language model. Its central component is attention, which lets every token exchange information with every other token in parallel.

A transformer stacks many attention layers, each refining the embeddings into more context-aware representations, and finishes by producing a probability distribution over the next token (shaped by softmax and temperature).

Its parallelism is what made training at massive scale practical, the reason LLMs exist. Explore it in How a transformer thinks.