Skip to main content
Scorers are responsible for assigning numerical scores to candidates in the Home Mixer pipeline. These scores determine the final ranking order of posts shown to users. Scorers implement the Scorer trait with both score and update methods.

Overview

Scorers generate new score values and return updated candidate objects. The update method merges these scores back into the original candidates:

Available Scorers

PhoenixScorer

Uses the Phoenix ML prediction service to generate engagement probability scores for each candidate.
Arc<dyn PhoenixPredictionClient>
required
Client for communicating with the Phoenix prediction service
Purpose: Predicts user engagement likelihood across multiple action types

Predicted Actions

Phoenix generates probability scores for the following actions:
Option<f64>
Probability the user will like/favorite the tweet
Option<f64>
Probability the user will reply to the tweet
Option<f64>
Probability the user will retweet
Option<f64>
Probability the user will expand photos
Option<f64>
Probability the user will click the tweet
Option<f64>
Probability the user will click the author’s profile
Option<f64>
Probability of video quality view (watching video to completion)
Option<f64>
Probability the user will share the tweet
Option<f64>
Probability of sharing via direct message
Probability of sharing via copy link
Option<f64>
Probability the user will dwell on the tweet
Option<f64>
Probability the user will quote tweet
Option<f64>
Probability of clicking a quoted tweet
Option<f64>
Probability the user will follow the author
Option<f64>
Probability of negative feedback (“not interested”)
Option<f64>
Probability the user will block the author
Option<f64>
Probability the user will mute the author
Option<f64>
Probability the user will report the tweet

Continuous Actions

Option<f64>
Predicted dwell time in seconds (continuous value, not a probability)

Additional Metadata

Option<u64>
Unique identifier for the prediction request, useful for debugging and logging
Option<u64>
Timestamp (milliseconds since epoch) when the candidate was scored

Implementation Details

Code Example:
home-mixer/scorers/phoenix_scorer.rs
Retweet Handling: For retweets, Phoenix looks up predictions using the original tweet ID, ensuring consistent scoring:
home-mixer/scorers/phoenix_scorer.rs

WeightedScorer

Combines Phoenix prediction scores into a single weighted score using configurable weights. Purpose: Translates multiple engagement signals into a single ranking score

Score Calculation

The weighted score is computed as:
home-mixer/scorers/weighted_scorer.rs
Where apply multiplies each score by its weight:

Configuration Weights

Weights are configured via constants (in the excluded params module):
  • Positive Engagement: FAVORITE_WEIGHT, REPLY_WEIGHT, RETWEET_WEIGHT, SHARE_WEIGHT, etc.
  • Negative Signals: NOT_INTERESTED_WEIGHT, BLOCK_AUTHOR_WEIGHT, MUTE_AUTHOR_WEIGHT, REPORT_WEIGHT (typically negative)
  • Continuous: CONT_DWELL_TIME_WEIGHT for dwell time prediction

Video Quality View (VQV) Eligibility

VQV weight is only applied to videos meeting minimum duration requirements:
home-mixer/scorers/weighted_scorer.rs

Score Normalization

The weighted score is normalized and offset-adjusted:
home-mixer/scorers/weighted_scorer.rs
This ensures proper handling of negative signals while maintaining score scale.

Output

Option<f64>
The combined, weighted score used for initial ranking

AuthorDiversityScorer

Applies a decay multiplier to diversify authors within a feed response, preventing dominance by any single author.
f64
default:"AUTHOR_DIVERSITY_DECAY"
Exponential decay factor applied to subsequent posts from the same author
f64
default:"AUTHOR_DIVERSITY_FLOOR"
Minimum multiplier value, ensuring even repeated authors aren’t completely suppressed
Purpose: Increases author variety in the feed

Diversity Multiplier Formula

home-mixer/scorers/author_diversity_scorer.rs
Where position is the 0-indexed count of previous posts from the same author. Example: If decay_factor = 0.8 and floor = 0.5:
  • 1st post from author: multiplier = 1.0 (no penalty)
  • 2nd post from author: multiplier = 0.9 (0.5 * 0.8^1 + 0.5)
  • 3rd post from author: multiplier = 0.82 (0.5 * 0.8^2 + 0.5)
  • Converges to floor = 0.5

Algorithm

  1. Sort candidates by weighted_score (descending)
  2. Track author occurrence counts
  3. For each author’s nth post, multiply score by multiplier(n-1)
  4. Return updated scores in original order
Code Example:
home-mixer/scorers/author_diversity_scorer.rs

Output

Option<f64>
The diversity-adjusted score (weighted_score × diversity_multiplier)

OONScorer

Out-of-Network Scorer that applies a weight factor to out-of-network candidates, typically reducing their scores relative to in-network content.
f64
Multiplier applied to out-of-network candidates (configured via OON_WEIGHT_FACTOR)
Purpose: Balances in-network and out-of-network content in the feed Logic:
  • If candidate.in_network is Some(false), multiply score by OON_WEIGHT_FACTOR
  • Otherwise, leave score unchanged
Implementation:
home-mixer/scorers/oon_scorer.rs
This allows the system to prioritize familiar content (in-network) while still surfacing discovery content (out-of-network) when it’s highly relevant.

Output

Option<f64>
The network-adjusted final score

Scorer Pipeline Order

Scorers are typically applied in this sequence:
  1. PhoenixScorer - Generate ML prediction scores
  2. WeightedScorer - Combine predictions into weighted_score
  3. AuthorDiversityScorer - Apply diversity adjustments to create score
  4. OONScorer - Apply final network-based adjustments to score
Each scorer reads from previous scores and writes to new fields, creating a progression:

Score Field Progression

The final score field is used by selectors to determine the order candidates are served to users.
  • Sources - Retrieve candidates
  • Filters - Filter candidates before scoring
  • Selectors - Select and order scored candidates