advanced generation-grounding 24 min read

Adaptive Retrieval Routing: Choosing a Strategy per Query

The published gate decided whether to answer; this one decides how hard to try — a router over retrieval strategies whose optimum is Chow's rule with more than two actions, whose achievable region is a convex hull, and whose entire possible gain is a Jensen gap that vanishes exactly when the strategies never change places

From a binary gate to a choice of effort

The selective-generation topic ended with a decision that had two actions. Given a candidate answer and a score meant to be its probability of correctness, emit it or abstain, cutting at Chow’s threshold t=1cabs/cerrt^\star = 1 - c_{\mathrm{abs}}/c_{\mathrm{err}}. That gate is genuinely useful and genuinely limited: it can decline to answer, but it cannot try harder.

Trying harder is what the rest of the stack is for. A query that a single dense retrieval fails on might be answered by iterating — retrieving, reading, reformulating from what was read, retrieving again. A query whose answer the system already holds might need no retrieval at all. These are not refinements of one method; they are different strategies with different prices, and nothing so far decides between them.

So the object changes again. Where the gate chose between answering and declining, a router chooses among strategies, and it has to choose before it knows how any of them will turn out — using only what is visible about the query itself. The decision is now genuinely economic: every arm has a cost, the expensive ones are sometimes worth it, and the entire question is whether you can tell in advance which times those are.

That last clause is where this topic spends most of its honesty. It is easy to show that a router could help. The harder and more useful result is a precise statement of how much it could help at most, and a measurement of how much of that a real one actually collects.

The rule, with more than two actions

Fix a set of arms a{1,,K}a \in \{1, \dots, K\} — here: answer from the query alone, retrieve once, or iterate. Each arm applied to query xx yields an answer of quality Qa(x)[0,1]Q_a(x) \in [0,1] and consumes a resource cost ca>0c_a > 0. A router is a policy π\pi mapping xx to an arm, using only a feature vector ϕ(x)\phi(x) computable before any retrieval fires. That restriction is not fastidiousness: a feature that requires the retrieved set has already paid the cost the router exists to decide about, and a rule that uses one is a reranker wearing a router’s name.

