arXiv:2511.04073cs.LGcs.DB2025-11

让距离度量学会匹配过滤条件,提升多标签搜索精度。

Learning Filter-Aware Distance Metrics for Nearest Neighbor Search with Multiple Filters

  • 基于数据学习最优距离与过滤匹配的权衡
  • 相比固定惩罚方法,准确率提升5%-10%
  • 适合需要多条件过滤的向量检索场景

过滤近邻搜索(Filtered ANN)从数据集中检索与查询向量最接近的向量,同时要求每个返回结果必须包含查询指定的一组离散标签。现有基于图的方法通常通过固定惩罚或优先级来实现过滤感知,但这类方法依赖于数据无关的固定惩罚,难以适应不同标签和向量分布的数据集。本文提出一种基于数据驱动的优化框架,直接从数据中学习向量距离与过滤匹配之间的最佳权衡,将其建模为约束线性优化问题,推导出能更好反映底层标签分布的权重。这些学习到的权重同时指导搜索过程与索引构建,使图结构更有效地捕捉标签分布与语义。实验表明,通过数据自适应调整距离函数,准确率相较固定惩罚方法提升5%-10%,为过滤近邻搜索提供了更灵活、泛化性更强的解决方案。

原文摘要 · Abstract (English)

Filtered Approximate Nearest Neighbor (ANN) search retrieves the closest vectors for a query vector from a dataset. It enforces that a specified set of discrete labels $S$ for the query must be included in the labels of each retrieved vector. Existing graph-based methods typically incorporate filter awareness by assigning fixed penalties or prioritizing nodes based on filter satisfaction. However, since these methods use fixed, data in- dependent penalties, they often fail to generalize across datasets with diverse label and vector distributions. In this work, we propose a principled alternative that learns the optimal trade-off between vector distance and filter match directly from the data, rather than relying on fixed penalties. We formulate this as a constrained linear optimization problem, deriving weights that better reflect the underlying filter distribution and more effectively address the filtered ANN search problem. These learned weights guide both the search process and index construction, leading to graph structures that more effectively capture the underlying filter distribution and filter semantics. Our experiments demonstrate that adapting the distance function to the data significantly im- proves accuracy by 5-10% over fixed-penalty methods, providing a more flexible and generalizable framework for the filtered ANN search problem.

近邻搜索过滤检索距离度量图算法

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。