Home/Learn/3D lessons/Inside a context window

Inside a context window.

See why a chat model seems to forget. Turn the 3D model, then fit a made-up chat into a small window in three ways and ask the questions that depend on its early messages. It builds on the lesson inside a language model, which shows how a model reads tokens and picks the next one.

Building the 3D model
The 3D model of the lesson: four round platforms in a row, with a stack of chat messages, a glass box filled with what the model reads, a memory box with notes and an answer card.The 3D model of the lesson: four round platforms in a row, with a stack of chat messages, a glass box filled with what the model reads, a memory box with notes and an answer card.

Drag to turn the model. Click it once, then scroll to zoom. On a phone, use two fingers. Click a station or its label to learn what it does. The model follows the exercise below. Faded cards are messages left out, the glass box is as tall as the window and fills with what the model reads, pinned notes stand in the memory box, and the lamp turns green when the question can be answered. The small traveling dot only shows the order of the steps.

Your turn

Fit a chat into a small window

Below is a short chat about planning a workshop. Choose how much the model can read and how the chat is fitted, then pick the next question. Token counts here are approximate, and nothing is sent anywhere.

Context window
How the chat is fitted
Memory notes to keep

The next question

The stored chat

    What the model reads

      The answer

      All five questions with this setup

      QuestionNeedsAnswerable
      How this model works

      Every answer starts from the same system prompt, “”, and ends with the new question. The space between them is filled in one of three ways. Dropping keeps the newest messages that fit. Summarizing keeps as many recent messages as it can and replaces the older ones with short summary lines written for this lesson. Memory notes are short lines you pin, placed first, with recent messages after them.

      The counts treat a word of up to six letters as one token, a longer word as two and each punctuation mark as one. Real tokenizers split text differently and real windows hold many thousands of tokens, but long chats reach those limits in the same way.

      Take it into real work

      Working with long chats

      Three points for evaluating and using chat models.

      Key terms

      Short definitions from the site glossary. Each term links to its full entry.

      Open the full AI glossary, with about 200 terms in eight groups.

      Six short questions

      Pick an answer to see a short explanation. Nothing is scored or saved.

      Where these ideas come from

      The lesson is a teaching model with a tiny window. Products differ in how they fit long chats and what they save as memory.

      How AI systems work

      Related lessons

      Two lessons on what happens inside the model and around it.

      1. Before this lesson

        Inside a language model

        How a model splits text into tokens and picks the next one, step by step.

        Open the lesson
      2. After this lesson

        Inside an AI agent

        How a model plans, uses tools and checks results, with its own working memory.

        Open the lesson