If you've ever noticed that Claude or ChatGPT starts giving worse responses after a long chat, you're not alone. This phenomenon—where AI seems to "forget" earlier parts of the conversation—is rooted in how large language models (LLMs) process context. Understanding this can save you frustration and money.
The Whiteboard Analogy
Think of an LLM's context window as a giant whiteboard. Every message you send gets written on it, and the model reads everything on the board to generate its next response. However, the whiteboard has a limited size.
Token Limits
LLMs like ChatGPT and Claude can only handle a certain number of tokens (words or parts of words) at once. For example, ChatGPT's GPT-4 has a 32,000-token limit, while Claude 3.5 can handle up to 200,000 tokens. When you exceed that limit, the model starts discarding the oldest information to make room for new input. This is similar to the classic "lost in the middle" problem—models remember the beginning and end of a conversation best but forget the middle.
How You're Charged
It's not just about performance; it's about cost. You pay for every token you send and every token the model generates. Long conversations with large contexts burn through tokens quickly, increasing your API costs or depleting your subscription quota faster.
The Fix: Manage Your Context
Both ChatGPT and Claude have built-in ways to handle this. In ChatGPT, you can start a new chat to reset the context. In Claude, you can use the "Summary" feature to condense earlier parts of the conversation. You can also manually prompt the model to summarize the conversation so far, then use that summary as a new starting point.
Best Practices
- Start fresh for new topics: If you switch subjects, begin a new conversation.
- Trim unnecessary history: Delete old messages that aren't relevant.
- Use summaries: Ask the AI to summarize key points and then clear the chat.
By understanding and managing the context window, you can keep your AI assistant sharp and avoid paying for unnecessary tokens.