Theorem 1 (The K-action rule, and Chow's rule as its two-action case).

Let the expected loss of taking arm aa on query xx be the cost of being wrong plus the cost of the work:

La(x)=cerr(1Qa(x))+ca.L_a(x) = c_{\mathrm{err}}\big(1 - Q_a(x)\big) + c_a .

Minimizing pointwise over aa, and discarding the constant cerrc_{\mathrm{err}}, gives

π(x)=argmaxa{cerrE[Qaϕ(x)]ca}=argmaxa{E[Qaϕ(x)]λca},\pi^\star(x) = \arg\max_a \Big\{ c_{\mathrm{err}}\, \mathbb{E}\big[Q_a \mid \phi(x)\big] - c_a \Big\} = \arg\max_a \Big\{ \mathbb{E}\big[Q_a \mid \phi(x)\big] - \lambda\, c_a \Big\},

writing λ=1/cerr\lambda = 1/c_{\mathrm{err}} for the price of a unit of retrieval in units of answer quality.

Now take K=2K = 2 with the actions emit and abstain. Emitting has quality ss, the probability the answer is correct, and no resource cost. Abstaining has quality 00 and bookkeeping cost cabscerrc_{\mathrm{abs}} - c_{\mathrm{err}}, which is exactly what makes its loss cerr(10)+(cabscerr)=cabsc_{\mathrm{err}}(1-0) + (c_{\mathrm{abs}} - c_{\mathrm{err}}) = c_{\mathrm{abs}}. The rule then reads

emit    cerr(1s)<cabs    s>1cabscerr=t,\text{emit} \iff c_{\mathrm{err}}(1 - s) < c_{\mathrm{abs}} \iff s > 1 - \frac{c_{\mathrm{abs}}}{c_{\mathrm{err}}} = t^\star,

which is Chow’s rule. The router does not replace the published gate; it contains it.

That reduction is verified rather than asserted: the notebook computes the K=2K=2 rule and the imported chow_decision on the same scores across four cost ratios and requires them to agree on every query. It is worth insisting on, because it fixes what kind of object a router is. It is not a heuristic bolted on top of a retrieval stack. It is the same decision-theoretic argmax the stack already used, with the action set widened from two to three.

What a router can win, at most

Suppose the estimation problem were solved — the router knew each arm’s quality on each query exactly. How much better than a fixed strategy would it be? The answer is clean, and it is the result to carry out of this topic.

Write Ua(x)=Qa(x)λcaU_a(x) = Q_a(x) - \lambda c_a for the utility of arm aa on query xx.

Theorem 2 (The routing gain is a Jensen gap).

Let the oracle be the policy that picks the best arm for each query with perfect foresight, and the best fixed arm be the single arm with the highest average utility:

Oracle=E[maxaUa(x)],BestFixed=maxaE[Ua(x)].\mathrm{Oracle} = \mathbb{E}\Big[\max_a U_a(x)\Big], \qquad \mathrm{BestFixed} = \max_a \mathbb{E}\big[U_a(x)\big].

Then

OracleBestFixed=E[maxaUa]maxaE[Ua]    0,\mathrm{Oracle} - \mathrm{BestFixed} = \mathbb{E}\big[\max_a U_a\big] - \max_a \mathbb{E}\big[U_a\big] \;\ge\; 0 ,

since the maximum of expectations is bounded by the expectation of the maximum. The inequality is strict if and only if argmaxaUa(x)\arg\max_a U_a(x) is not almost surely constant.

The corollary is what makes this worth knowing.

Corollary 3 (Routing is worthless when the arms never change places).

If one arm maximizes Ua(x)U_a(x) for almost every xx, the gap is zero and no router, however well estimated, beats simply always using that arm. The gain available to routing is not a property of the classifier. It is a property of whether the strategies ever reverse.

This is a sharper claim than the usual argument for adaptive retrieval, which tends to observe that some queries are harder than others and conclude that routing must therefore pay. Heterogeneity in difficulty is not enough. If iterating is better than retrieving once on the hard queries and on the easy ones — merely by a smaller margin — then the ordering never reverses, the gap is zero, and the right system always iterates. What routing needs is heterogeneity in which arm wins, and those are different conditions.

The laboratory’s second panel makes the corollary a thing you can do rather than read. The gap is recomputed in the browser from the per-query quality matrix for any cost weight; toggling the control gives every arm the same per-query signal plus a fixed offset, so the ordering cannot vary, and the gap collapses to exactly zero while the arms remain visibly different from one another.

knownanswerable from the query0.42 · 24/24 right0.77 · 24/24 right0.74 · 24/24 rightlocalone company, ambiguous0.29 · 24/24 right0.65 · 23/24 right0.64 · 22/24 rightbridgecompositional (two entities)0.05 · 0/24 right0.05 · 0/24 right0.28 · 14/24 right01 · posterior mass on the gold company
no retrieval (cost 0)retrieve once (cost 1)iterate (cost 3)

The compositional class is the whole reason a router can exist here. A single retrieval reaches the mentioned company 0 times out of 24 — never — because the bridge filing points mostly at the company it is about, not the one it names; only reformulating off it recovers the second direction. On the easy class all three arms are already right 24/24 of the time, so routing there is purely a question of what you are willing to pay.

72 synthetic finance queries in three classes over one passage set, 36 held out. Arm costs are 0 / 1 / 3 retrievals; the spread is load-bearing, since with costs close together the frontier collapses to a point. Every arm is the same answer model reading different evidence, so a quality difference is attributable to the strategy alone. Numbers mirror adaptive_retrieval_routing.py; Panel B recomputes the entire Jensen decomposition live from the baked per-query matrix. The corpus, the features, and the arm costs were all chosen against this corpus — the transferable claim is the shape of the argument, not these decimals.

The achievable region is a hull

Theorem 1 gives a family of policies indexed by λ\lambda, not a single policy. Sweeping λ\lambda from zero upward moves from buying quality at any price to refusing to retrieve at all, and each value yields one deterministic policy and one point in the cost–quality plane.

Proposition 4 (The achievable set is the convex hull of the lambda-indexed policies).

Let Pλ=(E[cπλ],E[Qπλ])P_\lambda = (\mathbb{E}[c_{\pi_\lambda}], \mathbb{E}[Q_{\pi_\lambda}]). Randomizing between two policies with probability θ\theta and 1θ1-\theta produces the corresponding convex combination of their points, because both coordinates are expectations and expectation is linear. Hence every point on the segment joining two achievable points is achievable, the achievable set is conv{Pλ}\mathrm{conv}\{P_\lambda\}, and its upper-left boundary is concave.

Under a hard budget E[cπ]B\mathbb{E}[c_\pi] \le B rather than a price λ\lambda, the optimum is attained by randomizing between the two adjacent deterministic policies that bracket BB — the familiar correspondence between a penalized and a constrained program.

Three frontiers therefore sit one above another: the hull of the fixed arms, which is what is achievable with no features at all; the achievable frontier of a fitted router; and the oracle’s. The vertical distance between the first and the third is the Jensen gap of Theorem 2, and the position of the middle curve is the empirical question.

On the held-out half of this corpus, the oracle reaches mean quality 0.5460.546 at a mean cost of 1.251.25 retrievals, while always iterating — the best fixed arm — reaches only 0.5220.522 at a cost of 3.03.0. Perfect routing would buy better answers for a little over forty percent of the price. That is the prize. The rest of the topic is about how much of it is collectible.

What a real router collects

Replace E[Qaϕ(x)]\mathbb{E}[Q_a \mid \phi(x)] with an estimate Q^a(ϕ(x))\widehat{Q}_a(\phi(x)) fitted on held-aside queries, and the rule becomes π^(x)=argmaxa{Q^a(ϕ(x))λca}\hat\pi(x) = \arg\max_a \{\widehat{Q}_a(\phi(x)) - \lambda c_a\}.

Proposition 5 (Excess loss is controlled by estimation error).

For any xx, if π^(x)π(x)\hat\pi(x) \ne \pi^\star(x) then the utility forgone is at most aQ^a(ϕ(x))E[Qaϕ(x)]\sum_a \big| \widehat{Q}_a(\phi(x)) - \mathbb{E}[Q_a \mid \phi(x)] \big|, since the chosen arm’s estimated utility was at least the optimal arm’s, and each can be off by at most its own error. Taking expectations bounds the excess loss of π^\hat\pi over π\pi^\star by the summed L1L_1 estimation error across arms.

The router is therefore no better than the calibration of the numbers it compares — precisely the caveat Chow’s rule carried one level down, where the threshold was only as good as the score it cut. And the measurement is unkind. On this corpus the fitted quality model has an expected calibration error of 0.140.14 to 0.180.18, and the consequences are visible at every operating point:

  • At λ=0.20\lambda = 0.20 the router gains +0.043+0.043 over the best fixed arm on held-out queries, which is 58%58\% of the oracle’s +0.075+0.075, and a paired tt-test puts it at p=0.022p = 0.022.
  • At λ=0.02\lambda = 0.02 it gains +0.018+0.018, about 31%31\% of the available gap — but p=0.24p = 0.24, so at thirty-six held-out queries this is not distinguishable from zero.
  • At λ=0.05\lambda = 0.05 it gains +0.002+0.002: 3.5%3.5\% of a gap of +0.062+0.062, and p=0.90p = 0.90. The gap is there; the router does not find it.
  • At λ=0.10\lambda = 0.10 it gains 0.020-0.020. The oracle would win by +0.054+0.054 here, and the fitted router loses to always retrieving once.

That last line is the one worth sitting with. A positive Jensen gap is a statement about what perfect foresight would buy. It is not a promise that any realizable rule captures any of it, and at one of four operating points here the realizable rule is worse than not routing at all. A gap that exists is not a gap you can collect.

And in-sample measurement conceals exactly this. At every operating point the router’s gain measured on the queries that fitted it exceeds its gain on held-out queries — which is why the penalty on the quality model is chosen by cross-validation inside the calibration half. Choosing it against the test half would be the same optimism one level up, and would have produced a considerably more flattering set of numbers.

Why the compositional class is the hard part

The three query classes were built to make the arms reverse: a class answerable from the query alone, a class needing one retrieval, and a compositional class whose answer is a company that a bridge filing names rather than describes. On the last of these, a single retrieval reaches the answer in none of the twenty-four cases, and iterating reaches it in fourteen — the reversal Theorem 2 requires.

But the router has to identify that class before retrieving, and the obvious features do not. Entropy of the query-only answer distribution, the nearest-prototype cosine, and the margin between the top two cosines all place the compositional class between the other two rather than apart from them. The reason is geometric and slightly counterintuitive: a compositional query’s closest competitor is not the company it mentions but a neighbor of the company it is about, sitting in the same sector shell. The top-two margin is measuring the wrong pair.

What separates the class is the largest cosine to a prototype outside the sector of the nearest one — a direct measure of whether the query reaches across sectors at all. With the first three features the router collapses to always-retrieving-once at moderate λ\lambda and gains nothing whatsoever; with the fourth it becomes the imperfect but occasionally useful rule measured above. That feature was chosen against this corpus, and the honest reading is that the transferable claim is Theorem 2 rather than any particular feature set.

Where this sits

Adaptive-RAG, Self-RAG, and Corrective RAG are routinely presented as three architectures. Read along the axes that matter — how many times retrieval fires, what the retrieval unit is, how a document is represented — they occupy one point, and differ only in where the decision to continue is housed: in a front-door classifier, inside the generator as reflection tokens, or in an external evidence grader. This topic formalizes the first placement, and the analysis is indifferent to which is chosen. Theorem 2 constrains all three equally, because it is a statement about the arms rather than about the mechanism that selects among them.

What is left open is the part this corpus cannot reach. A router that bounded its own regret rather than merely reporting it would need the distribution-free machinery the prerequisite gate used for its threshold, applied now to a comparison among arms rather than to a single cut. And the question of whether the advantage ordering reverses on real corpora — as opposed to on one built so that it does — is an empirical one that a synthetic study is not entitled to answer.

Connections

  • The iterative arm is that topic's reformulation operator used as one action among several rather than as the method: its residual step q' = normalize(d − ⟨d,q⟩q) is imported verbatim, and the compositional query class here is built on the same mention geometry, so the arm that wins on those queries wins for exactly the reason that topic proved — a single retrieval cannot reach a company that is named rather than described. What is new is that iterating is now a choice with a price rather than the plan. multi-hop-iterative-retrieval
  • The router's cheapest feature is the entropy of that topic's query-only answer distribution, and its no-retrieval arm IS that distribution — the degenerate zero-weight case of the multi-document posterior. The bits-of-retrieval framing is what makes a no-retrieval arm principled rather than a stub: when retrieval adds nothing measurable to the answer posterior, paying for it is pure cost, and the router is the mechanism that declines to pay. pmi-retrieval-value
  • Supplies both halves of the honest accounting: the paired t-test that decides whether a routing gain of +0.043 at n = 36 is distinguishable from zero at all, and the expected-calibration-error machinery that measures the predictor the router compares. The calibration number is not decoration — it is the mechanism behind the router failing to collect the gap that Theorem 3 says is there. significance-testing-calibration
  • The capstone allocated one budget across the stages of a single pipeline by water-filling, equalizing marginal recall per unit cost; this allocates across whole strategies rather than stages, and the lambda sweep is the same Lagrangian structure one level up. Its lesson transfers intact and was decisive here: without genuine cost asymmetry between the arms the allocation problem is vacuous, which is why the arm costs are spread 0 : 1 : 3 rather than clustered. capstone-multimodal-financial-rag
  • Supplies the metrics-as-estimators thesis this topic applies to its own headline. A routing gain is a sample mean over queries and gets a standard error and a paired test, not a victory lap — which is how the finding that only one of four operating points is significant came to be reported rather than quietly averaged away. set-metrics-precision-recall-map-mrr

References & Further Reading