Attention helps a language model focus on the most relevant parts of an input sequence instead of treating every word equally. In transformer architectures, it supports context-sensitive processing by considering both words and their positions. section 1.6
Answering a geography question
For “What is the capital of Italy?”, attention gives greater weight to “Italy” than to “what” or “is”, helping the model predict “Rome.” The model still operates within a limited context window, such as GPT-3’s 2,048-token prompt limit. section 1.6
Figure 1.11 How a GPT architecture generates sentences
Use the architecture figure to trace how attention contributes to GPT sentence generation. section 1.6



























