AISim › Chapter 2: Making it good

The contract reviewer

Level 6. Every answer is buried in a 90-page PDF.

Legal wants a bot that answers questions about long contracts. To "not miss anything", someone set retrieval to grab 12 huge chunks per question and pinned the cheap small model to save money. Now every request fails.

Goals

Concepts: Context windows, Reranking, Cost.

Hint

Count the tokens: 12 chunks × 1,000 tokens won't fit in a small model's window. You can buy a bigger window, or send fewer, better chunks. Which one keeps the bill down?

What you learn

Context windows are a budget, not a bucket. Stuffing more into the prompt costs money, adds latency and drowns the answer ("lost in the middle"). Retrieving wide and reranking down to a few precise chunks fits a small, cheap model, and is usually more accurate than a huge prompt on a big one.

More in this chapter

This interactive level needs JavaScript. Built by (cybernerdie).