Building a Homepage Recommendation Feed Architecture for Video Communities
This article describes an end-to-end architecture for the homepage recommendation feed of a video community. It covers the path from content ingestion to final rendering, including multi-channel recall, ranking, feature management, cold start, content safety, and observability. It also offers practical engineering guidance for a phased rollout.
The homepage of a video community typically includes navigation, content cards, a live streaming entry, the personal center, and a recommendation feed. Users want to find videos, live streams, or long-form content they like within a limited screen space. The platform has to distribute content from a very large pool while balancing click-through, watch time, engagement, diversity, and content safety. This article treats the homepage recommendation feed as a general technical topic. It walks through the full pipeline from content ingestion to final rendering and presents an architecture and engineering practices that can be put into production.
1. Problem Background and Design Goals
The homepage feed faces four main challenges. First, content is large in volume and varied in type, including short videos, long videos, live streams, image-text posts, and special topics. Content card fields usually include title, cover image, play count, like count, duration, publish time, creator ID, category tags, and live status. Second, user interests change over time. Real-time behavior, context, and long-term preferences all need to be modeled together. Third, the homepage must stay diverse. It should prevent similar content from concentrating in one place while meeting operational rules, frequency controls, and negative feedback. Fourth, the system needs low latency, high availability, and observability. Any instability in the recommendation service directly affects the experience on the first screen.
Accordingly, the design goals include: a stable, low-latency first screen response; explainable multi-channel recall and ranking; complete cold start and exploration mechanisms; strict content safety filtering; flexible gray release and experimentation; and end-to-end logging and monitoring.
2. Overall Layered Architecture
A recommendation feed fits a layered architecture with five layers: an access layer, a service layer, a recommendation layer, a data layer, and a support layer.
The access layer handles request aggregation, parameter validation, identity recognition, rate limiting, degradation, and fallback for the first screen. The service layer orchestrates the recommendation flow and combines recommended results, operational content, and personal entry points. The recommendation layer includes multi-channel recall, coarse ranking, fine ranking, re-ranking, and policy filtering. The data layer contains the content store, user profiles, behavior logs, feature stores, and vector indexes. The support layer provides caching, message queues, stream processing, object storage, container platforms, log services, and monitoring and alerting.
When deploying on the cloud, teams can use general capabilities from Baidu AI Cloud, such as object storage, message queues, container platforms, log services, and monitoring and alerting. Object storage holds cover images and media files. Message queues decouple behavior logs. Container platforms support elastic scaling for online services. Logging and monitoring build the observability stack. Specific choices should be evaluated based on team size, cost, and compliance requirements.
3. Data and Feature System
The feature system is the foundation of recommendation quality. Offline, teams can build long-term user interest, content tags, creator profiles, and statistical features. Near-line, behavior logs can generate short-term interests and trend signals. Online, the system reads the user’s real-time context and latest behavior sequence. Feature consistency deserves particular attention. Offline training and online serving should use the same feature definitions and time windows to avoid training-serving skew.
User features can include long-term category preferences, recent interaction sequences, active time periods, coarse device and network information, and negative feedback records. Content features can include multimodal semantic vectors, category tags, duration, resolution, publish time, the author’s historical performance, engagement rates, and safety levels. Cross features can include the match between a user’s category preferences and content tags, the match between a user’s active hours and a content’s publish time, and the follow relationship between an author and a user.
The feature store should separate high-throughput offline features from low-latency online features. It should also support versioning, expiration times, and backfill. For real-time behavior, message queues can feed a stream processing pipeline that generates minute-level popularity, real-time engagement rates, and short-term interest vectors.
4. Multi-Channel Recall and Candidate Generation
A single recall channel cannot cover the complex needs of a homepage. Systems usually run several recall channels in parallel, then deduplicate and filter the combined results. Common recall paths include:
- Hot and trending recall: uses play, engagement, and completion trends within a time window to provide a broad fallback.
- Collaborative filtering recall: uses interactions between users and content to find similar interests.
- Vector semantic recall: maps user interest and multimodal content vectors into the same space and runs nearest-neighbor search.
- Following and subscription recall: prioritizes new content from creators that users explicitly follow.
- Tag and region recall: matches content category, language, and coarse regional preferences.
- Exploration recall: gives new content and new users controlled exposure to prevent interests from becoming fixed.
- Operational and special topic recall: includes manually configured topics, campaigns, and pinned content, which must still follow the same frequency controls as recommended results.
After candidate generation, the system must run deduplication, exposure filtering, negative feedback filtering, content safety filtering, copyright and regional policy filtering, and frequency control. Each candidate should keep a record of its recall source so that later ranking and attribution analysis can use it.
5. Coarse Ranking, Fine Ranking, and Re-Ranking
Coarse ranking aims to narrow a large candidate set to a smaller one at low computational cost. It can use lightweight models or rule-based scoring, with features centered on user profiles, content tags, statistical popularity, and cross matches. Fine ranking uses richer features and models to predict multiple objectives, such as click-through, completion, and engagement, and then combines them according to business goals. The fusion should not optimize click-through alone. It should also consider watch time, negative feedback, and diversity.
Re-ranking optimizes the final list for user experience. Common strategies include spreading out content by author, category, and duration, mixing live and on-demand content, down-ranking long runs of similar content, protecting diversity on the first screen, and inserting operational slots. Re-ranking also enforces hard rules. For example, content below the required safety level cannot appear on the first screen, content that exceeds frequency limits is down-ranked, and content with negative feedback is filtered out.
The following pseudocode shows the flow:
function build_home_feed(user_id, context):user = load_user_profile(user_id)candidates = []candidates += recall_hot(context)candidates += recall_collaborative(user, context)candidates += recall_vector(user, context)candidates += recall_following(user, context)candidates += recall_explore(context)candidates = dedup(candidates)candidates = filter_exposed(candidates, user_id)candidates = filter_negative(candidates, user_id)candidates = filter_safety(candidates, context)coarse = coarse_rank(user, candidates)fine = fine_rank(user, coarse[:N])final = rerank(user, fine, context)final = apply_business_rules(final, context)return final[:K]
The pseudocode highlights two points: the flow is layered, and the filtering order matters. The system first widens the candidate pool, then narrows it at each stage. Safety and negative feedback filters run early to reduce unnecessary computation.
6. Cold Start and Exploration
For new content, the system can use the creator’s historical performance, semantic content vectors, tags, and early engagement signals. New content can enter a small exploration pool. Its weight is then adjusted quickly based on post-exposure clicks, completions, and negative feedback. For new users, the system can use registration information, coarse device context, popular content, and diverse exploration to avoid a narrow first screen. Exploration needs a budget and frequency limits so that it does not hurt the overall experience. For users who have been inactive for a long time, the system can raise the weight of popular and followed content while keeping a few exploration slots.
7. Content Safety and Compliance
A homepage feed needs a multimodal content safety pipeline. Text, cover images, audio, and video should pass automated review and manual review where needed. Safety levels can act as hard constraints in both recall and ranking. Live streams require attention to real-time status and sudden risks. The system should keep review logs, policy versions, and enforcement records so that decisions can be traced and appealed. Safety filtering should run as early as possible so that unsafe content never reaches ranking or caches.
8. Engineering Reliability and Observability
Online services need timeouts, retries, circuit breakers, and degradation strategies. For the first screen, the system can use cache-based and popularity-based fallbacks. If the recommendation service fails, it can return a set of safe content. Caches should cover content cards, user profiles, recall results, and some features, with reasonable expiration times and invalidation notifications. Message queues decouple behavior logs from review events, and stream processing computes real-time features and popularity statistics.
For observability, teams should track request volume, latency percentiles, error rate, cache hit rate, recall coverage, ranking latency, and the number of degradation events, and configure alerts for them. Logs should include a request ID, a coarse user identifier, recall sources, ranking scores, filter reasons, and final exposure results. This data supports troubleshooting and effect analysis. The experimentation platform should support layered orthogonal experiments, gray releases, and metric comparisons. Core metrics include click-through rate, completion rate, engagement rate, negative feedback rate, diversity metrics, and average watch time per user.
9. Rollout Recommendations
Teams can start with a minimal working loop: multi-channel recall, rule-based ranking, and safety filtering. Then they can add fine-ranking models and real-time features. First, they should make the first screen stable and ensure fallback capability. Then they can optimize diversity and exploration. All strategies should be configurable, reversible, and attributable. For team collaboration, the boundaries between content ingestion, feature production, online serving, and experiment analysis should be clearly defined. Teams should also set up unified content identifiers and feature version management. The end goal is a content distribution system that is stable, scalable, observable, and balances user experience with safety.
