← All questions
RAGHard· System Design· Retrieval

Would you decompose the query into sub-questions up fro...

There is no single correct approach; it depends on the nature of the query. For comparison questions, static decomposition allows for parallel fan-out, which reduces round-trips. For bridge questions, the second sub-query contains information that does not exist until the first is answered, necessitating an alternating retrieval-generation loop. At serving time, a cheap query classifier can be used to route the request appropriately.

Code playground (Python)