AI Glossary / AI foundations / Beginner

Long-context model

Long-Context Model (AI foundations)

Definition

A long-context model is a language model that can accept a very large amount of text, often hundreds of pages, in a single request. The limit is called the context window and is counted in tokens, which are small pieces of words. It is not a model with a better memory between sessions, and 'long' has no fixed threshold: what counted as long a few years ago is routine today.

What it means

Every language model can only read a limited amount of text at once. That limit is its context window. Everything the model uses to answer, including your instructions, pasted documents, earlier chat turns and its own reply, has to fit inside it. A long-context model has a much larger window than older models did.

For a business reader, the practical meaning is simple. You can hand the model a whole contract bundle, a year of meeting notes or a full policy manual and ask questions about it directly, instead of splitting it into pieces first. The model does not learn from these documents permanently. It only reads them for that one request, and the next request starts fresh unless you supply the text again.

How it works

Text is first broken into tokens. A token is roughly a short word or part of a word, so a page of ordinary prose is a few hundred tokens. The model reads all the tokens in the window together. Most modern models use an attention mechanism, which lets each token weigh its relevance to every other token. This is what allows a detail on page 5 to inform an answer about page 200.

Attention gets more costly as the window grows, because more pairs of tokens must be compared. Builders use engineering methods to keep the cost manageable, and the details differ by vendor. The result is that long requests usually take longer and cost more than short ones, since pricing is normally based on tokens read and written.

A larger window does not guarantee equal attention to everything in it. Models can handle material at the start and end of a long input better than material buried in the middle, and accuracy can fall as the input grows. This varies by model and task, so it should be tested rather than assumed. Many teams combine long context with retrieval, where a search step selects only the most relevant passages to include.

Three practical examples

  • Finance team: An analyst pastes a full 90-page loan agreement and three amendments into one request and asks which covenants changed. The model can compare all four documents at once, and the analyst then checks each cited clause against the originals.
  • Retailer: A merchandising manager supplies twelve months of customer review exports and asks for recurring complaints grouped by product line. The whole set fits in one request, so no one has to pre-sort or sample the reviews by hand.
  • Support desk: A team lead loads the complete product manual and a long escalation thread into one request and asks for a summary of what was already tried. The model answers from both sources, and the lead confirms the steps before replying to the customer.

Think of it this way

Think of a desk. A short-context model is a small desk where you can spread out only a few pages at a time. A long-context model is a big conference table where the whole file can lie open at once. The analogy stops working because a person at a big table can pick out what matters, while a model may still miss a detail in the middle of a huge pile.

Worked example

A firm wants to review a document set with a long-context model. The set has 240 pages. Assume about 500 tokens per page. Total input is 240 x 500 = 120,000 tokens. Suppose the model's window is 200,000 tokens and the firm needs room for instructions and the reply, about 5,000 tokens. Then 120,000 + 5,000 = 125,000 tokens, which fits, leaving 200,000 - 125,000 = 75,000 tokens spare.

Now suppose the set grows to 480 pages. Input becomes 480 x 500 = 240,000 tokens, which exceeds 200,000. It no longer fits in one request. The firm must split it into two halves of 120,000 tokens each, or use retrieval to select only the relevant passages. Cost also scales: if a request is billed per token, reading 240,000 tokens costs twice as much as reading 120,000, before counting the output.

Illustrative case study

Fictional case: Harbor Lane Property Group, a made-up regional landlord, wanted to check 300 commercial leases for renewal clauses. A staff member pasted batches of leases into a long-context model and asked for each renewal date and notice period. The first run looked tidy, but a spot check found that the model had skipped a clause in several leases that sat deep in the middle of the longest batches. The team changed its approach. It processed one lease per request, asked the model to quote the exact clause text, and had a paralegal verify a sample of 10 percent against the originals. Accuracy improved and the quoted text made errors easy to catch. The team kept long context for questions that truly spanned several leases, such as comparing terms across one tenant's agreements.

Common misconceptions and mistakes

A bigger window means the model remembers everything permanently. The window only covers the current request, and the model does not retain your documents afterward unless a separate memory feature is built around it.

