Command Palette

Search for a command to run...

Hectal
Back to the lesson: Topic 13.5 — Trade-off Questions
RAG and Vector Search · Example 1 of 2

A trade-off table that changes with the weights

The scores are example judgements. In practice take precision and completeness from the golden set and cost from the estimator.

How to argue a choice instead of reciting a preference: chunk size, k, hybrid or not, re-rank or not, which store, RAG or long context. Each is a table of costs and a measurement.

Change the code and press Run (Ctrl+Enter). Predict what will happen first, then break it on purpose and read what changes. Your edits are saved and match the lesson page.

Ready for more? This phase has 5 hands-on exercises with automatic checks.

Practice questions

Write the code in the editor, run it, then open the model answer to compare.

01

Option A scores precision 5, cost 2. Option B scores precision 3, cost 5. With weights precision 2 and cost 1, print the weighted total of each and the pick.

02

A team sends 5 passages of 300 tokens per question and considers 3. For 20,000 questions a day at an input price of 0.50 dollars per million tokens, print the dollars saved per day.

Explain it without notes

01

Give the four-part structure of a trade-off answer.

02

How would you choose a chunk size and defend it?

03

How do you decide between hybrid search and vectors only?

04

When is long context a better answer than RAG?

A trade-off table that changes with the weights
Sign in to run this example in your browser.

Expected output

accuracy first (precision x2, completeness x2, cost x1)
  medium (300 tokens) 19
  small (100 tokens)  18
  large (800 tokens)  15
  pick: medium (300 tokens)
budget first (precision x1, completeness x1, cost x3)
  small (100 tokens)  19
  medium (300 tokens) 17
  large (800 tokens)  10
  pick: small (100 tokens)