← Research
Agent Skills · Retrieval

Skill Retrieval Needs a Set-Level Lens

Treating skill libraries like document stores misses the core problem: an agent doesn't need the most relevant skill, it needs the most compatible set of skills. Tencent researchers prove mathematically why bi-encoders can't solve this, and build a two-stage retriever that mines LLM rejection decisions as training signal.

Wang, Wen et al. · Tencent · 2026 arXiv:2606.03565 Code & Data Synthesized July 24, 2026

First surfaced in Tandemly Briefing — 2026-06-24.

TL;DR

Standard retrieval picks the top-k most similar items independently. For agent skill libraries, that's wrong: a task often requires a compatible set of skills to execute, and the most individually relevant skills may not work together. This paper establishes the problem formally, proves a structural barrier that prevents bi-encoder embeddings from learning compatibility signals, then fields a two-stage system (embed + rerank) that turns LLM rejection decisions into training signal for the reranker.

The results: set-level compatibility accuracy jumped from 22.2% to 35.3%, a 13-point gain, while per-item accuracy improved more modestly (+6.9pp Hit@1). The gap between those two numbers is the point -- compatibility is the harder and more important problem.

The Problem

When an LLM agent receives a task, it queries a skill library and retrieves a set of tools or functions to invoke. Most skill retrieval systems were adapted from document retrieval: embed the query, embed each skill, retrieve the highest-cosine-similarity candidates. This treats retrieval as an independent-item problem.

Two things go wrong with that framing:

What document retrieval optimizes

Each retrieved document answers the query on its own. The quality of result k is independent of result k-1.

Evaluation: did the top-1 result contain the right answer? Did top-10?

What skill retrieval actually needs

The task requires a set of skills that can be composed. A skill that is individually relevant may fail when combined with the others retrieved alongside it.

Evaluation: did the entire ground-truth skill set appear simultaneously in the top-m results?

The second problem is training signal. Compatibility information -- which skills work together -- is expensive to label. But LLMs already produce a latent source of it: every time a model is asked whether a skill fits a task and declines, that rejection encodes a negative compatibility judgment. Nobody had formalized this as training signal, and nobody had proved whether standard bi-encoder models could use it even if they tried.

The Solution

The paper contributes three things: a benchmark, a theorem, and a retriever.

1

R3-Skill Benchmark

5,696 test queries paired against 2,050 skills. Tasks require multi-skill execution, so each query has a ground-truth set of correct skills, not a single correct answer. The new Set-Compat metric measures whether every member of the ground-truth set appears simultaneously in the top-m retrieved results. Queries span tool-use tasks in Chinese and English, enabling cross-lingual evaluation.

2

Bilateral Balancing Theorem

A formal proof that bi-encoders (dual encoders that embed query and skill independently before comparing via dot product) cannot learn compatibility signals. The core issue: rejection-based negatives push a query embedding away from a skill embedding in both directions simultaneously, creating a balancing force that cancels out. Cross-encoders, which process the query and skill jointly in a single forward pass, can encode the relational structure that compatibility requires.

3

Two-Stage Retriever (R3)

Stage 1 is a bi-encoder (R3-Embedding-0.6B) trained without rejection signals (per the theorem), used for fast recall of a top-20 candidate set. Stage 2 is a cross-encoder reranker (R3-Rerank-0.6B) trained with LLM rejection decisions as negative signal -- called SKIP signals. The reranker sees query and skill jointly and re-scores the top-20 for compatibility-aware ordering. Both models are 0.6B parameters.

What "Reject-as-Resource" means in practice: when an LLM is asked to assign a skill to a task and it declines ("this skill doesn't fit"), that decision is logged as a structured negative example. The reranker is then trained to reproduce those compatibility distinctions. The rejections are free signal that teams already produce; the paper is the first to formalize their use in retriever training.

Findings & Benchmarks

Results on the R3-Skill benchmark comparing the bi-encoder stage alone against the full two-stage system:

+13.1 pp gain Set-Compat (22.2 → 35.3)
+6.9 pp gain Hit@1 (70.2 → 77.1)
+2.6 pp gain NDCG@10 (80.6 → 83.3)
+13.3 pp gain Set-Compat en→zh

The contrast between the Set-Compat gain (+13.1pp) and the Hit@1 gain (+6.9pp) is the key diagnostic. Set-Compat is the metric that actually measures whether a compatible skill set was retrieved. Its gain is nearly twice the per-item gain, confirming the reranker's SKIP signal training is doing exactly what the theorem predicted it would: improving set-level compatibility rather than just individual relevance.

The ablation results confirm the theorem directly. Adding SKIP signals to the bi-encoder embedding stage slightly hurt performance, consistent with the bilateral balancing prediction. Adding SKIP signals only to the reranker stage produced the large gains. The cross-lingual generalization result (en-to-zh Set-Compat +13.3pp) suggests the compatibility signals transfer across languages, not just within them.

The core reading: if your skill retrieval system only tracks Hit@1, you are optimizing for the wrong thing. The Set-Compat results show that even when the embedding model gets the right individual skill into its top-k, the final ordered set often misses the full compatible combination. The reranker -- and only the reranker -- closes that gap.

Practical Takeaways

Getting Started

The benchmark, both models, and training code are publicly released. The models are 0.6B parameters, making them practical to run alongside larger agent LLMs without prohibitive infrastructure costs.

Benchmark
github.com/Tencent/R3-Skill
data/test.jsonl (5,696 queries) · data/skills_test.jsonl (2,050 skills)

To evaluate your own skill retrieval system against the R3-Skill benchmark, run your retriever against the test queries and score with both Hit@k and Set-Compat. The Set-Compat score requires the full ground-truth skill set to appear simultaneously in your top-m results -- start with m=20, the same recall depth used in this paper's bi-encoder stage.

To use rejection signals for training a compatibility reranker: log your LLM's skill-assignment decisions during annotation or active deployment, filter for explicit decline events, and format them as (query, declined-skill) negative pairs for cross-encoder training. The paper's training setup for R3-Rerank-0.6B uses these pairs alongside standard (query, correct-skill) positives.