In the world of Large Language Models (LLMs), understanding context limits is crucial. Whether you're working with GPT-4o, Claude Sonnet 4.6, Gemini 2.5 Pro, or LLaMA 4, all of these models have a specific limit on how much text they can consider at one time when generating responses. This limit often influences how one designs prompts, and understanding it can significantly improve your interaction with LLMs. This lesson will clarify what context limits are, how they have been evolving, and practical methods to navigate these limitations.
A context limit refers to the maximum amount of text an LLM can consider when generating a response. For example, as of the last update, GPT-3.5 has a context window of approximately 4096 tokens.
This lesson, for example, is roughly 500 words and 650 tokens.

It's important to realize a token isn't just a word, as you can see in the image above. It can be a word, part of a word, or punctuation. This means that the actual text a model can consider may be shorter than you initially anticipated, though as a general rule of thumb, it's okay to think of tokens as words.
The progression of context limit enhancement over time has been remarkable. Here's a simplified table illustrating the changes:
| Model | Context Window (Tokens) |
|---|---|
| GPT-3 | 2k |
| GPT-3.5 | 4k |
| GPT-4 | 4k–32k |
| GPT-4o | 128k |
| GPT-4.1 | 1M |
| GPT-5.4 | 1M |
| Mistral 7B | 8k |
| LLaMA 3 | 128k |
| LLaMA 4 Maverick | 1M |
| LLaMA 4 Scout | 10M |
| Claude 2 | 100k |
| Claude 3.5 Sonnet | 200k |
| Claude Sonnet 4.6 | 1M |
| Claude Opus 4.6 | 1M |
| Gemini 1.5 Pro | 1M–2M |
| Gemini 2.5 Pro | 1M |
| DeepSeek V3 | 128k |
| DeepSeek V4 | 1M |
This evolution has opened up more opportunities in generating coherent and contextually rich responses. However, most LLM providers charge by the number of tokens used, and oftentimes you are working with a model that doesn't have a large context window, so you need strategies to optimize your prompts to work around these limits.
