O&O ConsultingBook a free call

Home / Insights / AI in Practice

Context Windows: What a Model Can Hold in Mind

Why input length is limited, why longer is not always better, and how systems handle memory.

O&O Consulting · · 2 min read

A stack of documents

A language model reads a limited number of tokens at a time. Everything it can use for an answer, including instructions, documents, earlier conversation and the reply itself, must fit within this context window.

Why there is a limit

Standard attention relates each token to every other, so computation rises roughly with the square of the length, and the stored attention states also grow. Techniques such as FlashAttention reduced memory traffic and made longer inputs practical, and windows have grown greatly. The cost has not vanished.

What competes for space in a context windowIllustrative diagram, not data
Room left for the answerThe current questionConversation historyRetrieved documentsSystem instructions
Room left for the answerThe current questionConversation historyRetrieved documentsSystem instructions

Diagram by O&O Consulting.

Longer is not the same as better

Accepting a very long document does not guarantee using it well. The "Lost in the Middle" study found performance depended on where relevant information sat, often worse in the middle. Irrelevant material can also distract. Each extra token adds to price and delay.

Where memory comes from

The model itself does not remember your last conversation. Applications create memory by saving information and putting it back into later prompts:

  • keeping recent turns verbatim and summarising older ones;
  • storing facts in a database and retrieving what is relevant;
  • maintaining a short structured record, such as a customer's preferences.

Each method decides what to keep, and a summary can lose or distort detail.

Privacy and control

Stored memory is personal data when it concerns people. Users should know what is retained, be able to correct or delete it, and not have one customer's information surface in another's session. Retention periods should be deliberate.

Limitations and open questions

How to evaluate long-context use remains unsettled: finding a single planted sentence is much easier than reasoning across a whole contract. Test the actual task at realistic length, including cases where the answer depends on two distant passages.

References

This article is general information, not financial, legal or investment advice. AI research and rules change quickly; check the cited sources for the current position.