arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2306.07607cs.IRstat.ML
收藏

稀疏数据下基于图的ANN算法实践:卡方双塔模型、HNSW、符号柯西投影

Practice with Graph-based ANN Algorithms on Sparse Data: Chi-square Two-tower model, HNSW, Sign Cauchy Projections

Ping Li, Weijie Zhao, Chao Wang, Qi Xia, Alice Wu, Lijun Peng

AI总结:

本研究针对稀疏数据场景,提出卡方双塔模型生成稀疏嵌入,结合符号柯西随机投影与HNSW类图基ANN算法,在广告定向等场景下降低内存开销、提升检索效率。

摘要:

稀疏数据十分常见,传统的“手工构造”特征通常是稀疏的,训练得到的模型生成的嵌入向量也可能非常稀疏,例如通过“ReLU”激活函数训练出的嵌入。本文针对工业界搜索、广告等场景广泛应用的基于图的ANN算法(如HNSW,以及其GPU版本SONG),探索了其在稀疏数据上的高效搜索方案。\n我们在自有广告定向应用及公开基准数据集上开展实验。针对广告定向场景,我们采用标准“余弦双塔”模型训练嵌入,同时提出了“卡方双塔”模型。两类模型结合ReLU激活函数后,都会生成(高度)稀疏的嵌入。在EBR(基于嵌入的检索)应用中,嵌入训练完成后,核心的后续任务是用于服务的近似近邻(ANN)搜索。可选的ANN算法种类繁多,本研究聚焦于基于图的ANN算法(如HNSW类算法)。\n稀疏嵌入有助于提升EBR的效率,一方面可降低嵌入的内存开销,另一方面能减少相似度计算的耗时——因为对于HNSW这类基于图的ANN算法,相似度计算往往是主要开销。除了利用数据稀疏性优化存储与计算外,我们还集成了“符号柯西随机投影(SignCRP)”将向量哈希为比特位,以进一步降低内存成本、加速ANN搜索。SignCRP最早在NIPS'13上被提出,用于对卡方相似度进行哈希,而卡方相似度是自然语言处理和计算机视觉领域广泛使用的非线性核。由此,卡方双塔模型、SignCRP与HNSW实现了紧密集成。

英文摘要:

Sparse data are common. The traditional ``handcrafted'' features are often sparse. Embedding vectors from trained models can also be very sparse, for example, embeddings trained via the ``ReLu'' activation function. In this paper, we report our exploration of efficient search in sparse data with graph-based ANN algorithms (e.g., HNSW, or SONG which is the GPU version of HNSW), which are popular in industrial practice, e.g., search and ads (advertising). We experiment with the proprietary ads targeting application, as well as benchmark public datasets. For ads targeting, we train embeddings with the standard ``cosine two-tower'' model and we also develop the ``chi-square two-tower'' model. Both models produce (highly) sparse embeddings when they are integrated with the ``ReLu'' activation function. In EBR (embedding-based retrieval) applications, after we the embeddings are trained, the next crucial task is the approximate near neighbor (ANN) search for serving. While there are many ANN algorithms we can choose from, in this study, we focus on the graph-based ANN algorithm (e.g., HNSW-type). Sparse embeddings should help improve the efficiency of EBR. One benefit is the reduced memory cost for the embeddings. The other obvious benefit is the reduced computational time for evaluating similarities, because, for graph-based ANN algorithms such as HNSW, computing similarities is often the dominating cost. In addition to the effort on leveraging data sparsity for storage and computation, we also integrate ``sign cauchy random projections'' (SignCRP) to hash vectors to bits, to further reduce the memory cost and speed up the ANN search. In NIPS'13, SignCRP was proposed to hash the chi-square similarity, which is a well-adopted nonlinear kernel in NLP and computer vision. Therefore, the chi-square two-tower model, SignCRP, and HNSW are now tightly integrated.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