Menu
Meta Engineering·March 18, 2026

Designing a Social Recommendation System for Personalized Content Discovery

This article details the architectural approach behind Facebook Reels' "Friend Bubbles," a feature that enhances content discovery by highlighting videos friends have liked or reacted to. It focuses on how machine learning models determine viewer-friend closeness and rank video relevance, integrating social graph signals with video quality metrics. The system aims to create meaningful social connections and improve content personalization while maintaining high performance at Reels' scale.

Read original on Meta Engineering

Overview of Friend Bubbles System Architecture

The Friend Bubbles system on Facebook Reels is an example of a sophisticated social recommendation engine. Its core function is to surface content that friends have interacted with, blending traditional video quality signals with social-graph signals to enhance discovery and foster connections. The architecture is primarily driven by two main components: Viewer-Friend Closeness models to identify relevant friends, and Video Relevance ranking to prioritize content. This dual approach ensures that content is not just popular, but socially resonant.

Viewer-Friend Closeness: Identifying Key Relationships

To determine which friends' interactions are most impactful, the system uses two complementary machine learning models. The survey-based closeness model uses a broad range of signals, including social-graph features (mutual friends, interaction patterns) and user attributes, trained on regular user surveys to predict real-world relationship strength. This model performs weekly inference over trillions of connections. Alongside this, a context-specific closeness model is trained on on-platform activity signals (likes, comments, reshares when bubbles are shown), capturing dynamic, context-aware closeness. This emphasizes connection quality over mere quantity, ensuring that only the most meaningful friend interactions are considered.

Video Relevance: Integrating Social Context into Ranking

Ensuring high-quality, friend-interacted content reaches users involves two strategies: expanding the top of the funnel and enabling ranking models to effectively leverage social context. The retrieval stage explicitly sources candidate videos based on close friends, ensuring these socially relevant videos enter the ranking pipeline. Crucially, the ranking models were augmented with friend-bubble interaction signals and new tasks within their multi-task, multi-label (MTML) frameworks. This allows them to understand the unique value of friend content, which often depends on relationship strength rather than general interest signals.

💡

Continuous Feedback Loop

A critical architectural component is the continuous feedback loop where friend-bubble interaction data flows back into model training. This iteratively improves the ranking system's ability to identify which friend-content combinations resonate most with users. The ranking formula is optimized not just for video engagement (watch time, comments, likes) but also incorporates a conditional probability term, P(video engagement | bubble impression), balanced with tunable weights to manage trade-offs between social interaction and content quality.

Performance at Reels Scale: Client-Side Infrastructure

Given Reels' performance-sensitive nature, integrating friend bubbles required strict adherence to performance constraints: smooth scrolling, no load latency regressions, and low CPU overhead. The solution leveraged Facebook's existing video delivery system's prefetch mechanism. Friend-bubble metadata retrieval was pinned to this same prefetch window, allowing it to reuse cached results, avoid redundant work, and render bubbles synchronously with video content without mid-playback UI updates. Additionally, animations were made strictly conditional, disabled during active scrolling or on low-end devices, demonstrating a pragmatic approach to client-side performance optimization for a rich, dynamic UI element.

  • Leveraging existing prefetch mechanisms for metadata delivery.
  • Conditional animation rendering based on device capability and user interaction.
  • Optimizing retrieval and processing to prevent UI regressions and maintain smooth user experience.
recommendation systemsmachine learningsocial graphcontent discoveryreal-time processingperformance optimizationclient-side renderingfeedback loops

Comments

Loading comments...