A context window is the fixed amount of text — measured in tokens — that a large language model can "see" in a single request: system prompt, conversation history, retrieved documents, and its own answer all share this one space. Anything outside it is invisible to the model, permanently, no matter how important it was three messages ago.
Quick Answer: The context window is the model's total token budget per request — typically 8k to 2M tokens depending on the model. It's shared by everything you send in and everything the model sends back. Once it's full, older content gets silently dropped or truncated.
What a context window actually is
A context window is the maximum number of tokens a model can process in one call, and every component of your prompt draws from the same pool. It isn't a separate "memory" the model consults — it's the entire visible universe for that single inference pass. A model with a 128k window has no more awareness of token 128,001 than it does of a document you never sent.
Think of it as a desk, not a filing cabinet. Whatever sits on the desk right now is what the model can act on. Everything else — the previous conversation, the customer's full support history, your product's entire knowledge base — exists in a filing cabinet somewhere, but it does the model no good until you place it on the desk yourself. There's no browsing, no rummaging, no "let me go check."
This matters because PMs often talk about context windows the way they'd talk about disk storage — bigger is simply better, and a 200k window model can "remember more." It can't remember anything on its own. It can only process what's placed in front of it during that one pass, which is why our guide to LLM fundamentals treats the context window as one of the handful of concepts that changes how you scope a feature, not just how you configure one.
Tokens, not characters, fill the desk
The window's size is denominated in tokens — the sub-word chunks models actually process — not words or characters. A rough English rule of thumb is 1 token ≈ 4 characters, or about 0.75 words, but this varies by language and content type (code and non-English text often tokenize less efficiently). For the mechanics of why billing and limits both run on tokens instead of a more intuitive unit, see our breakdown of why tokens, not words, are the AI billing unit.
The desk-space budget: what actually shares the window
Four categories compete for the same fixed token budget, and a request fails or degrades the moment their sum exceeds the window's limit. Understanding the split is the difference between designing a feature that scales and one that quietly breaks at exactly the moment a user needs it most — a long support thread, a big document, a deep research task.
Here's a representative split for a chat-over-documents feature built on a 32k-token window:
| Component | Typical share | What happens if it grows unchecked |
|---|---|---|
| System prompt / instructions | 500–2,000 tokens | Crowds out room for user content; usually fixed cost |
| Conversation history | Grows every turn | Eventually must be truncated or summarized |
| Retrieved documents (RAG) | 2,000–20,000+ tokens | Directly trades off against history and output room |
| Model's output (response) | Reserved in advance | Too little reserved = truncated, cut-off answers |
- System prompt is your instructions, persona, and guardrails — paid on every single call, whether the user notices it or not.
- Conversation history accumulates turn by turn; a ten-turn back-and-forth in a chat feature can quietly consume as much space as a small document.
- Retrieved context (chunks pulled in via embeddings search, tool outputs, or pasted documents) is usually the largest and most variable chunk — see our explainer on how embeddings power retrieval for how those chunks get selected in the first place.
- Output tokens must be reserved before generation starts — most APIs require a
max_tokensparameter, and if you under-budget it, the model's answer gets cut off mid-sentence.
Quick Answer: Budget the context window like a shared conference-room whiteboard — reserve space for the answer first, then fill the rest with the highest-value history and retrieved content, in that order.
A worked example
Say your document-chat feature uses a 128k-token model. Your system prompt runs 1,500 tokens, you reserve 4,000 for the output, and the user has pasted a 40-page contract (roughly 30,000 tokens). That leaves about 92,500 tokens for conversation history and any additional retrieved snippets — plenty at first, but a long back-and-forth review session with the contract open the whole time will eat into that budget every single turn, not once.
Why "128k window" doesn't mean you should fill it
A large context window is a ceiling, not a target — and treating it as a target is one of the most common design mistakes in chat and document products. Bigger windows reduce how often you must truncate; they don't make every additional token free of cost, and they don't guarantee the model uses all of it equally well.
Three real costs scale with how much you stuff onto the desk:
- Latency: more input tokens means more time-to-first-token, even before generation starts, because the model has to process the entire input before producing the first output token.
- Cost: nearly every provider charges per input token, so a habit of over-including "just in case" context is a habit of paying for content the model may never meaningfully use.
- Attention dilution: models don't weigh every token equally regardless of window size — a phenomenon significant enough that Stanford researchers gave it a name (see below), and it's the reason "just retrieve everything" is a worse retrieval strategy than "retrieve the right things."
Quick Answer: A larger window buys you headroom for edge cases, not permission to skip curation — the model still processes every token you send, at a cost, and doesn't attend to all of them equally.
The temptation to "just paste everything"
It's tempting, especially with a 1M-token window model, to skip retrieval design entirely and dump an entire knowledge base into context on every call. This is where teams building chat-over-docs features get burned: the request technically succeeds, costs climb, latency creeps up, and — most dangerously — answer quality quietly degrades in ways that are hard to detect in a demo but show up constantly in production. Generation settings compound this; see our guide to the temperature parameter for a related knob PMs routinely under-think.
Lost in the middle: the hard edge isn't the only problem
Even content that technically fits inside the window isn't attended to uniformly — models are measurably better at using information at the start and end of their context than in the middle, a pattern researchers at Stanford and collaborators documented and named "lost in the middle." This means a critical fact buried in the center of a long prompt can be functionally invisible even though it never fell off the desk.
This reframes the whole "fits vs. doesn't fit" question. A hard edge — content simply excluded because it exceeded the window — is the obvious failure mode. A softer, sneakier failure is content that's technically present but positioned somewhere the model reliably underweights, producing an answer that looks confident and is quietly wrong or incomplete.
| Failure mode | What happens | How it shows up to a user |
|---|---|---|
| Hard truncation | Content is dropped entirely, no error thrown | Model contradicts earlier facts, seems to "forget" |
| Lost in the middle | Content is present but underweighted | Model misses a mid-document detail, cites the intro/conclusion disproportionately |
| Output truncation | max_tokens reserved too small | Response ends mid-sentence or mid-list |
For document-heavy PM products — think contract review, long customer-journey narratives, or multi-source research synthesis — this means the placement of your most important content matters almost as much as whether it's included at all. It's a design consideration worth holding alongside how you map a customer journey or scope a jobs-to-be-done discovery effort: the structure of what you feed the model shapes what it can actually reason about.
Designing chat and document features around the edge
Design decisions, not bigger models alone, are what keep a context-window budget from becoming a silent liability. Four practical moves cover most of what a PM needs to specify, even without writing the retrieval code themselves.
- Summarize or compress conversation history instead of carrying the full transcript forward turn after turn — many production chat features summarize everything beyond the last few turns.
- Rank and truncate retrieved chunks by relevance score rather than dumping every match a search returns; more retrieved context is not automatically better context.
- Reserve output tokens deliberately, sized to the longest reasonable answer your feature needs to produce, so responses don't get cut off under load.
- Place your most important facts at the start or end of a long prompt, not buried in the middle, given the lost-in-the-middle pattern above.
Quick Answer: Treat context-window management as a product requirement to specify — what gets summarized, what gets dropped, what gets prioritized — not an implementation detail to leave entirely to engineering.
Where Prodinja fits
This is exactly the gap Prodinx's Context Engineering practice inside Prodinja's Studio is designed to close: it's built to show, for a given prompt design, what actually fits on the model's "desk" and what silently falls off — surfacing the budget math and the at-risk content before it ships as a support ticket. It's a simulated critique layer in the current prototype, meant to walk you through the tradeoffs rather than execute a live model call, but the framing is the same one this article argues for: budget the window on purpose, don't discover its edges in production.
Key Takeaways
- A context window is a shared, fixed token budget — system prompt, history, retrieved documents, and output all draw from the same pool, per request.
- Tokens, not words or characters, are the unit — roughly 4 characters per token in English, but this varies by content type and language.
- Output tokens must be reserved in advance, or responses risk being cut off mid-answer under a tight budget.
- A bigger window reduces truncation risk but doesn't eliminate design work — latency and cost still scale with every token you include.
- "Lost in the middle" means presence isn't the same as attention — content can technically fit and still be functionally underweighted by the model.
- Placement and curation are product decisions, not just engineering details — PMs designing chat or document features should specify what gets summarized, ranked, or prioritized.
Frequently Asked Questions
What is a context window in simple terms?
A context window is the total amount of text, measured in tokens, that a language model can process in one request — including your prompt, any conversation history, retrieved documents, and the model's own reply. Once that budget is full, anything more either gets truncated or must be actively summarized down.
How big is a typical LLM context window?
Context windows vary widely by model, from around 8,000 tokens in older or smaller models up to 1-2 million tokens in some current large-context models. Bigger windows cost more per call and don't guarantee even attention across all included content, so "biggest available" isn't automatically the right choice for a given feature.
Does a larger context window mean better answers?
Not automatically — a larger window mainly reduces how often you hit a hard truncation limit. Research on the "lost in the middle" effect shows models can still underweight information placed in the center of a long prompt, so answer quality depends on curation and placement, not just raw capacity.
What happens when a conversation exceeds the context window?
The oldest turns are typically dropped or summarized to make room for new ones, depending on how the application is built — the model itself has no memory of anything outside the current window, so nothing is "remembered" unless it's deliberately re-included in the prompt.
How is context window size related to token cost?
Nearly every LLM provider charges per input and output token, so a larger context window used at full capacity directly increases per-request cost, independent of the window's maximum size. Designing a feature to include only relevant content — rather than the maximum the window allows — keeps both cost and latency predictable.