A transformer is a neural-network architecture for sequence modeling that uses attention—especially self-attention—instead of recurrence. It became a foundation for large language models (LLMs) and modern generative AI. section 1.2 section 1.23
Attention assigns greater weight to information that matters for interpreting a sequence. Self-attention repeatedly builds a new representation for each word using the whole input, allowing the model to capture long-term dependencies while computing representations in parallel. section 1.2
Transformers changed language modeling in several connected ways:
- They discarded the lengthy sequential steps used by earlier architectures, making processing faster and more parallelizable. section 1.2
- They made it practical to train on much larger quantities of data, helping launch the modern LLM era. section 1.2
- They support general-purpose models such as GPT, which can be fine-tuned for tasks including translation, sentiment analysis, classification, and text generation. section 1.2
Following the important words
In “That cat chased a mouse, but it didn’t catch it,” attention can emphasize “cat” and “mouse” when interpreting “it,” rather than treating every word as equally relevant. The same mechanism supported strong early results on English-to-German and English-to-French translation. section 1.2
Figure 1.2 The distribution of attention for the word “it” in different contexts.
Shows how attention for the word “it” changes across contexts, making the mechanism’s focus on relevant sequence information concrete. section 1.2
The architecture enabled major gains, but systems built from it can still encode bias, hallucinate, and require substantial computational resources. Its capabilities therefore do not remove the need for evaluation and responsible deployment. section 1.23



























