🧠 AI & LLMs beginner

Context Window

The maximum amount of text (measured in tokens) that an LLM can process in a single interaction.

Context window defines an LLM's working memory - how much text it can see and reason about at once. Measured in tokens (roughly 3/4 of a word in English), context windows have grown dramatically: GPT-3 had 4K tokens, GPT-4 Turbo offers 128K, and Claude supports 200K+ tokens. Larger contexts enable: processing entire codebases, analyzing long documents, maintaining conversation history, and complex multi-step reasoning. However, models may struggle with information in the middle of very long contexts (the lost in the middle phenomenon). Efficient attention mechanisms like sparse attention and sliding window help manage computational costs of large contexts.