Tokens and context windows

How models read text in chunks, and why long chats forget things.

Text in pieces

A language model doesn't read letters or whole words the way you do. It reads tokens. A token is a chunk of text: often a short word, part of a longer word, or a bit of punctuation. A common word like "cat" might be one token. A longer or rarer word like "unbelievable" might be split into a few pieces, such as "un", "believ", and "able". The exact splits depend on the model.

In English, a token is on average a bit shorter than a word, so a page of text is usually more tokens than words. Many AI services count usage and set limits in tokens, which is why you may see the word in pricing or settings.

The context window

Everything a model can "see" at one time has to fit in its context window. This is the model's working memory for a single conversation. It holds your messages, the model's replies, and any files or pasted text, all measured in tokens.

Each time you send a message, the app hands the model the conversation so far, up to the size of the window. The model then predicts its reply from that. It isn't recalling the chat the way you recall a talk with a friend. It is rereading the transcript every time.

Context windows have grown a lot. Some hold a few thousand tokens. Others hold hundreds of thousands, enough for a whole book. But every window has a limit.

Why long chats forget

When a conversation gets longer than the window, something has to give. Depending on the app, older messages may be cut off or squeezed into a short summary. Either way, details from early on can drop out. That's why a chatbot may "forget" a name or rule you gave it an hour ago.

Even inside the window, models can lose track of details buried deep in a very long chat. If something matters, repeat it, or start a fresh chat with a clear summary of what you need.

No memory between chats

When you open a new chat, the model starts with an empty window. It does not remember you, your past questions, or what it told you yesterday. Chatting with you doesn't change the model itself.

Some apps add a memory feature. It saves notes about you and quietly adds them to new chats. That's the app doing extra work, not the model remembering on its own. If you're not sure whether an app has memory turned on, check its settings.

Try it

Start a chat and tell the chatbot your favorite color. Then open a brand-new chat and ask, "What's my favorite color?" See whether it knows. If it does, look in the app's settings for a memory feature.

Check your understanding

4 questions. Get 4 right to master this skill. Quiz results count toward your skill progress; they are not a credential.

  1. 1. What is a token?
  2. 2. What is a context window?
  3. 3. Hours into a long chat, the chatbot forgets a rule you gave it at the start. Why might that happen?
  4. 4. You open a new chat and the assistant knows your name. What best explains this?

0 of 4 answered.

What this opens up

Back to the AI Foundations tree