Skip to main content

Command Palette

Search for a command to run...

Context Window

Humans vs LLMs: How They Remember Information

Updated
•4 min read•View as Markdown
Context Window
R
AI Engineer and Full-Stack Developer building AI products and sharing what I learn along the way. I write about GenAI, LLMs, Networking, system design, and practical software development - turning complex ideas into simple, hands-on guides.

What is a Context Window?

We can define a context window as the amount of information (tokens) an LLM can process at one time.

Unlike humans, LLMs have a fixed context window. Everything they need to answer a question has to fit inside that window. Once the limit is reached, older information may no longer be considered.

Humans work a bit differently. We don't remember every single word from a conversation, but we usually remember the important ideas and context. Even if we forget some details, our brain can often recall them later through memory and associations.

An LLM, on the other hand, doesn't actually "remember" conversations the way humans do. It can only use the information that is currently available inside its context window. If something falls outside that window, the model generally can't use it unless it's provided again.

A larger context window allows an LLM to remember more of the conversation, understand longer documents, and connect information from different parts of the input. That's why modern AI models keep increasing their context windows—but, as we'll see next, it comes with its own challenges.

As you can see in the image, every new user message and AI response adds more tokens to the context window. The conversation keeps growing until the context window reaches its limit. Once it's full, the oldest parts of the conversation start moving out of the window (just like the sliding window ), meaning the LLM can no longer use that information unless it's included again.

"Now that we know what a context window is, a common question comes to mind—why don't we simply keep increasing it?" hmm


Can't We Just Increase the Context Window?

The short answer is yes, we can.

In fact, newer LLMs are being released with much larger context windows than before.

But increasing the context window is not free. It comes with several trade-offs that can directly affect both AI companies and end users.


Problems Created by a Larger Context Window

1. Cost

One of the biggest challenges is cost.

Processing more tokens requires more computation, which increases infrastructure costs for companies. Eventually, this can also affect end users through higher pricing.


2. Optimization

Simply increasing the context window isn't enough.

The model also needs to be optimized to efficiently process that much information. Without proper optimization, performance may decrease even if the model can technically accept more tokens.


3. Hallucinations

When an LLM has a very large amount of information to process, it can become harder for the model to focus on the most relevant parts of the context.

This may increase the chances of hallucinations.

Hallucination: When an LLM generates information that is incorrect, made up, or not supported by the provided context, it is called a hallucination.

It doesn't always happen because of a large context window, but managing a larger amount of information makes the problem more challenging.


4. Reliability and Delay

People don't usually talk about this one.

When an LLM has more information to process, generating a response can take longer. More tokens generally mean more computation, which may increase latency.

So while a larger context window is useful, it can also make the system slower if it isn't optimized properly.


Some Indirect Solutions

Memory Optimization

This is a very broad topic, but the basic idea is simple.

Instead of keeping every token in memory, the system tries to retain only the most relevant information needed for the conversation.

In other words, the LLM's short-term memory is managed more efficiently so that unnecessary information doesn't consume valuable context.

Implementing this is quite challenging, but it is an active area of research and development.


Retrieval-Augmented Generation (RAG)

You have probably heard this term before.

Retrieval-Augmented Generation (RAG) is an architecture that improves LLMs by retrieving only the most relevant information from an external knowledge base before generating a response.

Instead of putting all the data into the context window at once, the system first searches for the most relevant chunks based on the user's query and only sends those chunks to the LLM.

This helps reduce unnecessary context, lowers cost, and often improves the accuracy of the generated response.


We briefly talked about RAG (Retrieval-Augmented Generation) in this article, but it deserves a dedicated discussion.

In the next blog, we'll explore what RAG actually is, why almost every production AI application uses it, and how it helps overcome one of the biggest limitations of LLMs.

Until then, keep learning and stay curious. See you in the next one!