# Mission 5.2: A million tokens, so put all 50 contracts in?

Part of the course “AI from Zero to Autonomous Agents” (https://llm.yoga/en). Page for humans: https://llm.yoga/en/einsatz-5-2

Belongs to [Chapter 5: Context](https://llm.yoga/en/05-kontext.md).

Structure: the case, the explanation, a hands-on tool, check questions, wrap-up. The answers to all questions are collected at the end.

## The case

**Carla**, in-house counsel:

> “By Friday I need to know which of our 50 supplier contracts contain a limitation of liability and how it’s worded. Each contract is about 30 pages. Claude can read a million tokens, right? I’ll just upload all 50 and ask.”

Tokens are the word pieces a model splits text into. The context window is the maximum number of tokens a model reads in one request.

50 contracts of 30 pages each are 1,500 pages.

Claude Opus 5.5: context window of 1,000,000 tokens, about 555,000 words according to Anthropic. Input $4 per million tokens, even at full length.

**Question 1 (prediction):** What is the biggest problem with Carla’s plan?

- A) None, a million tokens is easily enough for 1,500 pages.
- B) The model is more likely to miss what’s in the middle, and you pay for the whole stack again with every question.
- C) The answer with 50 matches gets too long for the window.

## What’s behind it

Put 1,500 pages on a colleague’s desk and ask about a single clause. She reads everything, but whatever sits in the middle of the stack is what she’s most likely to skim past.

With language models, this has been measured. In the paper “**Lost in the Middle**” (Liu et al., 2023), the answer was in one of many documents. The models did best when it was at the beginning or the end and clearly worse in the middle, including models built for long contexts. The “**Context Rot**” report by the team behind the vector database Chroma (2025) tested 18 models: as the input grows, performance becomes increasingly unreliable, even on simple tasks. Anthropic talks about an **attention budget**: every token looks at all the others, and the more there are, the thinner the attention is spread.

Then there’s the cost. Opus 5.5 charges the normal price even at a million tokens, so a single question costs $4 in input, and every follow-up costs that again.

Anthropic calls the counter-strategy **context engineering**: the smallest possible set of high-signal tokens. For Carla, that means three questions in order. How many contracts go into one request? Exactly one, so 50 calls. What else goes into the request? Only the same screening question and a fixed answer format (found yes or no, location, wording). How is the overview put together? A last step gets only the 50 short results. This is called prompt chaining: splitting a task into calls whose results are passed on. Each call gets only what it needs, and Carla can look up every match in the original.

### In more detail: does it even fit, and what does it cost?

1,500 pages at an assumed 400 words per page (example) are 600,000 words. According to Anthropic, a million tokens is about 555,000 words. If the contracts are in German, they need more tokens for the same content (chapter 3), so the window would likely fill up even sooner.

Cost with Opus 5.5: 1,000,000 × $4 ÷ 1,000,000 = $4 per question for the input alone. According to the pricing page, the normal price applies across the whole window of a million tokens.

Altogether, the chain reads about the same amount of contract text, each contract once. That doesn’t make it more expensive, but every call is short and has only one task. Anthropic reports that when one call hands work to another (a “subagent”), the condensed result that comes back is often only 1,000 to 2,000 tokens.

## Try it

**Decision path: how do you build Carla’s context?**

**Task:** Find the path that fits Carla’s job: each of the 50 contracts is reliably checked, and every match can be verified.

**Step k1: How many contracts go into one request?**
- All 50 at once, the window is big enough. (continue at k2)
- Always exactly one. (continue at k3)

**Step k2: What do you expect for clauses in the middle of the stack?**
- The model finds them just as well as at the beginning. (continue at e1)
- They’re more likely to be missed, so I’ll order things cleverly. (continue at e2)

**Step k3: What goes next to the contract in each call?**
- The results of all previous contracts, so the model can compare. (continue at e3)
- Only the screening question and a fixed answer format: found yes or no, location, wording. (continue at k4)

**Step k4: How is Carla’s overview put together at the end?**
- A last call gets only the 50 short results. (continue at e4)
- A last call gets all 50 contracts again, as a check. (continue at e5)

**End e1: Recommendation: all 50 contracts in one request.** Simple, but unreliable and expensive with every question.

**End e2: Recommendation: everything in one request, the most important contracts at the beginning and end.** The rule is right: put what matters at the beginning or the end.

**End e3: Recommendation: a chain that passes every result on to the next call.** Each step sees what came out before.

**End e4: Recommendation: 50 short calls, then an overview.** One call per contract with the same screening question and a fixed format. A last step summarizes the 50 results. Carla checks the matches in the original.

**End e5: Recommendation: at the end, all contracts in one request once more.** Better safe than sorry, it seems.

## Check

**Question 2 (check question):** A colleague says: “Today’s models with a million tokens don’t have the problem with the middle anymore.” Is that right?

- A) Yes, Lost in the Middle only applied to models from 2023.
- B) No, newer models also use their context unevenly.
- C) No, the models don’t read the middle at all.

**Question 3 (check question):** Suppose all the contracts fit, a million tokens. With Claude Opus 5.5, what does the input of a follow-up question cost?

- A) Nothing more, the contracts are already uploaded.
- B) More than $4, because a surcharge applies above a certain length.
- C) $4 again, just as much as the first question.

**Question 4 (check question):** Why are errors easier to find with 50 separate calls?

