presentsUNAIVERSE
The UN AI timeline

Learn AI /Large Language Models /Context window

Context window

Also called: context length, context limit, memory limit.

Detail

In five seconds

What it is

The maximum amount of input and prior output a language model can use at one time while producing the next part of a response.

In plain words

It is the amount of recent text and instructions the model can look at at one time while answering.

An everyday example

Amina and Luis are comparing two paragraphs that say the same thing in different words. They have many printed pages, but their desk is small, so only a few pages can stay open at once. When they need new pages, they remove some older ones from the desk and bring others in. Their comparison can use what is visible on the desk now, not every page they brought to the room.

Where the story stops working

People can form durable memories, choose what to reread, and understand meaning in ways a model does not necessarily do. A context window is only a temporary input limit, usually measured in tokens, and it does not work like a human working memory.

Remember thisThe context window is the model's working limit for the current step. Instructions, source material, conversation history and generated output all use the same finite space.

Understand it

Understand it

Why it matters

It affects whether a tool can handle long documents, long chats, and multi-step tasks without dropping important details. That matters for procurement, workflow design, risk assessment, and judging whether an output is complete enough to trust for review.

What fits inside the context window

After using this explainer, a reader should be able to say what counts toward the context window, what happens when it fills up, and why this is not the same as long-term memory.

