What is query decomposition?
Query decomposition is a technique splitting a complex question that needs several pieces of information combined into simpler sub-questions, answering each by separate retrieval or with the model and combining the sub-answers into a final answer.
Unlike query rewriting, which turns one query into one better query, decomposition produces several sub-questions from one. Multi-hop retrieval is decomposition's retrieval side: answers to sub-questions steer the next retrieval.
- Topic
- Embeddings, document processing and RAG
- Also known as
- Sub-question decomposition
How query decomposition works
- A language model splits the complex question into independent or sequential sub-questions.
- Independent sub-questions are retrieved in parallel; in sequential ones the earlier answer feeds the next.
- Retrieved chunks and interim answers are gathered per sub-question.
- The model combines sub-answers into a sourced answer to the original question.
In more detail
Error propagation and depth limits in sequential decomposition
In sequential decomposition, errors propagate from earlier hops to later ones: if the first sub-question retrieves the wrong entity or hallucinates an interim answer, every subsequent retrieval step is derailed. Production pipelines mitigate this by attaching retrieved evidence and confidence checks to each hop, setting a strict maximum hop depth and allowing backtracking or fallback when an interim sub-answer is empty.
Dependency graph (DAG) planning and mixed parallel and sequential execution
Modern pipelines represent sub-questions as a Directed Acyclic Graph (DAG) rather than a flat list, so independent branches execute concurrently while dependent nodes wait only for their direct prerequisites. This structural planning, common in plan-and-execute agents and deep-research workflows, cuts overall latency while preserving multi-hop dependencies.
Merging sub-answers, resolving conflicts and mapping sources
Sub-question synthesis requires more than concatenating interim answers: the aggregator must reconcile conflicting evidence across sub-queries, deduplicate overlapping chunks and preserve per-sub-answer citations into the final response. Without a structured synthesis prompt or verification step, the model may drop caveats from earlier hops or over-generalise across incompatible scopes.
Trigger thresholds and multi-hop evaluation
Because decomposition multiplies retrieval and generation calls, a lightweight classifier or router should first decide whether a query actually requires multi-hop splitting. Evaluating decomposition requires measuring not only final answer accuracy (e.g. on HotpotQA or MuSiQue), but also sub-question faithfulness, recall per hop and end-to-end latency overhead.
Commonly confused terms
| Term | How it differs |
|---|---|
| Multi-query retrieval | Multi-query retrieval generates paraphrased variants of the same query to improve recall for a single information need, whereas query decomposition generates distinct sub-questions covering different parts of a composite question. |
| Chain of thought (CoT) | Chain-of-thought prompting elicits step-by-step internal reasoning from a single model call, whereas query decomposition explicitly turns sub-steps into external retrieval or tool calls before synthesising the final answer. |
Why query decomposition matters for on-premises AI
Enterprise questions often need information combined from several sources; one search query may not retrieve it all at once. The paper proposing least-to-most prompting shows breaking a complex problem into simpler subproblems solved in sequence lets a model generalise to problems harder than its prompt examples. The paper measuring the compositionality gap reports that cases where models answer all sub-questions correctly but fail the whole do not shrink as models grow, while having a model ask itself follow-up questions answered by a search engine improves accuracy.
A retailer's analyst asks which suppliers feed the category whose return rate rose most; the system splits this into two sub-questions for the returns report and the supplier list, running the second search based on the first answer.
Common questions
How does query decomposition differ from query rewriting?
Rewriting turns one query into one better query. Decomposition produces several sub-questions from one.
Should every question be decomposed?
No. For simple questions it adds latency and cost; a router can trigger decomposition only for complex ones.
Related terms
- Multi-hop retrieval
- Query rewriting
- Query expansion
- Task decomposition
- Chain of thought
- Retrieval-Augmented Generation
Sources
- Zhou et al., Least-to-Most Prompting Enables Complex Reasoning in Large Language Models, 2022
- Press et al., Measuring and Narrowing the Compositionality Gap in Language Models, 2022
In the glossary: Glossary, M to Q