Static Hard Negatives Need Global Anchors: A Controlled Study of Small-Encoder Tool Retrieval
Small bi-encoders are commonly used to shortlist tools from large registries before a language model issues a function call. Mined hard negatives are usually preferred over random ones for training such retrievers, yet we observe the opposite under a common low-memory setup. When each query is trained against one positive and four explicit negatives with no other candidates in the softmax (L_0), static BM25 negatives leave E5-small-v2 below its own untuned checkpoint on the 44,453-tool ToolRet catalog (28.71% vs. 29.65% Recall@5), while uniform random negatives reach 38.50%. Removing schema-alias duplicates, which make a quarter of training tool IDs redundant, does not help, because it changes only 2% of the sampled negatives. We then ask what in-batch negatives contribute. In a pre-specified factorial study of 60 models (two encoders, two negative sources, three loss denominators, five seeds), we compare adding other queries’ positives (L_+) with adding the same number of uniformly sampled catalog tools (L_rand). On two Model Context Protocol tool catalogs with zero query or tool-name overlap with the training data, L_rand recovers 84–99% of the BM25 gain obtained with L_+; on the larger catalog, the remaining difference lies within ±2 percentage points at the 90% level. Retrieval diagnostics agree: BM25 under L_0 concentrates results on a few hub tools and pushes gold tools far down the ranking, and both remedies reverse this. Random negatives nonetheless remain the strongest single source on every core benchmark. Static hard negatives need globally sampled negatives beside them, and comparisons between negative sources should state the full set of candidates in the loss.
Authors
- Baha Ihnaini (ORCID: https://orcid.org/0000-0002-2109-4793)
- Jingtao Jin
Institutions
- Wenzhou-Kean University (CN)
Publication Details
- Journal
- Zenodo (CERN European Organization for Nuclear Research)
- Published
- 2026-12-03
- DOI
- https://doi.org/10.5281/zenodo.24773981
- Primary Topic
- Information Retrieval and Search Behavior
- Type
- preprint