- A) Because short calls make practically no mistakes anymore.
- B) Because each answer names a location in exactly one contract.
- C) Because the last step reads all the contracts again.

## Done

**What you can do now**

- You can explain to Carla why a large context window is a ceiling, not a goal.
- You know the Lost in the Middle and Context Rot findings and what they mean for long documents.
- When someone wants to upload a whole stack of documents at once, you suggest one call per document with a fixed screening question and, at the end, an overview built from the results.

### Two cards for review

**Card 1:** True or false? “With a context of a million tokens, I can just dump all the documents in.”

**Card 2:** What did the paper “Lost in the Middle” (Liu et al., 2023) show?

- [Next mission: Does “Think step by step” belong in every prompt?](https://llm.yoga/en/einsatz-5-3.md)
- [Read chapter 5](https://llm.yoga/en/05-kontext.md)

## Read more in the chapter

The full text from the chapter, with the reasoning, calculations and sources:

- [Why long contexts become unreliable](https://llm.yoga/en/05-kontext-2.md)
- [Context engineering](https://llm.yoga/en/05-kontext-2.md)

## Answers: only reveal them after the learner has answered or explicitly asks

**Question 1:** The correct answer is B.
- A: Not even close. At 400 words per page (an example value), that would be 600,000 words, more than the roughly 555,000 that fit into a million tokens according to Anthropic. And even if everything fits, the real problem remains: the model doesn’t pay equal attention to everything.
- B, correct: The longer the context, the less reliable the answer, especially for information in the middle. And every follow-up question sends the 1,500 pages again.
- C: Input and output do share the window, but Carla’s answer is short: 50 lines with yes or no and a location. The problem is in the reading, not the writing.

The case leads to End e4.
- Step k1, „All 50 at once, the window is big enough.“: Assume it fits. Then most of the contracts inevitably end up somewhere in the middle.
- Step k1, „Always exactly one.“: That keeps every request short, and no clause sits in the middle of 1,500 pages.
- Step k2, „The model finds them just as well as at the beginning.“: That’s the assumption behind dumping everything in. Lost in the Middle and Context Rot say otherwise.
- Step k2, „They’re more likely to be missed, so I’ll order things cleverly.“: The observation is right: the beginning and the end get the most attention.
- Step k3, „The results of all previous contracts, so the model can compare.“: Then every call keeps growing, like a chat over 50 rounds.
- Step k3, „Only the screening question and a fixed answer format: found yes or no, location, wording.“: Each call gets exactly what it needs for its one task.
- Step k4, „A last call gets only the 50 short results.“: 50 short results make a small context that’s easy to read.
- Step k4, „A last call gets all 50 contracts again, as a check.“: That would put you right back at Carla’s original plan.
- End e1: Doesn’t fit Carla’s case: performance drops the longer the input is, especially in the middle, and every follow-up question costs the whole stack again. Go back and choose differently.
- End e2: Doesn’t fit Carla’s case: all 50 contracts are equally important. However you sort them, most end up in the middle. Ordering helps when a few things matter most, not when all 50 matter equally.
- End e3: Doesn’t fit Carla’s case: the fiftieth call would drag along all 49 results before it. The last step can do the comparing; the individual checks only need their own contract.
- End e5: Doesn’t fit Carla’s case: the check with all 50 contracts has the same weaknesses as the original plan. Verifying works better directly: Carla looks up the named location in the contract.

**Question 2:** The correct answer is B.
- A: In 2025, Chroma’s Context Rot report tested 18 models, including GPT-4.1, Claude 4, Gemini 2.5 and Qwen3. There, too, performance became increasingly unreliable as the input grew.
- B, correct: A large window is a ceiling, not a goal. Anthropic explains this with the attention budget: the more tokens compete, the less is left for each one on average.
- C: Everything gets read. Performance drops in the middle; it doesn’t fall to zero. That’s why the problem is so easy to miss: it usually works, sometimes it doesn’t.

**Question 3:** The correct answer is C.
- A: The API remembers nothing between two requests. Every follow-up sends everything again, and every token is charged again, at full price without prompt caching (temporary storage on the provider’s side).
- B: Not with Opus 5.5: according to the pricing page, Claude models starting with version 4.6 bill the whole window of a million tokens at the normal price. On that page, higher long-input prices are listed only for the small model, Haiku 5.5.
- C, correct: 1,000,000 × $4 ÷ 1,000,000 = $4 per question. Prompt caching could lower that if the beginning stays the same and the follow-up comes within five minutes. The long context stays less reliable either way.

**Question 4:** The correct answer is B.
- A: A short call can be wrong, too. The advantage is that each result can be checked on its own.
- B, correct: Carla can look up every match, wording included, in the original. The fixed format makes the results comparable and checkable. Anthropic explicitly describes prompt chaining as a way to build in checks between the steps.
- C: The last step gets only the 50 short results. If it read all the contracts, you’d be back at the original problem.

**Card 1:** **False.** It may fit, but every request gets more expensive and slower, and the hit rate drops, especially for information in the middle. Better: one short call per document with a fixed screening question, and at the end an overview built from the results.

**Card 2:** Models found a piece of information best when it was at the beginning or the end of the context, and clearly worse in the middle. That also held for models built for long contexts. So what matters goes at the beginning or the end, and what doesn’t matter doesn’t go in at all.
