Efficient Serving with ScaNN for Approximate Nearest Neighbor Search

Added:

Serving Setup
Brute Force
Scan Speed
Parameter Tuning

Serving Setup

0:00
Playing Section
  • 1

    Introduces deployment phase for retrieval models.

  • 2

    Highlights Scan for efficient nearest neighbor search.

  • 3

    Recap of recommendation system series context.

Basic understanding of vector embeddings and similarity metrics (e.g., Cosine similarity, Inner Product) in high-dimensional spaces.
Fundamentals of recommendation system architectures, specifically the concept of Two-Tower (Query and Candidate) retrieval models.
Familiarity with the TensorFlow Recommenders (TFRS) framework and how candidate retrieval pipelines are structured.
Core concepts of search complexity, understanding the computational bottleneck of exact K-Nearest Neighbor (KNN) search compared to Approximate Nearest Neighbor (ANN) heuristics.
In-depth analysis of ScaNN's underlying mathematics, particularly Anisotropic Vector Quantization and how it optimizes inner product search.
Deploying and scaling vector search in production using cloud infrastructure such as Vertex AI Vector Search or standalone vector databases like Milvus, Qdrant, or Pinecone.
Designing multi-stage recommendation pipelines that couple high-speed first-stage retrieval (using ScaNN) with high-precision second-stage ranking models.
Methods for hyperparameter tuning in ScaNN (such as balancing 'num_leaves' and 'num_leaves_to_search') to optimize the recall-latency Pareto frontier.
15.4K views202likes6:55@TensorFlowOriginal Release: 2021-08-10

ScaNN (Scalable Nearest Neighbors) is an efficient approximate nearest neighbor search library that significantly outperforms brute-force exhaustive search for retrieval tasks in recommendation systems; by replacing the brute-force factorized top-k layer with ScaNN's optimized algorithms (including tree-based space partitioning, asymmetric hashing, and quantization), practitioners can achieve approximately 8x faster query processing times while maintaining comparable accuracy, with tunable parameters like num_leaves and num_leaves_to_search allowing control over the speed-accuracy trade-off.