Long-Video Platform Homepage Feed Recommendation: Architecture and Practice
This article breaks down how a long-video platform builds its homepage feed recommendation system, walking through the full pipeline from data foundation to recall, ranking, reranking, and architecture. It explains how to model content and user profiles, correct biased engagement metrics with smoothing techniques, run multi-channel recall with deduplication, apply coarse and fine ranking with multi-objective fusion, and orchestrate mixed content formats on a limited screen. It also covers latency budgeting, cost and stability engineering, cold start and ecosystem health, offline and online evaluation with A/B testing, content safety and compliance, and a phased rollout roadmap with a pre-launch checklist. Engineers building or scaling a feed recommendation system will find practical design patterns and pseudocode to guide implementation.
Long-Video Platform Homepage Feed Recommendation: Architecture and Practice
1. Introduction: Why the Homepage Feed Deserves Its Own Design
On a video content platform, the homepage is usually the first screen a user sees and the most critical entry point for watch time and retention. A typical video platform homepage can be grouped into several regions:
- Top section navigation: distinguishes usage scenarios such as recommendations, follows, history, and favorites;
- Recommendation feed: content cards built from elements like cover image, title, creator, view count, engagement metrics, duration, and publish time;
- Live entry point: shows ongoing live streams and their live status;
- Long-video sections: shows serialized content such as series and animation that users follow over time;
- Playlist, collection, and creator aggregation entries: organize content by theme or by person.
These regions look like nothing more than page layout, but behind them the recommendation system is solving several problems at once: How do we characterize user interests? How do we filter through a massive content pool? How do we coordinate content of different formats within a single screen? How does the homepage respond within hundreds of milliseconds? And how does the system keep improving without harming the content ecosystem?
This article follows the general methodology of recommendation systems, tracing a “data → recall → ranking → reranking → architecture → evaluation” path to present a practical design. All example code is pseudocode used to illustrate the algorithms; specific parameters must be tuned against business data.
2. Breaking Down the Requirements: From Page Structure to the Recommendation Pipeline
2.1 Translating homepage needs into engineering problems
Every element on the interface can be mapped to a concrete engineering task:
| Page element | Core task | Key techniques |
|---|---|---|
| Section navigation | Scene recognition and scene switching | Independent multi-scene modeling, state persistence |
| Recommendation cards | Personalized ranking of mixed-format content | Multi-channel recall, multi-objective fine ranking, diversified reranking |
| Live entry point | Real-time supply-demand matching | Real-time live-status updates, viewer-count popularity |
| Series and follow sections | Periodic consumption and update reminders | Event-driven updates, follow-relationship modeling |
| Playlists and collections | Thematic, continuous consumption | Content aggregation, sequential recommendation |
| Creator aggregation | Continuity of follow relationships | Follow-stream recall, creator-level diversification |
From this, the core homepage task can be abstracted as a function: Feed = f(User, Context, CandidatePool, Strategy). Here:
- User includes long-term profile, short-term behavior, and real-time state;
- Context includes time, device, network, entry source, and request scenario;
- CandidatePool is the candidate set coming from each recall channel;
- Strategy includes ranking, blending, diversification, frequency control, and fallback policies.
2.2 Three extra challenges from mixed formats
- Heterogeneous formats: Short videos, long videos, live streams, series, and playlists have different consumption patterns. Short videos rely on instant appeal, long videos on sustained intent to keep watching, and live streams on current supply and demand. Measuring everything with a single objective forces trade-offs.
- Different consumption relationships: A video is a one-time consumption, while series and playlists involve continuous consumption, and live streams are strongly time-sensitive. The system must distinguish “attracting a new user to click in” from “helping a user keep watching.”
- Limited resource slots: A single screen can only show a limited amount of content, so live streams, campaigns, operational slots, and algorithmic recommendations need a unified resource-orchestration mechanism.
3. The Data System: Giving Recommendations a Solid Foundation
3.1 Content profile
A content profile describes “what this content is, its quality, and its lifecycle stage”:
- Static attributes: duration, category, tags, resolution, cover quality, title and tag text;
- Statistical attributes: cumulative view count, engagement (likes, favorites, comments, shares), creator follower count;
- Quality attributes: completion rate, effective-play ratio, low-quality and violation detection results;
- Freshness attributes: time since publish, popularity trend (rising, stable, declining), whether it is newly published.
One point deserves special emphasis: view counts and like counts are statistics that heavily depend on exposure opportunity. Comparing content quality directly by raw engagement systematically favors “head content” that received large exposure early. In practice, teams typically use empirical Bayesian smoothing or a lower bound of the Wilson confidence interval to correct for this:
import mathdef smoothed_ctr(clicks, impressions, prior_ctr=0.05, prior_strength=1000):"""Empirical Bayesian smoothed CTR: regress toward the prior mean when exposure is low."""return (clicks + prior_ctr * prior_strength) / (impressions + prior_strength)def wilson_lower_bound(clicks, impressions, z=1.96):"""Wilson lower bound: content with a high engagement rate but few samples won't get an inflated score."""if impressions == 0:return 0.0p = clicks / impressionsdenom = 1 + z * z / impressionscenter = p + z * z / (2 * impressions)margin = z * math.sqrt(p * (1 - p) / impressions + z * z / (4 * impressions * impressions))return (center - margin) / denom# Example: content A has a high engagement rate but was only exposed a few times; its score drops noticeably after smoothingassert smoothed_ctr(30, 100) < smoothed_ctr(3000, 40000)
3.2 User profile and sequence features
The value of user-side data lies in characterizing the “breadth, depth, and rate of change” of a user’s interests:
- Long-term profile: interest category distribution and weights, active time slots, device preference, content duration preference, creator follow list;
- Short-term behavior: the time series of recent clicks, views, and interactions, which is key to capturing interest drift;
- Real-time feedback: positive and negative feedback in the minutes before this request. For example, a category the user just marked “not interested in” should be down-weighted immediately.
3.3 Logging and sample construction
How well the homepage recommendation performs depends first on whether the logs are complete and accurate. An exposure log should contain at least:
request_id, user_id, item_id, recall_source, rank_position,page_index, exposure_timestamp, context(device, network, scene)
Corresponding behavior logs are reported when playback, completion, or interaction happens, and they are joined with the exposure log through request_id + item_id to form complete samples. Two points must be enforced in practice:
- Sample stitching must use randomly split traffic: Both training samples and evaluation can only come from randomly assigned requests. If the model influences the ranking while the samples come from the model’s own output, a closed-loop bias forms where “the model only learns the content it already likes.”
- Negative samples must cover unexposed candidates: Using only “exposed but not clicked” as negatives gradually erodes the model’s ability to distinguish good candidates from bad ones and cannot support exploration of cold-start content.
3.4 Three tiers of features: offline, nearline, and real-time
Features differ greatly in freshness and computation cost and should be handled in layers:
- Offline features: computed at T+1 or hourly, such as long-term profiles, category preferences, and content quality scores, stored in a feature store for online lookup;
- Nearline features: updated at minute level, such as early click-through rate after a content is published and cold-start status;
- Real-time features: updated at second level, such as the user’s real-time feedback sequence within a session and the real-time viewer count of a live room.
An often-overlooked detail is feature leakage (temporal leakage). If training samples use statistics that are “only known in the future” (for example, backfilling a click-through rate computed from full-day data into samples from early that morning), offline metrics look inflated but performance drops sharply after launch. Solutions include:
- Build feature snapshots by event timestamp;
- Share the same feature computation logic between training and serving;
- Sample online requests and compare feature values against the historical snapshot at that time.
4. Recall: Filtering Candidates in a Fast and Efficient Way
Facing a massive content pool, the homepage cannot finely score the entire library. The industry commonly uses a funnel of “multi-channel recall + coarse ranking + fine ranking + reranking.” The goal of recall is to find, as completely as possible within limited time, the content a user might be interested in, from multiple angles.
4.1 Design principles for multi-channel recall
A single recall channel has natural blind spots:
- Collaborative filtering struggles with new content;
- Vector recall is limited by model expressiveness;
- Popularity recall lacks personalization;
- Follow recall has narrow coverage.
So multiple complementary channels are needed to ensure candidate coverage and diversity.
4.2 Common recall channels
- Behavior-sequence recall: mines similar content from the user’s recent viewing and interaction sequence to capture immediate interests;
- Profile-tag recall: performs inverted-index retrieval by category and tag preferences to cover stable interests;
- Vector recall: maps users and content into the same vector space and uses nearest-neighbor search to discover semantically related content whose tags don’t overlap;
- Collaborative recall: mines related content from the “people who watched A also watched B” relationship;
- Follow recall: retrieves recently updated content from creators the user follows;
- Popular and freshness recall: provides globally and per-category popular content to support cold-start for new users;
- Scenario-based recall: combines context such as time, holidays, and region to match theme needs like “winter warm-up playlists” or “holiday travel.”
4.3 Merging and deduplication
Results from each channel must be merged. A simple, practical approach is to assign each channel a base weight and give a weighted boost to content hit by multiple channels:
def merge_recall(multi_channel_results, channel_weights, boost_factor=1.2):"""Merge multi-channel recall results and boost content hit by multiple channels.Returns a list of (item_id, merge_score)."""score = {}hit_sources = {}for source, items in multi_channel_results.items():for rank, item_id in enumerate(items):base = channel_weights.get(source, 1.0) / (rank + 1) # higher positions contribute morescore[item_id] = score.get(item_id, 0.0) + basehit_sources.setdefault(item_id, set()).add(source)for item_id, sources in hit_sources.items():if len(sources) > 1:score[item_id] *= boost_factor ** (len(sources) - 1)return sorted(score.items(), key=lambda x: x[1], reverse=True)
After merging, the following are still required:
- Deduplication: multiple versions of the same content and reposted copies must be merged into one entity;
- Filtering: remove already-watched content, content marked “not interested in,” content below the quality threshold, and content that failed review;
- Truncation: keep candidates within a size the coarse ranking stage can handle.
5. Coarse Ranking and Fine Ranking: Pursuing Ranking Accuracy Under Compute Constraints
5.1 Coarse ranking: lightweight models and cascade filtering
When the candidate set drops from thousands to hundreds, the fine-ranking model cannot score them one by one, so coarse ranking is needed. Coarse ranking usually uses a lighter model. A common approach is the two-tower structure: content and users are encoded separately, and scoring degenerates into a vector inner product, which is convenient for batch computation and precomputation caching. The coarse-ranking stage can distill a few features or scores from fine ranking so that the two stages stay as aligned as possible in their ranking objectives.
5.2 Fine ranking: multi-objective modeling and fusion
A user clicking on content often involves multiple decisions: whether they are willing to click in (CTR), whether they can finish it (completion rate), whether they are willing to like or favorite it (interaction rate), and whether they will follow the creator (follow rate). Predicting only CTR tends to push clickbait and low-duration-inducing content to the top. A more robust approach is to predict multiple objectives separately and then fuse them by business value:
def fusion_score(p_click, p_finish, p_interact, weights):"""Illustration of multi-objective fusion scoring.p_click / p_finish / p_interact are the predicted probabilities of each objective; weights need tuning against business goals."""return (weights["click"] * p_click+ weights["finish"] * p_finish+ weights["interact"] * p_interact)# Example weights: click is the prerequisite, while completion and interaction reflect content quality and user valueweights = {"click": 0.5, "finish": 0.3, "interact": 0.2}
Weights are not set on a whim; calibrating them is a long-term process done gradually through online experiments:
- Weights leaning toward completion and interaction usually suppress clickbait;
- Over-weighting clicks aggravates content homogenization;
- Higher weights on follow rate help quality creators grow sustainably.
5.3 Reranking: diversity, diversification, and context awareness
Fine ranking produces “how good each single piece of content is”; reranking answers “how good is this whole screen as a combination.” If the top few positions are occupied by the same creator or category, the amount of information the user actually sees drops significantly. Common reranking strategies include:
- Category diversification: limit the number of consecutive same-category items;
- Author diversification: limit how often the same creator appears on one screen;
- Fatigue control: down-weight similar content already exposed recently;
- Context-aware reranking: use generative reranking ideas to select, position by position, the content that maximizes the gain of the whole list.
from collections import Counterdef rerank_diverse(scored_items, category_info, max_per_category=2, max_per_author=1):"""Greedy diversification reranking: at each step, pick the highest-scoring unselected content that doesn't violate constraints.When a category or author limit is exceeded, defer the item to the end of the candidate pool and fill it back in once constraints free up."""picked, deferred = [], []pool = sorted(scored_items, key=lambda x: x[1], reverse=True)while len(picked) < len(pool):category_cnt = Counter(category_info[i]["category"] for i, _ in picked)author_cnt = Counter(category_info[i]["author_id"] for i, _ in picked)selected = Falsefor item_id, score in pool:if item_id in [i for i, _ in picked] or item_id in [i for i, _ in deferred]:continueinfo = category_info[item_id]if (category_cnt[info["category"]] < max_per_categoryand author_cnt[info["author_id"]] < max_per_author):picked.append((item_id, score))selected = Truebreakif not selected:deferred.extend(pool)breakpool = [p for p in pool if p[0] != item_id]remaining = [p for p in deferred if p[0] not in [i for i, _ in picked]]picked.extend(sorted(remaining, key=lambda x: x[1], reverse=True))return picked
5.4 Cold start and exploration
New content has no behavior data, and new users have no historical profile; both need an “exploration mechanism”:
- New content: allocate a certain amount of exploration traffic and quickly judge quality from early completion and interaction data; content that performs well gradually gets more exposure;
- New users: rely on registration information, the few interactions in the first session, and popular, high-quality content to establish an initial interest profile, then converge gradually;
- Exploration mechanism: keep a certain proportion of random or semi-random content in the recommendations, both to accumulate unbiased samples for the model and to prevent users from falling into a filter bubble.
6. Blending and Orchestration: Giving Each Content Format Its Place
The homepage is not a single video list but a layout made of multiple content formats. The blending layer decides where live streams, series, playlists, and operational slots each appear:
- Positioning strategy: live streams suit a prominent position near the top of the first screen to catch immediate traffic, while long-video follow entry points suit the middle-to-late section to support deep consumption.
- Quota constraints: set minimum or maximum occurrence counts for live streams and operational slots to prevent a single format from squeezing out others.
- Unified value measure: compare different formats with a unified value score, for example using “estimated effective watch time generated” as a common yardstick rather than simply comparing CTR.
- Real-time supply changes: live rooms go live or offline at any time, so the blending result must sense supply changes and adjust quickly.
- Multi-objective trade-offs: commercial and operational content must be coordinated with recommended content, usually through independent resource-slot management and frequency-control policies, while maintaining consistency constraints with the recommendation results.
7. Overall Architecture: Collaboration Across Offline, Nearline, and Online
A typical homepage recommendation system can be layered as follows:
+----------------------------------+Client homepage request ──▶ | Access layer (auth, rate limiting, scene recognition) |+-----------------+----------------+v+----------------------------------+| Recommendation service cluster || (1) Multi-channel recall (parallel execution) || (2) Merge & dedup -> coarse rank -> fine rank || (3) Rerank & blend -> result assembly |+--------+----------------+--------+v v+----------------------+ +----------------------+| Feature store (KV) | | Content index / vector DB || profiles / stats | | candidate content set |+-----------^----------+ +-----------^----------+| |+-----------------+-------------------------+-------------------+| Data platform || Behavior logs -> real-time compute (minute-level features) || -> offline compute (profiles, samples, model training) || -> model evaluation and release |+----------------------------------------------------------------------+
- The online part is only responsible for “completing one decision within tens of milliseconds,” so all heavy computation must be done in advance;
- The offline part handles feature production, sample stitching, and model training and evaluation;
- The nearline part lets the model and features quickly sense changes such as new content being published and immediate user feedback.
If cloud product capabilities are mentioned, here is a common misconception: the object storage, content delivery network, message queues, container platform, logging service, and monitoring and alerting that a homepage feed needs are all basic, general-purpose cloud capabilities. They can be used directly without building custom infrastructure from scratch.
8. Performance, Cost, and Stability
8.1 Latency budget
Homepage requests are extremely sensitive to latency, so it helps to break down the budget by stage. The table below is illustrative (adjust the actual numbers to the business):
| Stage | Illustrative budget |
|---|---|
| Access-layer auth and rate limiting | 5 ms |
| Recall (multi-channel parallel) | 20 ms |
| Coarse ranking | 10 ms |
| Fine ranking | 30 ms |
| Reranking and blending | 10 ms |
| Result assembly and serialization | 10 ms |
| Network transfer | 15 ms |
| Total | ~100 ms |
Once a stage times out, there should be a clear degradation path, such as skipping fine ranking and using coarse-ranking results directly, or returning popular fallback content.
8.2 Cost optimization
- Request batching: when a user keeps scrolling to the next page, prefetch the next screen to reduce the number of requests;
- Candidate caching: cache score fields for popular content to reduce repeated computation;
- Model lightweighting: use a lightweight model or precomputed vectors for coarse ranking, and only score a small number of candidates in fine ranking;
- Request-level caching: cache a user’s recommendation results within a time window to reduce repeated computation, but balance freshness against cost.
8.3 Stability assurance
- Multi-level degradation: when fine ranking is unavailable, degrade to coarse ranking; when all recall fails, return popular content;
- Traffic isolation: during peaks such as major promotions or events, protect the core pipeline through rate limiting and priority queues;
- Gradual rollout: validate a new strategy on a small traffic slice first, then ramp up gradually;
- Monitoring and alerting: set up monitoring for latency, error rate, empty-result rate, recall rate, and per-channel coverage, with automatic alerts on anomalies.
9. Cold Start, Content Ecosystem, and Long-Term Value
In the short term a recommendation system looks at metrics; in the long term it looks at the ecosystem. If it chases only immediate clicks, low-quality content keeps getting amplified while quality creators lose exposure opportunities. Consider the following:
- Creator growth pathways: design growth paths for new creators and allocate traffic based on content quality rather than follower count alone;
- Quality content identification: build a quality score from signals such as completion rate, interaction depth, and negative-feedback rate;
- Ecosystem diversity metrics: monitor the category distribution and creator concentration of homepage content to avoid traffic concentrating too heavily on a few top creators;
- Fast response to negative feedback: a user’s “not interested in” for a category should take effect within the same session;
- Protection for groups such as minors: apply stricter content filtering and time-management policies for specific groups.
10. Evaluation and the Experiment System
Iteration of a recommendation system must be built on rigorous experiments:
- Offline evaluation: measure ranking quality with metrics such as AUC, GAUC (AUC grouped by user), and NDCG, and validate the impact of strategy changes through replay evaluation;
- Online experiments: use A/B tests with core metrics such as per-capita watch time, next-day retention, interaction rate, and follow conversion, while setting guardrail metrics such as latency, crash rate, and negative-feedback rate;
- Layered traffic splitting: experiment traffic should be orthogonally layered to avoid multiple experiments interfering with each other;
- Long-horizon observation: the effect of a recommendation strategy on retention often takes weeks to appear, so short-term experiment conclusions must be interpreted cautiously;
- Unbiased samples: evaluation traffic should come from randomly assigned requests, avoiding the circular argument of “strategy influences data, data then evaluates strategy.”
When evaluating reranking strategies offline, you can use strategy-based sample weighting to mitigate bias. The illustrative code below uses the inverse propensity scoring idea: the lower the probability that a position is selected by the policy, the higher the weight its sample carries in evaluation.
def replay_eval_with_position_bias(log_records, policy_scores, gamma=0.9):"""Illustrative offline reranking evaluation with position bias.Each record in log_records contains a request_id and rank; policy_scores holds the policy scores;gamma is the position discount factor, so later positions contribute less to the overall total."""weighted_gain = 0.0for rec in log_records:propensity = max(gamma ** rec["rank"], 1e-6) # approximate probability of the record being selected by this policyweighted_gain += policy_scores[rec["request_id"]] / propensityreturn weighted_gain / max(len(log_records), 1)
11. Content Safety and Compliance
As the largest exposure slot on the platform, the homepage must establish full-pipeline content safety:
- Ingestion review: run machine review and human re-review when content is published; machine review can leverage general image, text, and audio/video moderation capabilities;
- Distribution risk control: filter violating, low-quality, and risky content before recommendation, and keep monitoring reports and negative feedback after distribution;
- Copyright management: establish an authorization and takedown coordination mechanism for copyrighted content, and promptly remove taken-down content from the index and cache;
- Minor protection: implement content protection measures such as a youth mode and usage-time management;
- Explainability and traceability: every recommendation result should record its recall source and ranking basis, to facilitate troubleshooting and appeal handling.
12. Rollout Roadmap and Checklist
It is best to build the system in phases:
- Phase 1 (usable): complete basic data logging, content indexing, single-channel recall, and popularity ranking to get the homepage “up and running” first;
- Phase 2 (pleasant to use): build multi-channel recall, coarse and fine ranking, and multi-objective fusion, and bring in an A/B experiment platform;
- Phase 3 (refined): complete reranking and blending, cold-start exploration, real-time features, and ecosystem governance;
- Phase 4 (intelligent): introduce sequence modeling and generative reranking, and establish an automated model iteration and evaluation system.
Before launch, run through the following checklist:
- Are the logging points for exposure, click, play, completion, interaction, and negative feedback complete?
- Do training and serving share the same feature logic, and is there any feature leakage?
- Does each recall channel have a clear fallback source?
- Do fine ranking, recall, and feature services each have a timeout-degradation path?
- Is there monitoring and alerting for latency, empty-result rate, and negative-feedback rate?
- Are there complete content review and copyright coordination mechanisms?
- Is experiment traffic orthogonal, are samples unbiased, and are guardrail metrics complete?
13. Conclusion
The homepage feed of a video platform looks like just a continuously scrolling list, but it is actually a comprehensive engineering effort combining data engineering, machine learning, distributed systems, and content governance. From building content and user profiles, to the layered design of multi-channel recall, coarse and fine ranking, and reranking and blending, to the offline-online collaborative architecture and a solid experiment system, every step directly affects what users see, how long they stay, and whether they come back. Treating the homepage as a product to be continuously measured and iterated, rather than a one-off page build, is the right path to truly delivering content to users.
