Skip to content
Back to the AI glossary

Glossary · AI concepts & terminology

Context window

also: context length

In short

The amount of text a language model can take into account at the same time. Once it is exceeded, earlier parts drop out of the model’s view.

Reference: General AI knowledge

What it means

A language model processes text in tokens, small units made of words or parts of words. The context window is the maximum number of tokens it can take into account in one request. That includes the system prompt, the conversation so far, attached documents and the answer the model is currently writing. The size depends on the model and is stated in the maker’s documentation.

Whatever lies beyond the window, the model does not see. Depending on the application, text is cut off, older parts of the conversation are dropped or summarised, or the request fails with an error message. Even within the window, not every part is used equally reliably. Liu and colleagues showed in 2023 that language models make worse use of information in the middle of long contexts than of information at the beginning or end.

In practice and in the audit

In daily work the context window shows when an assistant is asked to summarise a long contract and clauses from the end are missing, or when it forgets earlier instructions in a long chat. So split long documents into sensible sections, ask specific questions and check whether the answer rests on the right passage. For large knowledge collections, RAG is the usual route: the method only brings the matching sections into the window.

For evidence this means: anyone who wants to trace a result later needs to know what was in the window at the time of the request, meaning prompt, documents supplied and model version. ISO/IEC 42001 requires in A.6.2.8 that you determine in which phases an AI system records event logs. For checking tasks such as comparing contracts, a sample test is worthwhile to see whether the system finds passages from all parts of a long document.

References in standards and law

I cite standards by clause number and in my own words, never verbatim. Legal texts link to EUR-Lex.

  • ISO/IEC 42001:2023, A.6.2.8Recording event logs so that results remain traceable.
  • ISO/IEC 42001:2023, A.6.2.4Verification and validation, including for long inputs.
  • Article 12(1) Regulation (EU) 2024/1689 High-risk AI has to allow automatic recording of events over its lifetime.

Frequently asked questions

Does a larger context window solve the problem of long documents?

It helps without solving it entirely. Even in a large window not every passage is used equally reliably, and every additional token costs computing time and often money. Targeted questions and supplying only the matching sections are usually more reliable.

Related terms

Further reading in the insights

Matching service

Working with long documents

In the Copilot training your team practises handling long documents so that nothing gets lost, and checking answers against the source.

To Copilot training

Author: Lars Zimmermann

Term and explanation in my own words. Researched to the best of my knowledge and reviewed for accuracy.

This is my interpretation from practice. For legal advice, please turn to the appropriate professionals.