NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Approximate Nearest Neighbor Search under Neural Similarity Metric for Large-Scale Recommendation

Rihan Chen, Bin Liu, Han Zhu, Yaoxuan Wang, Qi Li, Buting Ma, Qingbo Hua, Jun Jiang, Yunlong Xu, Hongbo Deng, Bo Zheng

Introduction: The Retrieval Bottleneck

Modern large-scale recommendation systems typically follow a two-stage architecture: Retrieval and Ranking. The retrieval stage filters millions of items down to a few thousand candidates using fast, simple models, while the ranking stage applies complex deep neural networks (DNNs) to provide precise ordering.

The primary bottleneck lies in the retrieval stage. To maintain low latency, industry standards rely on Embedding-Based Retrieval (EBR), which approximates user-item preferences using simple vector math like inner products or $L_2$ distances. However, these linear metrics are often too simplistic to capture the intricate patterns in user behavior. While more advanced "deep" retrieval models like Tree-based Deep Models (TDM) exist, they are difficult to train, hard to scale, and struggle to integrate auxiliary "side information" (e.g., item categories or shop IDs) due to their rigid internal structures.

The NANN Framework

This paper introduces NANN (Neural Approximate Nearest Neighbor), a framework that enables complex DNNs to perform large-scale retrieval directly by acting as "greedy walkers" on a similarity graph. NANN decouples the model architecture from the index structure, allowing for high-capacity models without the computational overhead of traditional end-to-end index learning.

Architecture of the NANN model and its interaction with the hierarchical graph.

Graph-based Navigation and Beam Retrieval

NANN utilizes a Hierarchical Navigable Small World (HNSW) graph for fast search. Unlike standard HNSW, which uses $L_2$ distance to find the next node, NANN uses the full output of a DNN to score candidates. To prevent the search from getting trapped in local optima—a common issue with non-convex neural scoring functions—NANN employs a Beam-retrieval strategy. Similar to beam search in natural language processing, this allows the system to explore multiple paths simultaneously, increasing the likelihood of finding globally optimal items.

Adversarial Training for "Flat" Landscapes

A key challenge in using DNNs for graph search is the mismatch between the graph's structure (built on $L_2$ distance) and the complex, "wiggly" scoring surface of the neural network. To bridge this gap, the authors propose an Adversarial Training task using the Fast Gradient Sign Method (FGSM). By intentionally perturbing item embeddings during training and requiring the model to maintain consistent scores, they effectively "flatten" the model’s scoring landscape. This makes the DNN scores more robust and predictable as the search traverses the graph, ensuring that items close in the graph receive similar neural scores.

Experimental Evaluation

The researchers evaluated NANN on two major datasets: a public Taobao UserBehavior dataset (1M users, 4M items) and a massive Industrial Dataset from Taobao (100M users, 1.3M items, 375M interactions).

Performance comparison of NANN against baselines on Industry and UserBehavior datasets.

Key Results

  • Real-World Impact: Deployed on Taobao’s display advertising platform, NANN achieved a 2.4% increase in Click-Through Rate (CTR) and a 3.1% increase in Revenue per Mille (RPM) compared to the previous state-of-the-art TDM.
  • Efficiency: NANN achieves near brute-force accuracy while evaluating only 1% to 2% of the total item corpus.
  • Ablation Insights: The adversarial training task proved critical. Without it, the "recall gap" between graph search and exhaustive search widened significantly, particularly for complex models utilizing attention mechanisms.

Conclusion

NANN demonstrates that decoupling the retrieval model from the index structure is a powerful strategy for large-scale recommendation. By framing graph search as an optimization process and using adversarial training to ensure a searchable scoring landscape, NANN allows for the use of sophisticated neural similarity metrics at scale. Future work includes exploring graph construction methods that are inherently aware of neural similarity and developing techniques for real-time dynamic graph updates as new items enter the system.

Summary updated

BibTeX
@inproceedings{chen2022approximate,
  author = {Rihan Chen and Bin Liu and Han Zhu and Yaoxuan Wang and Qi Li and Buting Ma and Qingbo Hua and Jun Jiang and Yunlong Xu and Hongbo Deng and Bo Zheng},
  title = {{Approximate Nearest Neighbor Search under Neural Similarity Metric for Large-Scale Recommendation}},
  booktitle = {ACM International Conference on Information and Knowledge Management},
  year = {2022},
  doi = {10.1145/3511808.3557098},
}
Figure