All Questions
Rag And Retrieval hard

A legal-contracts RAG system uses 2,000-token chunks with top-8 retrieval, which fills about 16K tokens per query. Answers are often vague and cite the right contract but the wrong clause, and per-query cost is high. Which change best improves precision without losing the surrounding context the model needs?

  1. A Grow chunks to 4,000 tokens so each clause appears alongside its definitions, and drop top-k to 4 to keep total context tokens constant.
  2. B Index small 300 to 500 token chunks for matching, then expand each hit to its parent section only when assembling the context.
  3. C Keep 2,000-token chunks and raise k to 16, since more candidates increase the chance that the exact clause appears somewhere in the context.
  4. D Switch to sentence-level chunks of about 30 tokens with no expansion, which maximizes embedding precision for each individual clause.

One system design question a day, with spaced repetition so the ones you miss come back.

Get the app

Related questions