Context Window Budgeting: Prompts for Long Documents
Halcyon Medical filed a 200-page registration dossier for a Class II infusion pump, and the analyst, Priya, had six weeks to pull every risk number, clinical claim, and software item into one summary a reviewer could follow. Her first attempt pasted four chapters at once, and the model answered confidently about the wrong chapter. The document did not fit the window with room for instructions, and forcing it produced confident nonsense. Budgeting the window was the whole job.
The context window is a finite budget, and a long dossier spends it in three ways: the document, your instructions, and the model’s own reasoning. This guide maps a context situation to the prompt strategy that fits, then gives a block for each. When the goal is a plain readable summary rather than a structured extraction, the summarize article prompt is the simpler starting point.
Context Strategy Decision Table
| Scenario | Recommended option | Why | Cost |
|---|---|---|---|
| Whole document fits with room for instructions | Single-pass full paste | Preserves cross-references between sections | Impossible for a 200-page dossier; leaves no margin |
| Document far exceeds the window, need the whole picture | Chunk and map, then reduce | Keeps every pass inside the budget | Loses cross-chapter links unless you carry a running index |
| You need only specific facts, such as all risk numbers | Schema extraction per section | Produces uniform rows you can merge | Drops the context around each number |
| Many ad-hoc questions asked over weeks | Build a pinned index, then retrieve | Cheap repeated queries against a small artifact | The index needs maintenance as chapters change |
| A reviewer needs one readable overview | Hierarchical summary of summaries | Shrinks any length into a fixed budget | Compression flattens regulatory nuance |
| You must trust the output enough to file it | Two-pass extract, then cross-check | Catches contradictions between chapters | Doubles the work and the token spend |
Budgeting the Window Before You Paste
Estimate the load before you paste. A dense regulatory page runs roughly 650 to 800 tokens, so 200 pages lands between 130,000 and 160,000 tokens before your instructions, which already exceeds a comfortable working budget on most models. That is the arithmetic that decides the strategy: if the document alone eats the window, no clever instruction will make a single pass reliable.
Reserve headroom on purpose. Leave at least a quarter of the window for instructions and reasoning, because a prompt that fills the window to the edge degrades on the last sections, not the first, which is exactly where a dossier keeps its conclusions. Priya’s failed attempt filled the window and got chapter three back for a question about chapter nine. Keeping the format rules in a separate, structured pass fixes both the recall and the merge, an idea the output format guide develops further.
Prompts for Each Strategy
1. Chunk and map. One chapter per pass, fixed output shape.
You are reviewing one chapter of a 200-page medical device registration dossier for a Class II infusion pump. Read the chapter and output: 1) a 60-word summary, 2) every quantitative risk value with its section number, 3) every claim that references another chapter. Do not interpret or add facts. If a value is missing, write MISSING. Keep the same field order for every chapter you receive.2. Reduce the maps. Merge chapter outputs into one overview.
Here are 11 chapter maps from one dossier, in order. Merge them into a 500-word reviewer overview under four headings: device and intended use, risk management, software, and clinical evidence. Where two chapters disagree, list the conflict with both section numbers. Do not resolve the conflict, only flag it.3. Schema extraction. For pulling a table of specific facts.
Extract every risk control from the risk management file of an infusion pump dossier into rows with these columns: risk ID, hazard, control measure, verification method, source section. Output only the rows as HTML table rows. If a control has no stated verification method, put UNVERIFIED in that column.4. Index build. A small artifact for repeated questions.
Build a glossary index for a 200-page infusion pump dossier. For each major term and each numbered section, give the term, the section number, and a one-line description of what that section contains. Keep the whole index under 800 words so it can be pasted into future prompts.5. Hierarchical summary. For a single readable overview.
Summarize this section in 80 words, then list any claim that depends on another section. When I send the next section, keep the same two-part output so the pieces can be stacked into one overview without rewriting.6. Verification pass. The pass that catches contradictions.
You have two summaries of the same dossier section produced on different days. Compare them, list every factual difference, and for each difference state which version the raw section number supports. Flag anything you cannot verify rather than choosing a side.The Hidden Cost of Chunking
Chunking buys reliability and pays for it in lost connections. A risk value in chapter five usually means nothing without the design decision in chapter two, and a map that captures each chapter in isolation drops that link. The reduce pass and the verification pass exist to buy some of it back, which is why a real dossier pipeline is three passes, not one.
The second hidden cost is consistency of format. Chunk eleven chapters with eleven slightly different prompts and you get eleven shapes that will not merge. Fix the field order in the first chunk prompt and reuse it verbatim, because the merge pass can only align what was already aligned. The third cost is that every pass spends tokens, so a six-week deadline with a fixed budget has to plan the passes up front rather than discovering them mid-review.
A fourth cost is the quiet one: a chunk prompt that prints a short answer on a long section hides the missing detail rather than revealing it. Add a rule that forces the model to say what it could not find, so an empty field becomes a visible gap instead of a confident blank. That single rule is what turns a plausible summary into something a reviewer can actually audit.
Running a 200-Page Dossier in Practice
Priya rebuilt the work as a pipeline. First she ran the extraction prompt once per chapter across all eleven chapters, collecting risk values and cross-references into eleven maps. Then she ran the reduce prompt to merge the maps into a 500-word overview and a four-heading structure. Then she built the index and used it for the rest of the review, pasting the 800-word index instead of whole chapters for every follow-up question. The whole sequence took two days instead of the two weeks a single paste attempt had already burned.
The verification pass caught two real conflicts: a clinical claim in chapter nine that contradicted a limit in chapter four, and a software item missing a verification method that the schema extraction flagged as UNVERIFIED. Both were the kind of thing a single overflowing paste would have buried. For the summary mechanics underneath this pipeline, the research summary settings reference covers the depth and citation controls in more detail.
Sources & Notes
These strategies were written for a 200-page medical device registration dossier, but the budget logic applies to any document longer than the window: estimate the token load, reserve headroom, pick a strategy by the output you need, and add a verification pass when the result has to be trusted. Chunk and map, reduce, schema extraction, index, hierarchical summary, and verification cover most long-document jobs.
Two cautions. Token estimates vary by formatting, so measure a real page before you commit to a fixed number of chunks. And a model can produce a clean table from a chapter it half-read, so never skip the verification pass on anything you intend to file or publish. The window is a budget; treating it as unlimited is how confident errors reach a reviewer.
