Scale¶
Typical Scale for ML Methods¶
Modeling Method |
Typical Scale |
Real-World Example |
Key References / Links |
|---|---|---|---|
Matrix Factorization / Neural CF |
Millions of users; tens–hundreds of thousands of items |
Netflix (movie recommendations); Amazon product recommendations |
|
Autoencoder-Based Models |
Up to several million users/items (with careful engineering) |
Prototype systems in academia and industry (e.g.; LinkedIn/Alibaba experiments) |
|
CBOW/Item2Vec Models |
Tens of millions of items; millions of users |
Pinterest’s recommendation pipeline (visual item embeddings) |
|
Sequence-Based Models (RNNs/Transformers) |
Millions of users; operate on session-level subsets (dozens per session) |
YouTube and TikTok session‑based recommendations |
|
Graph Neural Network-Based Models (PinSage; LightGCN) |
Up to tens of millions of nodes (combined users and items; often on relevant subgraphs) |
Pinterest (PinSage) for visual recommendations; e‑commerce systems at Alibaba |
|
Hybrid/Ensemble Approaches |
Varies by design; typically millions to tens of millions overall |
Spotify’s hybrid playlist generation; Google News combining content and CF |
Practical Methods¶
When scaling from millions to billions of entities (such as YouTube videos, Google search pages, or Facebook’s social graph), several additional engineering and modeling adjustments become necessary. Here are some key considerations and strategies:
Distributed and Parallel Processing:
Engineering: You must distribute computation across clusters (using frameworks like Apache Spark, TensorFlow, or PyTorch Distributed). This ensures that both training and inference can handle massive datasets.
Example: Google’s search infrastructure and YouTube’s recommendation engine use distributed systems to compute embeddings and run large‑scale inference.
Graph Sampling and Partitioning:
Engineering: For GNN-based methods, processing the full graph is infeasible. Techniques like neighbor sampling (used in GraphSAGE) or mini‑batch training (used in LightGCN) help process only relevant subgraphs.
Example: Pinterest’s PinSage employs random walks and sampling to generate embeddings on their large-scale graph.
Source: PinSage: Graph Convolutional Neural Networks for Web-Scale Recommender Systems (Ying et al., 2018)
Hierarchical or Multi-Stage Modeling:
Modeling: Instead of one monolithic model, use hierarchical models where an initial retrieval model reduces the candidate set, followed by a more refined ranking model. This two-stage process is common in search engines and recommendation systems at Google and Facebook.
Example: YouTube employs a candidate retrieval stage using a two-tower model, then uses a ranking model that might combine sequence models, content signals, and GNNs.
Source: YouTube Recommendations: Deep Neural Networks for YouTube Recommendations (Covington et al., 2016)
Approximate Nearest Neighbor (ANN) Search:
Engineering: With billions of items, exact nearest neighbor search becomes too slow. ANN libraries (such as FAISS by Facebook AI) enable efficient retrieval from extremely large embedding spaces.
Model Compression and Distillation:
Modeling: Large models may need to be compressed or distilled into smaller, more efficient versions that can run in real-time at scale. This can involve quantization, pruning, or teacher-student distillation.
Source: Model Compression
Efficient Indexing and Caching:
Engineering: Systems at this scale benefit from specialized data structures (like inverted indices, Bloom filters) and caching layers to quickly serve recommendations and search results.
Example: Google Search uses massive indexing systems and caching to ensure low latency.
Adaptive and Incremental Learning:
Modeling: With billions of nodes and edges, the data is continuously evolving. Incremental or online learning techniques allow models to update without retraining from scratch.
Example: Facebook uses incremental learning for its social graph updates.
Source: PyTorch-BigGraph
Adjustment |
What It Entails |
Real-World Example |
Reference |
|---|---|---|---|
Distributed & Parallel Processing |
Use distributed frameworks (Spark; TensorFlow Distributed) for training/inference |
Google Search; YouTube Recommendations |
|
Graph Sampling & Partitioning |
Employ neighbor sampling/mini-batch training in GNNs |
Pinterest’s PinSage |
|
Hierarchical / Multi-Stage Models |
Two-stage retrieval and ranking systems |
YouTube’s candidate retrieval followed by ranking model |
|
Approximate Nearest Neighbor (ANN) |
Use ANN search (e.g.; FAISS) for efficient retrieval |
Facebook’s similarity search in recommendation systems |
|
Model Compression & Distillation |
Compress large models to run in real-time at scale |
Applied in many industry systems (Google; Facebook) |
|
Efficient Indexing & Caching |
Specialized indexing data structures and caching layers |
Google Search indexing and caching |
|
Adaptive & Incremental Learning |
Update models continuously using online learning techniques |
Facebook’s incremental updates on its social graph |