LearnQuestion bank

In a multi-turn chat the user asks “and what about for contractors?” and retrieval returns nothing useful. What techniques fix this, and what do they cost?

Applied LLMTechnicalMedium

Answer it yourself first, out loud or on paper, then compare.

Answer

Model answer, written in a candidate's voice

In short

  • Rewrite the follow-up with recent turns into a standalone query using a small, fast model
  • Alternatives: multi-query expansion, HyDE, and decomposition for multi-hop questions
  • Cost is an extra model call: added latency and tokens, but it can run in parallel with other steps and be cached
  • Evaluate rewriting by retrieval recall with and without it
  • Fall back to a clarifying question when the request is ambiguous

In full

The core fix is to treat the follow-up as context-dependent and rewrite it into a standalone retrieval query before search, using a small fast model rather than the large answer model. For a follow-up like “and what about for contractors?”, the rewritten query should carry the prior topic, such as pricing, eligibility, or policy, so retrieval does not see a dangling pronoun. Alternatives include multi-query expansion, which generates several plausible standalone phrasings and merges results, HyDE, which embeds a hypothetical answer and retrieves against that, and decomposition for multi-hop questions, which splits the request into ordered sub-queries. The cost is an extra model call, so it adds latency and token spend, but it is usually cheap relative to the final answer, can run in parallel with other retrieval-prep steps, and is cacheable for repeated or similar follow-ups. I would not ship it blindly: I would measure retrieval recall with and without rewriting on a labelled set, and when the history is too ambiguous to rewrite confidently, I would ask a clarifying question instead of guessing.

Corrected by an independent AI reviewer.

What a strong answer covers

  • Condense history plus the follow-up into a standalone query with a small, fast model
  • Alternatives: multi-query expansion, hypothetical-answer embedding (HyDE), decomposition for multi-hop questions
  • Costs an extra model call (latency, tokens); can run in parallel with other steps; cacheable
  • Evaluates rewriting by retrieval recall with and without it
  • Falls back to a clarifying question when the request is ambiguous

Common mistakes

  • Embedding the raw follow-up alone
  • embedding the entire conversation as the query