If a document fits, the model will read every part equally well. Attention can be uneven across a very long input, so important details may be missed, and results should be tested on your own material.

Long context makes retrieval and search unnecessary. Retrieval still helps by cutting cost and noise, and it is often the better choice when the source material is much larger than any window.

Pasting more text always gives better answers. Irrelevant material can distract the model and raise cost, so including only what is needed often works better.

Business use

To start, pick one task where people already read long documents, such as contract review, policy lookup or report summarizing. Run the model on a small set where you already know the right answers, and compare. Ask it to quote the passages behind each answer so a person can verify them. Decide up front whether a single large request or a retrieval step suits the task better.

Measure accuracy against a checked sample, time saved per document, and cost per request. Costs and delays grow with input size, so track tokens as well as outcomes. The main risks are missed details in long inputs, confident but wrong summaries, and sending confidential documents to a vendor. Review your data handling terms before uploading sensitive material, and keep human review in place for decisions with legal or financial weight.

People also ask

How long is a long context?

There is no fixed definition. The term is relative to what models could handle earlier, and the numbers keep rising, so check the current window size for the specific model you use.

Is a long-context model the same as one with memory?

No. A long context lets the model read a lot of text in one request. Memory means information is saved and reused across sessions, which needs separate features.

Do I still need retrieval if my model has a long context?

Often yes. Retrieval can lower cost and reduce distraction, and it handles collections too large for any single window.

Check your understanding

In the worked example, why does a 480-page set not fit a 200,000-token window?

Answer: It comes to 480 x 500 = 240,000 tokens, which is more than 200,000, so it must be split or filtered with retrieval.

What does the context window include besides your documents?

Answer: Your instructions, earlier conversation turns and the model's own reply all count toward the limit.

Why did Harbor Lane switch to one lease per request?

Answer: The model missed clauses buried in the middle of long batches, so smaller requests with quoted text and sample checks improved reliability.

Does the model learn from documents you paste into the window?

Answer: No. It reads them only for that request and does not keep them afterward.

Related terms

  • Context window
  • Token
  • Large language model
  • Retrieval-augmented generation
  • Prompt
  • Hallucination
  • Embedding
  • Attention mechanism

Learn next

Try a small test on your own documents: run the same question with the full text and with only the relevant passages, then compare accuracy and cost. Read next about context window and token to understand the limits, and retrieval-augmented generation to see when selecting passages beats loading everything.

  • Retrieval-augmented generation
  • Context window
  • Token

More in AI foundations

  • Labeled data - Labeled data are examples paired with target information for a defined learning or evaluation task.
  • Large multimodal model - A large multimodal model is a large neural network trained to take in, and often produce, more than one type of data, such as text, images, audio, video or...
  • Limited Memory AI - Limited memory AI is an informal category used to describe AI systems that use past information, learned patterns or recent observations when producing an...
  • Machine learning - Machine learning is the study and practice of creating systems that learn useful patterns from data or experience to perform a task.
  • Mechanistic interpretability - Mechanistic interpretability is a research approach that tries to explain how a trained neural network produces its outputs by reverse-engineering the...
  • Memorization (AI models) - Memorization in AI models is when a trained model stores and can reproduce specific pieces of its training data, such as exact sentences, images or records...

Sources

Vaswani et al., Attention Is All You Need: https://arxiv.org/abs/1706.03762 Google, Machine Learning Glossary: https://developers.google.com/machine-learning/glossary Jurafsky and Martin, Speech and Language Processing: https://web.stanford.edu/~jurafsky/slp3/ The sources were consulted for the definition of attention and context windows and for general terminology; the examples, analogy, worked example and case study are original educational illustrations. Checked 5 Nov 2026.

Previous: Lomb-Scargle Periodograms Next: Long-distance dependencies

  • Home
  • Daily AI Updates
  • Blog
  • AIFBL Academy
  • AI Glossary
  • Products and Tools
  • Store
  • Free CFO AI Prompt Pack
  • About Shihan Sheriff
  • Privacy Policy
  • Terms of Use
  • Refund Policy
  • Cookie Policy
  • Earnings Disclaimer