Tool Retrieval · Distribution Shift

Your retriever works fine.
Until the questions change.

A tool-retrieval system trained on one style of query covers 86.1% of requests from that source. Mixed into a production stream with other query styles, that number falls to 22.3%. The tool corpus hasn't changed. The correct answers haven't changed. The only thing that changed is how the questions are phrased.

Core concept
Source-style collapse: a retriever fine-tuned on one query source style fails silently on queries from other sources, even with the same tool set and the same ground-truth answers. A TF-IDF routing guard with 20 examples per source restores coverage to the single-source baseline.

First surfaced in Tandemly Briefing — 2026-08-17.

scroll to explore

Same tools.
Different questions. Total failure.

Tool-retrieval benchmarks typically test a system on the same kind of queries it was trained on. Production doesn't work that way. And the gap between these two conditions is larger than almost anyone has measured.

When you deploy a tool-retrieval system, queries arrive from many places at once. A developer writes system-prompt instructions in one style. A user types a free-text request in another. An agent generates a sub-call in a third. An API integration formats its requests in a fourth. Each source writes queries differently, and each one phrased the same underlying need in its own vocabulary and structure.

The problem is that a retriever fine-tuned on queries from one of those sources doesn't automatically generalize to the others. It learned a pattern specific to its training distribution. When queries from a different source arrive, the pattern doesn't match, and the retriever fails. The tool corpus is unchanged. The correct tool for each request is the same as it always was. The failure is entirely in the mismatch between how the retriever learned to read questions and how the new queries are asking them.

This failure is invisible to most standard evaluations. Most benchmarks evaluate a retriever on the same source style it was trained on, or they mix sources without tracking which queries came from which source. The result is a reported coverage number that looks reasonable in testing and a system that quietly stops working in production whenever a new query source enters the mix.

The question this paper asks

When a tool retriever that works well on its training source is exposed to queries from a different source, what exactly fails, how bad is it, and what is the cheapest intervention that restores coverage without touching the tool corpus or retraining the retriever from scratch?

4,996 mixed queries.
One routing layer. 20 examples.

The researchers split a tool-query benchmark by source style, tested cross-source retrieval failure, ruled out formatting as the cause, then built a detection and routing intervention with a minimal labeled budget.

The study used ToolRet, a benchmark that spans multiple distinct source styles of tool-query pairs. The experimental design was clean: fine-tune a retriever on one source slice, then test it on other source slices of the same benchmark, keeping the tool corpus fixed throughout. This isolates the effect of query-source style from everything else that might vary between training and test conditions.

The researchers considered whether the failure might be a formatting artifact rather than a true style problem. Tool specifications can be presented in many formats: raw API schemas, executable function signatures, or structured skill cards with descriptions and examples. If the failure were simply about schema formatting, changing the tool representation would fix it. So they rerendered the tools as executable skill cards and ran the same cross-source test. The failure persisted. Source-style collapse is not a formatting problem.

The proposed fix, ToolScout, has two stages. In the first, each incoming query is fingerprinted using TF-IDF features, a bag-of-words frequency signature that doesn't require any embedding model or large dataset to compute. The signature is compared against seed examples from each known source style to determine which style the query most resembles. In the second stage, the query is routed to a retriever adapted for that style. The seed set required to make this work is 20 examples per source style, a number deliberately kept small to make the intervention practical without extensive labeling.

The full evaluation ran 4,996 queries across a mixed stream containing multiple source styles, measuring coverage and a coverage-weighted global top-1 proxy before and after applying the ToolScout routing layer.

Why TF-IDF and not semantic similarity

The researchers compared TF-IDF fingerprints against semantic embedding similarities and length-based proxies as source-style detectors. TF-IDF outperformed the others. This is a mild but meaningful result: the signal that identifies which source a query came from is in its vocabulary and term frequencies, not in the geometric distance between query embeddings. You don't need a large embedding model to classify the style of an incoming query.

86 percent becomes 22.
Then back to 86.

Coverage collapse is sharp and the recovery is nearly complete. Both numbers matter for how you think about tool-retrieval systems in production.

Coverage with ToolScout
86.1%
mixed stream (up from 22.3%)
Coverage without routing
22.3%
same mixed stream, no intervention
Labeled examples required
20
per source style, no LLM fine-tuning
Finding 1: Coverage collapse is severe on mixed streams

A retriever achieving 86.1% coverage on queries from its training source falls to 22.3% when the same queries are mixed with queries from other sources. That is not a gradual degradation. It is a floor collapse. More than three-quarters of requests in a mixed production stream are uncovered, and standard aggregate task-success metrics don't surface this because they don't track which queries succeeded by source type.

The global top-1 proxy metric, which weights coverage across source styles, gives an even starker picture: 1.3% before ToolScout across five collapsed sources. A system at 1.3% global top-1 is effectively guessing at scale.

Finding 2: A cheap routing layer nearly recovers full coverage

ToolScout raised coverage from 22.3% to 86.1% on the 4,996-query mixed stream, and the coverage-weighted global top-1 proxy from 1.3% to 53.9% across the five collapsed sources. The cost is 20 labeled examples per source style, TF-IDF computation, and no LLM fine-tuning. The retriever itself is not retrained. The tool corpus is not modified. The routing layer sits above both and redirects each query to the retriever most likely to handle its style.