Desk size (context window)12

    An interactive panel shows a fixed-size window measured in tokens. Coloured segments represent system instructions, user text, document excerpts, and generated reply tokens. As the reader adds text, the bar fills. When the limit is exceeded, the oldest content fades out or is summarised, and the visible response changes accordingly.

    The reader can add or remove chunks of text, drag a slider for window size, and toggle whether overflow is truncated or summarised.

    Describe this without the diagram

    Screen-reader version: A narrated simulation describes a model with a fixed token budget. First, system instructions use part of the budget. Next, the user prompt uses more. Then the model generates reply tokens, which also count. When a long document is added and the total exceeds the limit, the oldest content is removed or replaced by a shorter summary. The narration then compares two outcomes: with an earlier detail still inside the window, the answer mentions it; after that detail falls out, the answer no longer uses it. The key message is that the model can only use what currently fits inside the token limit.

    With reduced motion: A static sequence of five labelled panels replaces animation. Each panel shows the token bar at a different stage: empty, after instructions, after user text, after generated reply, and after overflow forces older content out or into a summary block.

    A language model works from a limited text buffer. That buffer holds the current instructions, the conversation so far, and often the model’s own recent reply. People often call this the context window or context length. Context limit usually means the maximum size allowed. Memory limit is ambiguous and should not be treated as a precise synonym.

    What goes in? Usually the system instructions, your prompt, any pasted documents, and sometimes images or other data converted into model-readable pieces. These pieces are often counted as tokens, which are small chunks of text such as words, parts of words, or punctuation.

    What happens? The model reads only the material that fits inside that limit and uses it to predict the next token. If the conversation or document is too long, some content may be cut off, summarised, or replaced, depending on the tool. Content outside the window is not available to the model at that moment unless the system adds it back.

    What comes out? A response based on the material inside the current window, not on everything ever said. This is why a model may lose track of earlier details in a long exchange. It is also why a larger context window can help with long documents, but does not by itself give reliable long-term memory or better truthfulness.

    How “Only the pages open on the desk” maps onto the real thing

    In the storyIn the AI system
    the small desk surfacethe context window
    open pages on the deskthe tokens currently available to the model
    removing older pages to make spacedropping or truncating earlier content when the limit is reached
    comparing the visible paragraphsgenerating the next output using only the current context

    A worked example

    A reporting officer uses an approved assistant over several turns to revise talking points for a chief of section. The latest request adds a long background note and asks for a concise final version.

    Starting from: Context limit: 1,000 tokens. System instructions: 120. Earlier conversation: 430. Latest request and background note: 380. Requested output: up to 200.

    1. The full sequence would require up to 1,130 tokens, which exceeds the 1,000-token context window.
    2. The application must reduce the input, allow less room for output or reject the request. In this example, it removes 130 tokens from the oldest conversation turn.
    3. The model drafts the talking points using the remaining instructions, text and prior output. The removed passage is no longer available during generation.
    4. A caveat found only in that passage does not appear in the draft, even though it was discussed earlier in the conversation.

    Result: The talking points are fluent but omit the earlier caveat. Starting a fresh request with the essential instructions and source passages may produce a more reliable draft than relying on a long conversation history.

    In a United Nations workplace

    At 5.20 pm, a statistician in a data unit asks an approved internal assistant to shorten a briefing note for a UN Country Team working group before the 6 pm deadline. The prompt includes drafting instructions, the current note, comments from several focal points and earlier exchanges with the assistant.

    All of that material, plus the text being generated, competes for space in the context window. If the combined sequence is too long, the application may reject the request, shorten the available output or remove earlier material. A qualification supplied near the start can therefore disappear from the model's usable context just when the final paragraph is drafted.

    Before you try thisUse only material permitted in the approved tool. Personal, protection-sensitive, security-sensitive or other confidential information must not be pasted into a service that has not been approved for it. Check the draft against the source material, particularly where content may have been removed to fit the window.

    Where you may hear it

    • A vendor demo during a procurement meeting
    • An ICT governance board reviewing an AI service
    • A data focal-point meeting on prompt guidance
    • A troubleshooting call with the service desk

    Avoid confusion

    Avoid confusion

    Often confused with

    Side-by-side

    Common misconceptions

    • Common misconception: A larger context window means the model is smarter.

      Correction: A larger window mainly means it can use more material at once. It may help with long inputs, but it does not automatically improve reasoning quality, factual reliability, or domain judgement.

    • Common misconception: Anything said earlier in a chat stays available forever.

      Correction: Only the part that still fits in the current window is directly available unless the system stores and reinserts older content. Long conversations can therefore lose earlier details.

    • Common misconception: Context window and training data are the same thing.

      Correction: Training happens before deployment and shapes the model weights. The context window is the temporary working input available during one interaction.

    • Common misconception: Memory limit means the model has human-like memory.

      Correction: In this setting, memory limit usually refers loosely to the context limit. It does not mean the system forms durable personal memories unless extra memory features are added.

    Quick check

    What best explains why a chat assistant may ignore an important detail from much earlier in a long conversation?

    Go deeper

    Go deeper

    The simple version

    It is the amount of recent text and instructions the model can look at at one time while answering.

    The technical version

    It is the model’s maximum usable sequence length for the current inference step, typically measured in tokens and shared across system prompt, user input, retrieved text, multimodal encodings where applicable, and generated output tokens.

    Reviewed external resources

    • EncyclopaediaContext window (opens in a new tab)Wikipedia

      This Wikipedia page gives a general overview of the term and suits readers who want a quick orientation before going deeper.

      Intermediatelink checked 2026-07-31

    • CourseLLM Course (opens in a new tab)Hugging Face

      This Hugging Face course material helps readers who want a structured explanation of how tokens, prompts, and model limits relate in practice.

      Deeperlink checked 2026-07-31

    • VideoLarge language models, explained visually (opens in a new tab)3Blue1Brown

      This 3Blue1Brown video suits visual learners who want intuition about how large language models process text step by step.

      Intermediatelink checked 2026-07-31

    • VideoVideo explanations: Context window (opens in a new tab)YouTube search

      This YouTube search results page helps readers find multiple video explanations of context windows and suits people who prefer to compare presenters and difficulty levels.

      search results, not one pagelink checked 2026-07-31

    • DiscussionCommunity discussion: Context window (opens in a new tab)Reddit search

      This Reddit search results page lets readers browse community discussions and examples of confusion about context windows, which suits readers who want informal questions and practical experiences.

      search results, not one pagelink checked 2026-07-31

    Where this came from

    Drafted with a language model through an offline pipeline, checked against this site's schema, and every external link above fetched to see whether it answers. Treat it as a starting point and check anything that matters against the primary sources. How this site is built and what that means.

    The one thing to remember

    The context window is the model's working limit for the current step. Instructions, source material, conversation history and generated output all use the same finite space.