Scaling the Instagram Explore Recommendations System (Meta Engineering, August 2023)
- Source: Meta Engineering Blog, Aug 9, 2023
- Type: Industry engineering blog
- Instagram Explore is Meta's recommendation surface for discovering new content outside a user's existing network, serving hundreds of millions of users and requiring ranking over billions of candidate media items.
- The system uses a classic multi-stage pipeline: candidate generation (embedding-based retrieval over a huge corpus) followed by multi-stage ranking that progressively applies more complex models to fewer candidates.
- Meta describes scaling efforts focused on making each stage more efficient so that heavier models and richer features can be introduced without linear infrastructure cost growth.
- Engineering optimizations include improved embedding retrieval infrastructure, batched and distributed serving, and careful trade-offs between model size, feature count, and p99 latency budgets.
- The post emphasizes that quality improvements must be validated with online experiments (A/B tests) measuring engagement and satisfaction, not just offline ranking metrics.
- Efficiency work (retrieval infrastructure, staged ranking) is what buys headroom for model quality improvements at scale.
- Latency and cost budgets are hard constraints: heavier models are only viable where the staged architecture limits their invocation.
- Offline metrics must be cross-checked against online experiments to ensure perceived recommendation quality actually improves.
Key points
Architecture and pipeline
1. Candidate generation: media candidates are retrieved using embeddings and approximate nearest neighbor search, balancing recall against computational cost. 2. Ranking stages: candidates pass through lightweight rankers first; only the top subset reaches heavier models, keeping total serving cost manageable. 3. Feature infrastructure: user, item, and contextual features feed the ranking models; scaling required more efficient feature computation and storage. 4. Serving efficiency: batching, model compression, and hardware-aware design reduce per-query latency and compute, enabling scale to billions of daily requests.