Without routing
Coverage: 22.3%. A retriever trained on one source style and deployed on a mixed stream misses more than three-quarters of requests. The tool corpus is intact. The correct answers are present. The failure is entirely in the mismatch between training-time query distribution and runtime query distribution.
With ToolScout
Coverage: 86.1%. TF-IDF fingerprints classify each incoming query by source style. The query is routed to a retriever adapted for that style. 20 labeled examples per source are enough to make the classifier work. The intervention requires no changes to the tool corpus, the retriever architecture, or the base model.
Scope and limitations

The study uses ToolRet specifically, and the 20-examples-per-source threshold was sufficient for the five collapsed sources tested. Whether that threshold scales to more diverse or more numerous source styles in a real deployment is not established by this paper. The finding that TF-IDF outperforms semantic similarity for source-style detection is also measured within the benchmark's own query distribution; external replication would strengthen it.

The paper also rules out raw API-schema formatting as the sole cause of collapse but does not test every possible tool-representation format. The persistence of the failure under executable skill-card rendering is evidence against a pure formatting explanation, not proof that all formatting choices are irrelevant.

Fingerprint your queries
before tuning your retriever.

The failure is in the training distribution, not the tool content. That means the diagnostic comes before the fix, and the diagnostic is cheap.

1
Audit your production query stream by source
Before investing in better retrieval models or larger tool corpora, understand where your queries come from. Sample 200 to 500 live queries, compute TF-IDF term frequencies, and cluster them. If the clusters don't match the distribution your retriever was trained on, you have a routing problem that content improvements cannot fix. This diagnostic costs no infrastructure and no labeling beyond the sample itself.
2
Track coverage by query source, not just overall
Overall coverage can look healthy while coverage within individual source styles collapses. If you cannot break your coverage metric down by the source of each query, you have a measurement gap. Add source labeling to your query logging, then track per-source coverage as a standing operational metric alongside aggregate task success.
3
Build a routing layer before retraining the retriever
If you identify a source-style collapse, the cheapest intervention is routing, not retraining. Collect 20 labeled examples from each source style in your production stream, use them to train a TF-IDF-based source classifier, and route each incoming query to the retriever adapted for its source style. This costs 20 examples per source, no LLM fine-tuning, and no changes to the retriever architecture or tool corpus. Measure coverage before and after to confirm the lift.
4
Treat this as a sibling problem to retrieval precision at scale
The prior work from Demystifying Agent Skills established that retrieval precision collapses as the tool pool grows from 5 to 100 entries, a failure independent of skill content quality. This paper establishes that retrieval coverage collapses as query-source diversity grows, a failure independent of tool corpus quality. Both failures are invisible to aggregate task-success metrics. Both have cheap targeted fixes. The practical implication is to diagnose which failure you have before choosing an intervention: pool size and source distribution shift require different tools.
5
Check benchmark training/test source overlap before trusting published numbers
If a published retrieval accuracy number comes from a benchmark where the test set draws from the same source style as the training set, that number does not predict production performance on a mixed-source stream. Before adopting a retriever based on benchmark performance, verify whether the benchmark's query sources overlap with your production query sources. If they don't, treat the published number as an upper bound, not a forecast.

Where to go
from here.

Source-style collapse is diagnosable and fixable with minimal investment. Here is a concrete path to applying what this paper found.

1
Run a query-source fingerprint audit
Export a sample of recent production queries (aim for at least 200). Compute TF-IDF vectors. Use k-means or hierarchical clustering with k=3 to 5. If you see clearly separated clusters, label a few examples from each to identify which sources produced them. This is the diagnostic step that determines whether ToolScout-style routing is indicated.
2
Build per-source coverage baselines
Run your current retriever against a held-out set of queries from each identified source. Record coverage separately for each source. The gap between your best-performing source and your worst-performing source is the coverage collapse you need to close. This baseline tells you which sources to prioritize for routing adaptation.
3
Collect 20 seed examples per collapsed source style
For each source where coverage is poor, collect 20 representative query examples. These become the seed set for TF-IDF source classification and the adaptation examples for routing to an appropriate retriever variant. 20 examples is the threshold the paper validated; you can experiment with fewer or more, but start at 20 and measure coverage before expanding the labeling effort.
4
Read alongside the skill-retrieval cluster
This paper sits inside a cluster of related work on agent skill and tool retrieval. Demystifying Agent Skills measured retrieval precision collapse as pool size grows. Skill-Is-Not-Document introduced set-level compatibility as a retrieval target distinct from per-item relevance. Reading all three together gives a clearer picture of what the retrieval bottleneck actually consists of in a real skill library.
5
Read the paper
Liu, Y., James, J., Wang, Y., Xiao, C. & Lin, C. (2026). When Tool-Backed Skill Retrieval Fails: Source-Style Collapse in Executable Capability Retrieval. arXiv:2608.16502. The ToolRet benchmark split methodology and ToolScout routing design are the main deliverables; the paper also includes the comparison between TF-IDF, semantic similarity, and length-based proxies as source detectors, which provides vocabulary for choosing among detection approaches.