← Learn AI
C_000080 · llms and generative ai · foundation

Context Window

The maximum number of tokens a model can attend to at once — its entire working memory for a given call.

Step 1 of 5

In words

What it is, why it matters, and what it is like.

Why am I learning this?

This concept explains exactly why your AI assistant sometimes ignores the instructions you gave it at the start of the conversation, or why asking it to read a 500-page report results in vague summaries. It also reveals why sending huge amounts of text into these systems costs real money and takes more time. Whether you are using ChatGPT, Claude, Gemini, or running software on your own computer, every one of them has this specific limit. Understanding it tells you how to structure your requests so the model actually sees what matters, helps you avoid surprising errors when texts get too long, and explains why models behave differently depending on their size and where they run.

The idea, in plain terms

Think of the context window as the model’s entire working memory for a single interaction. When you send a message to an AI, it does not have a filing cabinet full of notes from yesterday, nor does it remember your previous chats unless you explicitly paste them into the current conversation again. The only thing it can process is the specific block of text provided in this one request. The context window is the maximum size of that block, measured in 'tokens'. A token is roughly a chunk of text smaller than a word; for example, the word 'hello' might be one token, but 'unhappiness' might be split into 'un', 'happy', and 'ness'—three tokens. The model can look at, say, 8,000 of these tokens at once, but nothing beyond that limit exists to it. It is like being asked to read a book while only holding one page in your hands. You can read that page perfectly, but you cannot flip back to check a detail from page five if the context window is smaller than the whole book. If you feed the model a 200-page document (roughly 100,000 tokens) but its window is only 5,000 tokens, it can only 'see' the last part of the document or specific snippets you choose to include. The early details are effectively invisible. This window is also a resource budget: processing more tokens takes longer (latency) and costs more money. However, having a larger window does not guarantee the model understands everything in it equally well; it often struggles to find key information in the middle of very long inputs.

An analogy

Imagine you are a chef working on a single order in a tiny kitchen. Your countertop is your context window. You can only hold as many ingredients and tools on that counter at one time as will physically fit—perhaps enough for one meal. The rest of the recipes, spices, and supplies are stored in the pantry, out of reach. If the order requires an ingredient you didn’t place on the counter, you cannot use it until you clear space to bring it over. If the order is so complex that it requires thirty different ingredients simultaneously, your counter will overflow; you will drop things, miss steps, and spend too much time just trying to organize the chaos. This limits how much work you can handle in a single pass. Where the analogy breaks down slightly is that a chef might remember simple recipes by heart without looking at them, whereas the AI has no memory outside of what is currently on its counter. Also, while you can buy a bigger countertop for your kitchen, having more space doesn't make you a smarter cook; it just allows for more complex dishes to be prepared at once, provided you have the skills to manage the extra ingredients.

Definition

The context window is the maximum amount of text (measured in tokens) that an AI model can process and remember during a single conversation turn.

Where this sits

This concept is the foundational constraint for every large language model, which are computer programs designed to understand and generate human-like text. It directly relates to tokenization, the process of breaking text down into the tiny chunks (tokens) counted by the window, and to prompt engineering, the practice of crafting inputs that fit within these limits to get the best results.

Signal from the Frontier

Get the next essay on mind, machine, and meaning

Essays at the intersection of AI, philosophy, and Indian governance. No promotional content.

We'll send a one-click sign-in link to confirm. No password needed.

Views expressed are personal and do not represent the Government of India or the Government of Uttarakhand.

Context Window — Learn AI — Dr. B.V.R.C. Purushottam