HASZB_AIHASZB_AI

Search across courses, lessons, glossary terms, prompts and tools.

Lab 02

Context Window Lab

Everything the model can see at once — instructions, history, documents, your question — shares one budget. Context is working space, not memory.

Conceptual model. Token costs here are representative round numbers, and the window sizes are illustrative scales rather than the limits of any particular product. The eviction behaviour is a simplification: real systems often summarise dropped turns instead of discarding them.

Window

Used3,890 / 4,096

Over by 54 tokens — 1 block dropped

What is in the window

  • System instructions320 tokensalways sent

    Who the assistant is and the rules it follows. Re-sent every single turn.

  • Conversation turn260 tokensdropped

    One exchange you have already had. The oldest are the first to go.

  • Conversation turn310 tokens

    One exchange you have already had. The oldest are the first to go.

  • Attached document2,400 tokens

    A file you pasted or uploaded, in full.

  • Your question60 tokensalways sent

    The thing you actually asked. Always sent.

  • Room for the answer800 tokensalways sent

    Output shares the window. If you fill it completely, there is nowhere for a reply to go.

Add to the window

Depth

Think of the window as a desk. Everything the model can consult has to be on the desk at once — and when the desk is full, something gets pushed off the edge.

Reading the result

What just happened
Everything you added comes to 4,150 tokens, more than the 4,096 available. 1 block never reached the model at all.
Why it matters
The window is the model's whole world for one request. It has no memory of anything outside it. When earlier messages drop out, the model is not forgetting — it was simply never shown them.
Where you meet this
This is why a long chat starts contradicting itself, why pasting a big file can make an assistant lose the thread, and why production systems summarise old turns instead of sending them verbatim.