The short version
- The context window is everything the model can see at one time: your instructions, your documents and the conversation so far.
- You pay for every token in and out. Larger inputs cost more and take longer.
- More text is not better. Models pay less attention to the middle of long inputs, so choose what goes in.
The idea
A model has no memory between requests. Each time, it sees only its context window: the system instructions, the user’s message, any documents or tool results you add, and its own answer so far. The window has a maximum size, measured in tokens. Current models offer windows from about one hundred thousand tokens up to a million or more.
Two limits matter beyond size. First, a model has a knowledge cutoff. It knows nothing after its training date unless you supply it. Second, attention is uneven. Research on long inputs found that models use information at the start and end of the context better than information in the middle. This effect is known as lost in the middle.
Picture a desk. The model can only use the papers on the desk. A bigger desk helps, but a desk piled with every file in the office makes it harder to find the one page that matters.
- Instructions
- Your documents and data
- Conversation so far
- Space left for the answer
Cost follows the same logic. Providers charge per token for input and for output, and output usually costs several times more than input. A request that sends 50 pages of text for every question costs far more than one that sends the two right paragraphs.
An example
A service team builds an assistant for warranty questions. Version one pastes the full 80-page policy into every request. Answers are slow, the bill is high, and the model sometimes misses a clause on page 40. Version two finds the three most relevant sections and sends only those. Cost falls, speed improves, and accuracy goes up because the right text is easy to find.
Common mistakes
- Buying the largest context window and then filling it with everything.
- Forgetting that long chat histories also fill the window.
- Putting the most important instruction in the middle of a long prompt.
- Ignoring the knowledge cutoff when asking about recent events.
What to do this week
- Ask your team for the average input size, in tokens, of your main AI feature.
- Check how much of that input is used in the answer. Remove what is not.
- Move the key instructions to the start, and repeat the most important one at the end.
The terms, in plain language
| Term | What it means |
|---|---|
| Context window | All the text the model can see in one request |
| Token budget | How you divide the window between instructions, data and the answer |
| Knowledge cutoff | The date after which the model has no training knowledge |
| Lost in the middle | The model uses the start and end of long inputs better than the middle |
Section 1.3 of the AI Engineering Guide · Last reviewed November 2026




