Context, Memory, and Tokens
We unpack what context is, how tokens are counted, why the model 'forgets' the start of a conversation, and how memory across chats works.
The context window
Context is everything the model sees when it generates an answer: the system prompt, the conversation history, the documents you attached. The size of this "window" is measured in tokens.
How many words fit in a token depends on the model's tokenizer. On current Claude models, 1M tokens is roughly 555,000 English words. For Gemini, Google's rule of thumb is about 4 characters per token. So a 100,000-word document can take anywhere from about 125,000 to 180,000 tokens. Non-English text usually costs more tokens than the same text in English. A document larger than the window simply doesn't fit, and the model can't "see" all of it.
The rest of this lesson opens after a free sign-up
Sign up with email or Google: the first two lessons of every course stay open for good, and the whole catalog is open for 7 days. No card needed.
