ADR-0032: Query Decomposition for Multi-Hop Questions
Date: 2026-02-16 | Status: Implemented (2026-02-17) | Relates to: ADR-0017 (Context Retrieval Architecture), ADR-0030 (LLM Entity Extraction)
Context
The retrieval pipeline processes each query as a single retrieval pass. Complex questions that require multiple pieces of information -- such as "Welke arts op campus Sint-Jan doet knieoperaties en wanneer consulteert hij?" -- need three separate evidence chains:
- Treatment to Department (which department offers knee surgery?)
- Department to Doctor (which doctors work there?)
- Doctor to Schedule to Campus (when do they consult at Sint-Jan?)
The knowledge graph encodes these paths (Treatment OFFERS Department WORKS_IN Doctor LOCATED_AT Campus), but the single-pass pipeline relies on the first hop succeeding. When "knieoperatie" does not resolve via taxonomy aliases, the entire chain breaks and falls to vector search, which returns fragments that partially answer sub-questions but miss the full chain.
Analysis of the 108 golden questions shows ~15 are genuinely multi-hop. Standard single-pass RAG fails on 40-60% of multi-hop questions (MultiHop-RAG benchmark, COLM 2025).
Why This Is the Highest-Priority Gap
A comprehensive SOTA gap analysis evaluated 7 potential improvements against the current architecture. Query decomposition emerged as the clear P0 priority because:
- No existing compensation: Unlike domain-tuned embeddings (compensated by LLM reformulation + contextual embeddings + taxonomy aliases) or SPLADE (compensated by canonical questions + enriched BM25), there is no current mechanism that handles multi-hop queries gracefully.
- Low effort: A single additional Tier 2 LLM call (~200ms, ~$0.00003) that reuses the entire existing pipeline.
- High impact (expected): an estimated +15-25% improvement on multi-hop golden questions. This was a pre-implementation estimate; it was not confirmed by the evaluation below.
Decision
Implement LLM-powered query decomposition as an optional pipeline stage between intent classification and retrieval.
Decomposition Flow
Multi-Hop Detection
The decomposition step includes a classification gate: the LLM determines whether the query requires decomposition or can proceed as a single query. Single-hop queries (e.g., "Wat zijn de bezoekuren van cardiologie?") pass through unchanged -- no latency penalty.
Detection heuristics (in the LLM prompt):
- Query mentions multiple entity types (doctor + campus + treatment)
- Query asks for temporal information combined with entity lookup (schedule + doctor)
- Query contains conditional constraints ("arts die X doet EN op campus Y werkt")
Sub-Question Generation
The Tier 2 model generates 2-6 focused sub-questions, each targeting a single entity type or relationship. The sub-questions are:
- Written in Dutch (matching the retrieval index language)
- Self-contained (no pronouns referencing other sub-questions)
- Ordered by dependency (department before doctors, doctors before schedules)
Per-Sub-Query Reranking + Round-Robin Interleaving
Sub-question results are reranked individually against their own sub-question, then interleaved to ensure fair topic coverage:
- Per-sub-query reranking: Each sub-query's chunks are scored by the cross-encoder against that specific sub-question (not the blended original query). Graph results and keyword-rescue chunks are pinned. Reranking calls run sequentially to avoid API rate limits and local-model fallback deadlocks.
- Round-robin interleaving: Rank-0 from each sub-query, then rank-1, etc. This guarantees every topic's best chunk appears near the top.
- Deduplication: Chunks appearing in multiple sub-queries are kept at their first (highest-priority) position.
This replaced the original merge-then-rerank approach (2026-03-13) after discovering that reranking merged results against the blended multi-topic query caused minority topics to be eliminated. For example, in a 5-topic query about appointments, parking, costs, charging stations, and wheelchairs, the wheelchair chunks scored poorly against the blended query despite excellent standalone relevance.
Feature Flag
The stage is switched by a runtime feature flag (default: off). The model used for decomposition and the maximum number of sub-questions (default 6) are configurable.
Single-Hop Regression Guard
For single-hop queries, the decomposition step either:
- Detects single-hop and passes through (zero overhead), or
- Generates exactly one sub-question identical to the reformulated query (negligible overhead)
This is designed to avoid regression on the roughly 85% of queries that are single-hop.
Cost and Latency
| Metric | Without Decomposition | With Decomposition (multi-hop) |
|---|---|---|
| LLM calls | 1 (intent) | 2 (intent + decomposition) |
| Retrieval passes | 1 | 2-4 (parallel) |
| Added latency | 0 | ~200-400ms (LLM) + ~100ms (parallel retrieval) + ~450ms × N (sequential reranking) |
| Added cost | $0 | ~$0.00003 per query |
Retrieval passes for sub-questions run in parallel, so the retrieval latency increase is minimal (bounded by the slowest sub-question, not the sum).
Implementation
This ADR was implemented on 2026-02-17 behind a feature flag, which was off by default. Administrators can toggle it at runtime.
New service
A dedicated query-decomposition service receives the post-rewrite, post-taxonomy-enrichment search query and the entities extracted during intent classification. A fast heuristic gate skips the LLM call for about 85% of queries (those with 6 or fewer words and at most 1 entity type). For the remaining queries, a Tier 2 LLM determines whether the query is multi-hop and generates focused sub-questions. The service also merges and deduplicates the evidence returned by the parallel sub-question retrievals.
Integration point
The stage sits between taxonomy enrichment and retrieval in the RAG pipeline. The integration:
- Checks the feature flag
- Calls the decomposition service if enabled
- Multi-hop: parallel sub-query retrievals, then per-sub-query reranking with round-robin interleaving
- Single-hop or disabled: standard single retrieval + single reranking
- Tracks decomposition cost and timing in the pipeline's cost tracker
Tests
30 unit tests cover all pure functions (heuristic gate, entity formatting, model parsing, evidence merging, data model). No mocking -- follows the project's no-mocking testing standard.
Evaluation Results
A/B Comparison (2026-02-17)
Golden evaluation (146 questions, v2.5.1; self-reported, scored by the project's own entity-recall measure) run twice: once with decomposition disabled (baseline), once enabled.
| Metric | Baseline (OFF) | Decomposition (ON) | Delta |
|---|---|---|---|
| Pass rate | 146/146 (100%) | 145/146 (99.3%) | -0.7% |
| Avg entity recall | 0.963 | 0.962 | -0.001 |
| Avg response time | 16,996ms | 16,863ms | -133ms |
| Total eval time | 2,628s | 2,853s | +225s |
| Safety refusal | 100% | 100% | 0% |
Key findings:
- No measured single-hop regression: All non-multi-hop categories scored 100% in both runs (self-reported). The heuristic gate correctly bypasses decomposition for simple queries.
- One non-deterministic failure: GQ-025 ("Doet ZOL niertransplantaties?") failed in the decomposition-ON run with an "information not found" response -- the same question passed in baseline. This is LLM/retrieval non-determinism, not a decomposition regression (the question is single-hop, so decomposition was not involved).
- No latency penalty: Average response time was slightly lower with decomposition enabled (16,863ms vs 16,996ms), within noise margin. The heuristic gate is designed to add no overhead for the ~85% of queries that are clearly single-hop.
- Graph DB required for full impact: The evaluation ran without the knowledge graph populated (vector-only retrieval). Multi-hop decomposition benefits are expected to be significantly higher once the graph is re-populated, as sub-questions can independently traverse graph relationships.
The detailed run reports are kept internally. As with all golden-question scores in this project, the pass rate measures entity recall and must-refuse behaviour only; it is not evidence of answer correctness or grounding.
Evaluation Methodology
The A/B experiment follows this protocol:
- Baseline run: decomposition disabled, semantic cache disabled, all 146 golden questions
- Treatment run: decomposition enabled, semantic cache disabled, all 146 golden questions
- Metrics: Entity recall (substring match against expected entities), pass/fail threshold (entity_recall >= 0.5), response time, category breakdown
- Regression guard: Single-hop questions must show no degradation across runs
Consequences
Positive
- Expected improvement on multi-hop queries: an estimated +15-25% answer completeness on ~15% of query volume (estimate; the A/B run above showed no measurable change because the knowledge graph was not populated)
- Reuses entire existing pipeline: No new retrieval infrastructure, no schema changes
- Minimal cost: ~$0.00003 per decomposed query
- Feature-flagged: Existing queries are unchanged when the flag is disabled
- Parallel sub-retrieval: Latency increase bounded by slowest sub-question, not sum
Negative
- Added latency for multi-hop: +200-400ms for the decomposition LLM call
- LLM dependency: Decomposition quality depends on the Tier 2 model's ability to identify and split multi-hop queries
- Per-sub-query reranking complexity: N parallel reranker calls + round-robin interleaving adds code complexity, though it solves the minority-topic elimination problem
Neutral
- Single-hop queries are unaffected (pass-through gate)
- Graph query paths unchanged
- Semantic cache operates on the original reformulated query (sub-questions are not cached individually)
Alternatives Considered
Alternative 1: Agentic RAG (Full Multi-Step Agent)
An LLM agent that plans retrieval steps, executes them, evaluates sufficiency, and iterates.
- Pros: Handles arbitrarily complex reasoning chains
- Cons: 3-5x latency increase, 3-5x cost increase, complex implementation
- Why rejected: Query decomposition captures 60-70% of the benefit at 10% of the complexity. Agentic RAG can be considered later if decomposition proves insufficient.
Alternative 2: Fixed Decomposition Templates
Pre-defined decomposition patterns per intent type (e.g., a doctor-lookup combined with a condition always generates 3 specific sub-questions).
- Pros: No LLM call needed, deterministic, zero latency
- Cons: Cannot handle novel multi-hop patterns, requires manual template maintenance
- Why rejected: LLM decomposition is more flexible and handles edge cases that templates miss.
References
- Ammann, P. J. L., et al. (2025). Question decomposition for retrieval-augmented generation. Proceedings of ACL 2025 SRW. https://arxiv.org/abs/2507.00355
- Tang, Y., & Yang, Y. (2024). MultiHop-RAG: Benchmarking retrieval-augmented generation for multi-hop queries. Proceedings of COLM 2025. https://openreview.net/forum?id=t4eB3zYWBK
- Asai, A., et al. (2025). PRISM: Agentic retrieval with LLMs for multi-hop QA. arXiv preprint, arXiv:2510.14278. https://arxiv.org/abs/2510.14278