# CoHyDE：大语言模型重写器与稠密编码器的迭代协同训练，用于工具检索

- 来源：HuggingFace Daily Papers（社区热门论文）
- 发布时间：2026-05-28 08:00
- AIHOT 分数：67
- AIHOT 链接：https://aihot.virxact.com/items/cmpqyln8z09coslnom7l2t559
- 原文链接：https://arxiv.org/abs/2605.29271

## AI 摘要

CoHyDE 是一种迭代训练框架，旨在解决大语言模型智能体在大型 API 目录中进行工具检索时面临的核心瓶颈。用户查询常使用口语化、描述不充分的自然语言，而 API 目录使用固定的技术性术语。该框架将稠密编码器与 LLM 重写器视为一个协同演化系统进行训练：编码器在重写器生成的、符合目录风格的假设性描述上通过 InfoNCE 进行重训练；重写器则通过 DPO 根据编码器的检索分数进行偏好对齐。在 ToolBench 目录约 10k 工具的子集上，三轮 CoHyDE 迭代后，其在标准查询上的 NDCG@5 得分较最强单组件基线提升 +2.5 pp，在模糊查询上提升 +6.3 pp。消融实验证实，协同训练是该方法在结构化与模糊查询上均取得优势的关键。

## 正文

Tool retrieval over large API catalogs is a core bottleneck for LLM agents: user queries arrive in colloquial, often underspecified language, while the catalog uses technical API vocabulary that no fixed encoder can bridge on its own. The two dominant training approaches, contrastive encoder fine-tuning and HyDE-style query expansion with a frozen LLM, address this problem from opposite ends and fail in complementary directions: the fine-tuned encoder excels when the query's surface form already matches the catalog but collapses when it does not, while zero-shot HyDE is more robust to underspecified queries yet generates catalog-unaware hypothetical descriptions that degrade retrieval when queries are well-formed. We introduce CoHyDE, an iterative procedure that trains the dense encoder and the LLM rewriter as a single co-evolving system: the encoder is retrained with InfoNCE on catalog-style hypothetical descriptions produced by the rewriter, and the rewriter is preference-aligned via DPO against the encoder's retrieval scores, with both sides warm-started on the tool catalog before the loop begins. On a ~10k tool subset of the ToolBench catalog, three rounds of CoHyDE improve over the strongest single-component baseline by +2.5 pp NDCG@5 on standard queries and +6.3 pp on held-out vague queries, with gains as large as +8 pp on the hardest vague tier. Ablations confirm that co-training is the key ingredient: using either component in isolation fails to match CoHyDE on both well-formed and vague queries, with losses of up to -8 pp on vague queries.
