Why can the same question produce a generic answer one moment and a useful one the next? Often, the difference is context: the information that tells a language model what situation it is responding to and which details matter most. section 3.1 section 3.1.1
At a basic level, language models generate text by predicting what comes next. To make that prediction, they use the words and details already available. Context therefore guides selection: it does not add new knowledge to the model, but helps it identify which of its knowledge is relevant to the request. section 1.2.2 section 3.1.1
From broad question to usable answer
“Tell me about electric cars” leaves the goal unclear. Adding context makes the request more specific: “I’m a first-time electric vehicle buyer deciding whether one suits my family. My budget is $30,000, I live in an apartment, cannot install a home charger, and have no prior knowledge.” The topic has not changed, but the response can now focus on an appropriate decision, constraints, and level of explanation. section 3.1 section 3.1.1
Useful prompt context commonly answers four questions:
- Who are you? State the perspective or role that shapes the answer, such as a first-time buyer or marketing manager. section 3.1.1
- What are you trying to achieve? Name the decision, task, or objective behind the request. section 3.1.1
- What constraints apply? Include limits such as budget, time, or available resources. section 3.1.1
- What do you already know? Indicate the knowledge level the explanation should assume. section 3.1.1
Context is one part of a well-structured prompt. The main point states the task, while the action specifies how the answer should be delivered, such as its format, audience, tone, length, or level of detail. Clear communication matters more than clever wording. section 3.1 section 3.5
Context also matters inside the model. Earlier sequential models such as RNNs carried information forward word by word, so early details could weaken in long inputs. Attention addresses this by letting a model focus directly on the earlier words most relevant to its current prediction. section 1.2.2 section 1.3
Figure 1.3 How attention selects relevant context. Instead of carrying context forward only step by step, attention allows a model to directly attend to the most relevant parts of the input. In this example, when predicting the word after “now it’s…,” the model assigns more weight to words such as “umbrella” and “at home,” making “raining” a more likely continuation.

The umbrella sentence shows the contrast: when completing “and now it’s…,” attention can give greater weight to “umbrella” and “at home,” making “raining” a stronger continuation. section 1.3
Good context improves relevance, not reliability by itself. Even a clear prompt can receive hallucinated, overconfident, biased, or otherwise unsuitable output, so treat responses as information to evaluate rather than unquestioned answers. section 3.5





























