X Algorithm — Scoring Pipeline
Three scorers applied sequentially after pre-scoring filters. The Phoenix scorer does the ML heavy lifting; the weighted and diversity scorers combine and normalise the outputs.
Scorer sequence
Filtered candidates
│
▼
1. Phoenix scorer ← Grok transformer inference
│
▼
2. Weighted scorer ← combine ~15 action probabilities
│
▼
3. Author diversity scorer ← attenuate repeat authors
OON scorer ← adjust out-of-network scores
│
▼
Sort by final score → top K selection1. Phoenix scorer
Runs the Phoenix Grok-based transformer. For each candidate:
- - Input: user engagement history sequence + post features (via hash embeddings)
- - Candidate isolation: posts cannot attend to each other — scores are batch-independent
- - Output: probability for each of ~15 action types
Action probabilities
| Category | Actions |
|---|---|
| Positive | P(like) P(reply) P(repost) P(quote) P(click) P(share) P(follow_author) P(video_view) |
| Neutral | P(dwell) P(photo_expand) P(profile_click) |
| Negative | P(block_author) P(mute_author) P(report) P(not_interested) |
2. Weighted scorer
Combines all action probabilities into a single scalar:
$$\text{Score} = \sum_{i} w_i \cdot P(\text{action}_i)$$
Where:
- - $w_i > 0$ for positive actions
- - $w_i < 0$ for negative actions (block, mute, report actively suppress content)
The weights are learned during training — not manually tuned. The model decides how much each action type should matter relative to others.
Attenuates scores for posts from authors already well-represented in the current candidate set. Prevents any single author from dominating the feed.
A separate OON scorer applies additional adjustments specifically to out-of-network candidates, balancing in-network and out-of-network content in the final ranking.
Implementation notes
Scorers are implemented as Scorer traits in the candidate-pipeline crate:
trait Scorer {
fn score(&self, candidates: Vec<Candidate>, query: Query) -> Vec<ScoredCandidate>;
}The framework runs scorers sequentially, passing the scored output of each to the next.
- - Phoenix — transformer architecture and action probability outputs
- - X Algorithm — For You Feed — full pipeline context
- - X Algorithm — Pre-Scoring Filters — what happens before scoring
- - X Algorithm — Key Concepts — weighted scorer, candidate isolation