It’s Not Memory. It’s More Like a Whiteboard.
When people talk about context windows, they usually describe them in terms of size: GPT-4 has a 128,000-token context window, Claude has up to 200,000. Bigger numbers get treated as straightforwardly better, like RAM or disk space. More is more.
That framing isn’t wrong, but it misses what’s actually happening under the hood, and that gap in understanding causes real problems when you’re trying to get useful work out of these models.
A context window isn’t storage. The model doesn’t “remember” things you’ve said the way a database stores records. It’s more accurate to think of it as a whiteboard that the model reads in full every single time it responds. Every token in your conversation, every document you’ve pasted, every instruction you’ve written, the model processes all of it simultaneously to generate its next response. Nothing is cached for later in the way your intuition might suggest.
This has immediate practical consequences. The model doesn’t accumulate understanding across a long session. It re-reads and re-weighs the entire conversation each time. And critically, not everything on that whiteboard gets equal attention.
How Attention Actually Works (Without the Math)
Transformer-based models, which is what all the major LLMs are built on, use a mechanism called attention to decide which parts of the context are most relevant to whatever they’re generating next. Every token in your context attends to every other token, and the model learns weights that determine how much each relationship matters.
Think of it like this: if you paste a 50-page technical document and then ask a narrow question at the end, the model has to figure out which parts of those 50 pages are relevant to your question. Attention is the mechanism it uses to do that triage. The model isn’t reading linearly like you would. It’s more like it’s scanning the whole whiteboard at once and highlighting what seems relevant.
This works impressively well in many cases. But it’s not magic, and the limitations are real.
For one thing, attention has a quadratic scaling problem. The computational cost of processing a context doesn’t grow linearly with the number of tokens. It grows roughly with the square of that number. This is why large context windows are expensive to run, and why inference costs drop significantly as context shrinks. When you’re building anything that runs on these models at scale, context size is directly tied to your compute bill.
The Lost-in-the-Middle Problem Is Real
Here’s something counterintuitive that has been documented in research: models don’t use long contexts uniformly. There’s a documented tendency, sometimes called the “lost-in-the-middle” effect, where information placed in the middle of a very long context gets underweighted compared to information at the beginning or end.
The intuition is that the model’s attention tends to anchor on recent tokens (the end of the context) and salient early tokens (like your main instruction at the top). Material buried in the middle of a massive document dump? It’s there, technically, but the model may not weight it appropriately when generating a response.
This matters enormously for practical applications. If you’re building a RAG (retrieval-augmented generation) system where you pull relevant documents and stuff them into a context before asking a question, the order and placement of those documents affects quality in ways that have nothing to do with their content. The most relevant chunk might sit in a position the model is least likely to attend to carefully.
As a general rule: your most important context should be near your instruction or query, not buried somewhere in the middle of a large paste.
What Fills a Context Window and What It Costs You
People underestimate how fast context space disappears. A rough rule of thumb is that one token is about four characters of English text, so a 1,000-word article is around 750 tokens. A 200-page PDF is easily 100,000 tokens or more.
But it’s not just your documents. System prompts can run thousands of tokens if you’re not careful. If you’re using a tool-calling setup where the model has access to functions or APIs, the schema for those tools gets inserted into the context too. In a long conversation, all previous messages accumulate. By the time you’re asking your eighth question in a technical debugging session, the first five exchanges might be padding the context with information that’s no longer relevant to anything.
This is where a bigger context window doesn’t mean the LLM uses it becomes more than a theoretical concern. The model can hold 200,000 tokens, yes. But whether it extracts what you need from 200,000 tokens of mixed-relevance content is a different question.
Practical takeaway: treat context space like a shared resource you’re managing on the model’s behalf. Cut old conversation turns when they stop being useful. Compress verbose documents before inserting them. Be concise in system prompts. Not because the window will overflow, but because tighter context tends to produce better outputs.
Context Windows and the Statefulness Illusion
One of the most common misconceptions about working with LLMs, especially through chat interfaces, is that the model is maintaining a persistent state about you, your project, or your preferences across sessions.
It isn’t. The stateful feeling comes from the fact that within a single session, the full conversation history is included in the context window. The model appears to “remember” what you said earlier because it literally re-reads it each time. Close the tab, start a new chat, and the slate is wiped. There’s no learned model of you persisting anywhere.
This isn’t a flaw, it’s an architecture choice with significant privacy and consistency benefits. But it means that if you have standing context you want the model to have (your coding conventions, your writing style, your project’s architecture decisions), you need to make that context explicit every time. This is why well-structured system prompts are worth the effort. They’re not a nice-to-have. They’re the only persistent mechanism you have.
For teams building AI-assisted tools, this is a design challenge worth taking seriously. As the AI that wrote your code doesn’t know if it works illustrates, the model’s understanding is bounded by what you’ve put in front of it. Garbage in, confidently stated garbage out.
Tokens Aren’t Created Equal
A final layer worth understanding: the model doesn’t treat all tokens with identical weight regardless of where they appear or what they are. Structurally prominent tokens (headings, bullet points, the beginning of a new section) tend to receive more attention than tokens embedded in dense prose. Instructions framed imperatively at the start of a prompt tend to perform better than the same instructions buried in paragraph four.
This is less a hard rule and more an observation about how attention patterns work when trained on human-generated text. Humans write in ways that signal importance structurally, and the model has learned to pick up on those signals. You can use this.
When you’re writing prompts, structure matters in a way it doesn’t when writing for humans. Formatting that you might skip for brevity when writing an email can meaningfully affect model behavior. Numbered steps, explicit labels, clear section breaks: these aren’t just for your readability. They’re signals the model actually responds to.
What This Means in Practice
If there’s a single mental model worth carrying away from this, it’s that a context window is a finite, actively-read workspace, not passive storage. The model can only work with what’s there, weights it non-uniformly, and forgets everything the moment the session ends.
From there, a few concrete habits follow:
Curate, don’t dump. Pasting everything available into a context is tempting but counterproductive. Relevant, trimmed context outperforms large, mixed-quality context.
Front-load what matters. Put your primary instruction or the most critical reference material close to where you’re asking questions. The middle of a long context is the worst place for something important.
Treat system prompts as persistent memory. They’re your only reliable way to give the model standing knowledge about your needs, since no actual memory is carried between sessions.
Watch your context budget in applications. If you’re building on top of these APIs, context length directly drives cost and latency. Design your prompting strategy around that constraint from the start, not as an afterthought.
Understanding context windows won’t make you an AI researcher, but it will make you a sharper practitioner. The models are more capable than most people use them, and the gap usually comes down to how well you’ve structured the workspace they’re reading from.