Abstract
Building and maintaining high-quality similarity graphs for massive, multimodal datasets in real-time is a significant industrial challenge. Traditional batch-processing systems like Google’s Grale excel at quality but struggle with the "dynamic gap"—the need to handle thousands of updates per second with millisecond query latency. This paper introduces Dynamic GUS (Dynamic Grale Using ScaNN), a system that bridges this gap by mapping multimodal features into sparse embeddings and leveraging the ScaNN library for efficient retrieval. Dynamic GUS achieves sub-second freshness and millisecond-level latency, significantly improving real-world applications such as Android Security.
1. Introduction
In modern industrial applications, data is characterized by high volume, multimodal complexity, and rapid mutation. For instance, a YouTube video comprises text, images, and audio, and thousands of such items are uploaded every second. Constructing a similarity graph—where edges represent relationships between items—is crucial for tasks like recommendation and security. While offline systems like Grale provide high-quality graphs, they cannot support real-time updates or low-latency neighborhood queries for new data points. Dynamic GUS addresses these limitations by providing a scalable, low-latency framework for dynamic graph maintenance.
2. Methodology and System Design
The core innovation of Dynamic GUS lies in its approach to candidate generation and scoring, transforming the offline batch process into a streamlined online service.
2.1 Sparse Embedding Generation
To handle multimodal data without the overhead of complex dense vector transformations, Dynamic GUS utilizes sparse embeddings. The system applies Locality Sensitive Hashing (LSH) to various feature types to assign "bucket IDs." These IDs serve as dimensions in a high-dimensional sparse vector. If two points fall into the same bucket, they share a non-zero value in that dimension, indicating potential similarity. This approach allows the system to capture complex relationships using only local information. Notably, the authors provide a theoretical bridge showing that this sparse search is functionally equivalent to the candidate generation in the original offline Grale system, ensuring consistent quality.
2.2 ScaNN Integration and Two-Step Scoring
Dynamic GUS employs ScaNN (Scalable Nearest Neighbor) as its primary search engine. The process follows a two-step scoring mechanism:
- Retrieval: ScaNN identifies a set of candidate neighbors based on the sparse embeddings.
- Refinement: A pre-trained, high-fidelity machine learning model (e.g., a Deep Neural Network) scores these candidates to establish the final graph edges.
To optimize quality, the system incorporates techniques like Filtering (removing overly common buckets) and IDF weighting (prioritizing rare, informative buckets).
2.3 Dynamic Operations
The system supports two primary real-time operations: point insertion/updates and neighborhood computation.
As shown in Figure 1, when a new point $p$ is received, the Embedding Generator creates its sparse representation, which is then indexed by ScaNN. This process occurs in sub-seconds, ensuring the graph remains fresh.
For queries, as illustrated in Figure 2, the system retrieves candidates $Q$ via ScaNN and then applies a Similarity Scorer to produce the final set of neighbors and scores $(Q, S)$.
3. Experimental Evaluation
The system was evaluated on large-scale benchmarks and in a production environment.
3.1 Benchmarks
Using the Open Graph Benchmark (OGB), Dynamic GUS was tested on:
- ogbn-arxiv: ~169k papers. Median latency: 10–20 ms.
- ogbn-products: ~2.4M products. Median latency: 5–25 ms.
The system demonstrated the ability to handle hundreds of thousands of mutations per second, maintaining high throughput even at scale.
3.2 Real-World Impact: Android Security
Dynamic GUS was deployed to enhance Android Security and Privacy. By enabling real-time graph updates, the system allowed for the detection of harmful applications four times faster than previous methods. Furthermore, the "action rate" (the percentage of identified threats that were successfully mitigated) increased by 40%.
4. Conclusion
Dynamic GUS represents a significant advancement in real-time graph building. By combining sparse LSH-based embeddings with the optimized retrieval capabilities of ScaNN, the system achieves the quality of offline batch processing with the latency required for interactive applications. Future work will focus on addressing model staleness through online learning and optimizing memory footprints for billion-scale datasets.
Summary updated