Concept Architecture
Context Window in Evidence Review and Economic Modelling
The context window of a large language model is the span of text, counted in tokens, that the model can read and write within one request. Instructions, the documents supplied for the task, earlier turns of a conversation and the model's reply all share that span, and text outside it is never seen by the model. For a health economist the limit decides whether a trial report, its protocol and the extraction instructions can go to the model in one piece or have to be split. NICE ECD20 (2026), the NICE AI methods for evidence framework, treats context window limits as a design concern in screening for a systematic review, and warns that a document which fits inside the window may still not be used in full.
Tokens and what fills the window
Models count text in tokens, which may be whole words, parts of words or single characters, and Token (AI) has its own page in this glossary. The ECD20 glossary gives an average of about 0.75 words per token for English text and notes that providers split text with different tokenizers, so a budget written in words is only an approximation.
The ECD20 glossary counts both the input and the generated output against the window. Depending on the system, the window can also hold passages fetched by retrieval-augmented generation, reasoning tokens from techniques such as Chain-of-Thought Prompting, and summaries of earlier conversation. The budget for one request can be written as a single inequality.
where is the number of tokens in the instructions and criteria, is the number of tokens in the documents or retrieved passages, is the number of tokens carried over from earlier turns, is the number of tokens generated, including any counted reasoning tokens, and is the window size in tokens.
Reason and colleagues, automating network meta-analyses with GPT-4, met this constraint in practice. The model then had a limit of 8,192 tokens, about 6,000 words, covering the text passed to it and the text it generated, and every publication they used exceeded it.
Why the window has a fixed size
Liu and colleagues note that language models are generally built on the transformer. In the original transformer paper, Vaswani and colleagues give the per-layer cost of self-attention as growing with the square of the sequence length, because each position is connected with every other position. Liu and colleagues trace early windows of 512 to 2,048 tokens to this quadratic growth in memory and compute, and the larger windows of their own study period, 4,096, about 32,000 and 100,000 tokens, to faster hardware and better algorithms.
The ECD20 glossary adds that window sizes differ between models and that more context usually means more computation, longer waits and higher financial cost. For an analyst paying per token across thousands of records, the choice of window therefore has a direct cost.
Claimed length and usable length
A model accepting a long input does not read all of it equally well. Liu and colleagues gave models a question with 10, 20 or 30 retrieved passages, only one holding the answer, and moved that passage through the input. Accuracy was highest when the passage came first or last and fell when it sat in the middle. In the 20 and 30 passage settings, GPT-3.5-Turbo with the answer mid-input scored below its closed-book accuracy of 56.1%, reached with no passages at all, and versions with longer windows often did no better.
Hsieh and colleagues tested 17 long-context models on a benchmark called RULER. All scored nearly perfectly on a simple needle-in-a-haystack test, yet almost all lost accuracy on harder tasks as inputs grew. Every model claimed a window of at least 32,000 tokens, but only half kept satisfactory performance at that length.
What NICE ECD20 says for screening and extraction
ECD20 deals with the window most directly in its chapter on evidence synthesis. For title and abstract screening through a chatbot, it says that putting many records into one request is likely to perform worse because of context window limits, and that feeding records one after another in a single conversation may degrade performance over the turns. It prefers sending each title and abstract separately through an API with the same validated prompt template, and suggests limiting the output to a single character per decision to cut cost and computation.
For full-text screening, ECD20 says a full text with its registered protocol may not fit even after pre-processing. One remedy is to split and index the record so that retrieval-augmented generation supplies only the passages relevant to each eligibility criterion, with the retrieval engine validated and data compliance considered. Another is to assess the record chunk by chunk and combine the findings before a decision on the whole document, taking care when eligibility rests on details spread across chunks. Sending the chunks one after another in one conversation is not enough on its own, since earlier content still uses up the window and platforms may cut or rewrite it.
ECD20 asks submissions to describe how long and complex documents were handled and how failed or incomplete processing was detected. For data extraction, it asks that chunking keep the content needed for extraction and be documented.
Context limits in economic modelling work
In the Reason study, the team passed overlapping chunks of each publication, such as pages 1 to 3 and then 3 to 5, and asked the model whether it had found all the data it needed before supplying more text. The authors note that chunking may have affected extraction performance.
ECD20 lists model construction, model validation and model replication among tested uses of generative AI in economic evaluation. Each can mean passing a model script, a parameter table and a technical report together, so the window decides whether the model sees the whole health economic model or only part of it. The interim ECD20 position limits AI in health economic evaluation to a support role, with a person verifying its work, and rules out semi or full automation.
Worked example with a trial report and its protocol
The numbers below are illustrative. A review team screening full texts for a cost-effectiveness analysis uses a model with a window of 32,000 tokens and the ECD20 average of 0.75 words per token.
Step 1. Convert the inputs to tokens. The instructions and criteria run to 1,500 words, the trial report to 7,500 words and the full trial protocol to 18,000 words, and 1,000 tokens are reserved for the reply.
where is the estimated token count and is the word count. The instructions come to 1,500/0.75 = 2,000 tokens, the report to 7,500/0.75 = 10,000 tokens and the protocol to 18,000/0.75 = 24,000 tokens.
Step 2. Check the whole-document request.
where the terms are the instructions, report, protocol and reply in tokens. The total exceeds the window by 5,000 tokens.
Step 3. Split into chunks. Each call has 32,000 minus 2,000 minus 1,000, or 29,000, tokens free for document text. The report and protocol hold 34,000 tokens, and 34,000/29,000 = 1.17, so at least two calls are needed and their findings must be combined before the record is included or excluded.
Step 4. Retrieve passages instead. If one request per record retrieves 8 passages of 500 tokens across all the eligibility criteria, each request holds 2,000 + 4,000 + 1,000 = 7,000 tokens. Across 400 full texts, whole-document requests on a larger-window model would use 400 × 37,000 = 14,800,000 tokens, against 400 × 7,000 = 2,800,000 with retrieval, a ratio of 5.29, before counting the tokens needed to index the full texts for retrieval.
Step 5. Screen abstracts in one conversation. If abstracts of 300 words are pasted one at a time into a single chat, each adds 300/0.75 = 400 tokens plus a reply of about 10 tokens.
where is the largest number of records that fit, is 32,000, is 2,000, is the 410 tokens per record and its reply, and the floor brackets round down. The 74th record takes the conversation to 2,000 + 74 × 410 = 32,340 tokens, so the platform has to drop, cut or summarise earlier content or fail, and if the oldest goes first the screening criteria fall out of view. ECD20 also warns that performance may decline over the earlier turns, so 73 records is an upper bound for one conversation and gives no assurance of accuracy below it.
Retrieval cuts the token load more than fivefold, but a passage that is never retrieved cannot inform the decision, so the retrieval step needs its own validation. A whole-document request on a larger window still risks missing details in the middle of a long protocol.
Choices that change the result
Pre-processing can remove material that rarely affects a screening decision, and ECD20 names duplicated content such as conclusions and reference lists. Chunk size and overlap decide whether a sentence about the comparator or follow-up is split across two requests, which is why the Reason team overlapped pages. Reasoning tokens add to the load, and ECD20 says chain-of-thought prompting can help when criteria are complex but adds little for routine title and abstract screening.
Context window beside nearby terms
Context Bias, a separate term in this glossary, describes how material in the prompt sways the output, whereas the context window describes how much material the model can hold at once. Fine-Tuning changes a model's weights, while text in the window shapes only the current request. Retrieval-augmented generation chooses what goes into the window, and Prompt Chaining keeps each step within it by breaking a long task into shorter prompts.
Limits and common misreadings
A larger advertised window is often read as a promise that a whole dossier will be read with equal care, and the studies above show otherwise. Exceeding the window does not always produce an error either. The ECD20 glossary notes that overflow can lead to content being discarded, cut short or summarised, or to the system failing, and ECD20 says a system failure should never lead to an automatic exclusion. Window sizes change between versions of a model and token counts differ between tokenizers, so a reproducible review records the model version, the window used and how long documents were split or retrieved.
Sources
- Hsieh CP, Sun S, Kriman S, Acharya S, Rekesh D, Jia F, Zhang Y, Ginsburg B. RULER: what's the real context size of your long-context language models? Conference on Language Modeling (COLM), 2024. https://arxiv.org/abs/2404.06654
- Liu NF, Lin K, Hewitt J, Paranjape A, Bevilacqua M, Petroni F, Liang P. Lost in the middle: how language models use long contexts. Transactions of the Association for Computational Linguistics. 2024;12:157-173. https://doi.org/10.1162/tacl_a_00638
- National Institute for Health and Care Excellence. AI methods for evidence framework (ECD20). Corporate document, published 9 November 2026. https://www.nice.org.uk/corporate/ecd20
- Reason T, Benbow E, Langham J, Gimblett A, Klijn SL, Malcolm B. Artificial intelligence to automate network meta-analyses: four case studies to evaluate the potential application of large language models. PharmacoEconomics Open. 2024;8(2):205-220. https://doi.org/10.1007/s41669-024-00476-9
- Vaswani A, Shazeer N, Parmar N, Uszkoreit J, Jones L, Gomez AN, Kaiser L, Polosukhin I. Attention is all you need. Advances in Neural Information Processing Systems 30 (NIPS 2017). https://arxiv.org/abs/1706.03762
Related Concepts (3)
Frequently Asked Questions (6)
What is Context Window?
A context window is the most tokens a large language model can handle at once, covering prompt, documents and reply, so long full texts may need splitting.
Source: NICE ECD20 (2026)
How does the context window limit full-text screening in a systematic review?
Full-text screening may send a trial report together with its registered protocol, and NICE ECD20 (2026) notes that such inputs may exceed the context window even after pre-processing. One response is to split and index each record so that retrieval-augmented generation passes only the passages bearing on each eligibility criterion, with the retrieval engine validated and data compliance considered. Another is to assess the record in chunks and combine the findings before deciding on the whole document, taking care where eligibility rests on details spread across chunks. Sending the chunks one after another in a single conversation is not enough, since earlier content still uses up the window.
Source: NICE ECD20 (2026)
How did the context window of GPT-4 affect data extraction for network meta-analysis?
Reason and colleagues used GPT-4 to automate network meta-analyses at a time when the model had a limit of 8,192 tokens, about 6,000 words, covering both the text passed in and the text generated. Every publication in the study exceeded that limit, so the team passed overlapping chunks of each paper, such as pages 1 to 3 and then 3 to 5, to keep all reviewed text in context. After each chunk the model was asked whether it had found all the data it needed before more text was supplied. The authors note that chunking may have affected extraction performance.
Source: Reason et al. 2024
Why does a long context window not guarantee that a language model uses a whole document evenly?
Liu and colleagues gave models a question with 10, 20 or 30 retrieved passages, only one of which held the answer, and moved that passage through the input. Accuracy was highest when the relevant passage came first or last and fell when it sat in the middle. In the 20 and 30 passage settings, GPT-3.5-Turbo with the answer placed mid-input scored below its closed-book accuracy of 56.1%, reached with no passages at all. Versions with extended windows often performed no better than their standard counterparts, so a document that fits inside the window may still be read unevenly.
Source: Liu et al. 2024
What happens when the context window of a large language model is exceeded during evidence review?
Overflow does not always produce a visible error. The NICE ECD20 (2026) glossary notes that once the window is full, content may be discarded, cut short or summarised, or the system may fail. In a long screening conversation where the oldest content is dropped first, the instructions and eligibility criteria given at the start can fall out of view while records continue to be processed. ECD20 says a system failure should never lead to an automatic exclusion, and it asks submissions to describe how long documents were handled and how failed or incomplete processing was detected.
Source: NICE ECD20 (2026)
How does the size of a context window affect the cost of AI-assisted evidence synthesis?
The NICE ECD20 (2026) glossary notes that context window sizes differ between models and that processing more context usually brings more computation, longer waits and higher financial cost. For a team paying per token across thousands of records, the amount of text sent with each request therefore has a direct cost. ECD20 prefers sending each title and abstract separately through an API with the same validated prompt template for consistency, even though the prompt is resent with every record, and suggests limiting each screening decision to a single output character to reduce cost and computation. Retrieving only relevant passages from full texts cuts the token load further, although the retrieval step then needs its own validation.
Source: NICE ECD20 (2026)
Trust Record
Verified by Dr Darrin Baines
British health economist
Professional identity: darrinbaines.org
Verification date: 10 Nov 2026
Content version: 1.0.0
Canonical Identity
- Persistent URI
- https://healtheconomics.wiki/concept/context-window
- Term code
- HS-HP-DH-077
Stable URI · Machine-readable · Resolvable · CC BY 4.0
