TL;DR
Skill retrieval for LLM agents requires finding sets of tools that are not just individually relevant, but collectively compatible and executable for a given task. This paper introduces R3-Skill, a bilingual benchmark that leverages previously discarded LLM data-generation rejections as a training signal, alongside a two-stage retrieve-and-rerank framework that significantly improves multi-skill routing performance.
What Problem Does This Paper Address?
Traditional document retrieval operates on pairwise relevance: is document A relevant to query Q? However, when LLM agents route user queries to reusable "skills" (complex, multi-step tool procedures), they often need a set of skills to execute a task.
Two skills might be perfectly relevant on their own but completely incompatible when combined—perhaps they are redundant, contradictory, or belong to entirely different programming ecosystems. Standard retrieval systems fail here because they don't account for query-conditioned set compatibility.
Methods
The authors propose the Reject-as-Resource Retriever (R3), a two-stage pipeline designed to handle both large-scale recall and fine-grained compatibility:
- R3-Embedding (Multi-Positive Recall): A bi-encoder initialized from Qwen3-Embedding-0.6B. It uses a modified multi-positive InfoNCE loss function designed to handle "sibling positives" (multiple skills required by a single query) so they aren't accidentally treated as negative samples during batch training.
- R3-Reranker (Rejection-Aware Listwise Ranking): A cross-encoder trained using a listwise ranking loss (ListNet) with graded labels. Crucially, it incorporates "SKIP" data (combinations of skills that an LLM generator rejected during dataset creation because they didn't make sense together) as intermediate negative signals (assigned a label of 1), while true matches get a label of 3, and other negatives get 0.
Datasets
- R3-Skill (New): A Chinese–English benchmark containing 10,246 deduplicated skills, 41,592 accepted queries (
WRITE), and 32,828 rejected annotations (SKIP) across four language directions (en2en,en2zh,zh2en,zh2zh). It categorizes rejections into an 8-class taxonomy (e.g., domain mismatch, forced chaining, function redundant) based on LLM rationales. - SkillRet: An existing English skill retrieval benchmark used to test the cross-benchmark transferability of the trained models.
Key Insights and Ideas
- Rejections are a feature, not a bug: During synthetic data generation, LLMs frequently reject random skill combinations because they cannot form a logical, natural user request. Instead of throwing this data away, R3 treats it as a valuable negative supervision signal for what not to retrieve together.
- Architecture dictates where signals belong: The authors discovered that trying to force this "compatibility" signal into the bi-encoder (embedding stage) actually hurts performance. Because a bi-encoder maps a skill to a single query-independent vector, conflicting query constraints cause structural degradation. A cross-encoder (reranker), however, scores pairs dynamically and thrives on this query-conditioned interaction data.
- Set-Compat over simple Recall: Evaluating agent routing requires stricter metrics. The paper introduces
Set-Compat(SC), which checks if all required skills are ranked within the top-$M$ slots (where $M$ is the exact number of required skills), reflecting the tight context windows of real-world agents.
Key Results
- State-of-the-Art Routing: On the R3-Skill benchmark, the full R3 pipeline achieved 75.39% Hit@1, 81.97% NDCG@10, and 33.27% Set-Compat.
- Massive Compatibility Gains: The R3-Reranker delivered a 36.6% relative gain in Set-Compat over the strongest reranking baseline, proving that learning from explicit rejections helps the model understand tool composition.
- Strong Zero-Shot Transfer: When evaluated on the external SkillRet benchmark, R3-Reranker demonstrated excellent transferability without any further tuning, achieving 83.87% NDCG@10 and outperforming domain-specific baselines.
Limitations and Future Work
The authors note several limitations within the current scope of R3-Skill:
- The evaluation queries are entirely synthetic rather than derived from live user traffic.
- The non-English (Chinese) skill pool remains relatively small compared to the English pool.
- The rejection taxonomy relies on rule-based heuristics to parse LLM rationales, which can leave some rejections uncategorized.
- Reranking is computationally constrained to the top-20 candidates. Future work should evaluate larger multilingual registries and end-to-end agent execution budgets.
Summary updated