CoHyDE: 用于工具检索的LLM改写器与稠密编码器的迭代协同训练
CoHyDE: Iterative Co-Training of LLM Rewriter & Dense Encoder for Tool Retrieval
AI总结:
提出CoHyDE方法,通过迭代协同训练稠密编码器和LLM改写器,结合对比学习和偏好对齐,在工具检索任务中同时提升标准查询和模糊查询的性能。
摘要:
在大规模API目录上的工具检索是LLM智能体的核心瓶颈:用户查询以口语化、通常不明确的语言出现,而目录使用技术性API词汇,没有固定的编码器能够单独弥合这一差距。两种主要的训练方法,对比编码器微调和基于冻结LLM的HyDE式查询扩展,从相反的角度解决这个问题,并在互补的方向上失败:微调编码器在查询的表面形式与目录匹配时表现出色,但在不匹配时性能崩溃;而零样本HyDE对不明确的查询更鲁棒,但生成不感知目录的假设描述,当查询形式良好时检索性能下降。我们提出CoHyDE,一种迭代过程,将稠密编码器和LLM改写器训练为单个共同演化的系统:编码器使用改写器生成的目录风格假设描述通过InfoNCE重新训练,改写器通过DPO基于编码器的检索分数进行偏好对齐,两者在循环开始前在工具目录上进行热启动。在ToolBench目录的约10k工具子集上,三轮CoHyDE在标准查询上比最强的单组件基线提高+2.5个百分点的NDCG@5,在保留的模糊查询上提高+6.3个百分点,在最难的模糊层级上增益高达+8个百分点。消融实验证实协同训练是关键因素:单独使用任一组件都无法在形式良好和模糊查询上匹配CoHyDE,在模糊查询上损失高达-8个百分点。
英文摘要:
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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。