# Post-Processing Adjustments in x-algorithm: Cold-Start Bias, Diversity Decay, and OON Multipliers

> Discover x-algorithm post-processing adjustments: cold-start bias, diversity decay, and OON multipliers. Enhance your recommendation rankings with these score refinements.

- Repository: [SpaceXAI Org/x-algorithm](https://github.com/xai-org/x-algorithm)
- Tags: deep-dive
- Published: 2026-09-12

---

**x-algorithm applies four sequential post-processing adjustments to candidate scores—Author-Cold-Start Bias, Author-Diversity Decay, Out-of-Network Multiplier, and Determinantal Point Process Filtering—before finalizing recommendation rankings in [`home-mixer/scorers/ranking_scorer.rs`](https://github.com/xai-org/x-algorithm/blob/main/home-mixer/scorers/ranking_scorer.rs) and [`vm-ranker/scoring/dpp_model.rs`](https://github.com/xai-org/x-algorithm/blob/main/vm-ranker/scoring/dpp_model.rs).**

The x-ai/x-algorithm repository implements a multi-stage scoring pipeline that refines raw model predictions through targeted post-processing adjustments. These modifications temper scores based on author history, enforce content diversity across slates, and scale rankings according to network boundaries. Understanding these adjustments is essential for tuning recommendation quality and debugging ranking anomalies.

## The Four Post-Processing Adjustments Applied to Scores

### Author-Cold-Start Bias

The first adjustment applies a learned bias to temper scores for authors with limited historical data. This mechanism prevents over-promotion of brand-new accounts by adjusting their raw scores downward when insufficient activity history exists. In [`home-mixer/scorers/ranking_scorer.rs`](https://github.com/xai-org/x-algorithm/blob/main/home-mixer/scorers/ranking_scorer.rs), the system invokes `author_cold_start.apply(query, candidates, &weighted_scores)` at lines 797-800 to implement this correction before any diversity logic executes.

### Author-Diversity Decay

To encourage a varied author mix within a single slate, this adjustment reduces scores for successive posts from the same author according to a configurable decay factor and floor value. The logic ensures that no single author dominates the results by penalizing repetition. The implementation appears in [`home-mixer/scorers/ranking_scorer.rs`](https://github.com/xai-org/x-algorithm/blob/main/home-mixer/scorers/ranking_scorer.rs) through `Self::apply_author_diversity(query, candidates, &adjusted_scores)` at lines 801-804, gated by the feature flag `rust_home_mixer_enable_author_diversity`.

### Out-of-Network Multiplier

When candidates originate outside a user's social graph (out-of-network or OON), their scores receive multiplicative scaling via the `effective_oon` parameter. This adjustment occurs after diversity corrections, modifying scores only when `oon_applies(c)` returns true for a given candidate. The logic resides in [`home-mixer/scorers/ranking_scorer.rs`](https://github.com/xai-org/x-algorithm/blob/main/home-mixer/scorers/ranking_scorer.rs) at lines 811-817, deriving the multiplier from feature-switch settings that control cross-graph content promotion.

### Determinantal Point Process Filtering

After initial ranking completes, the pipeline optionally applies DPP-based re-ranking to improve slate diversity through probabilistic subset selection. This process can filter out low-scoring posts entirely, with the system logging the number of removed items and affected post IDs for observability. According to the x-algorithm source code, this implementation lives in [`vm-ranker/scoring/dpp_model.rs`](https://github.com/xai-org/x-algorithm/blob/main/vm-ranker/scoring/dpp_model.rs) at lines 137-149, generating log messages such as "DPP filtered … posts" with before-and-after score comparisons.

## Execution Order and Feature Configuration

The post-processing adjustments execute in a strict sequence that preserves dependency relationships between corrections:

1. **Cold-Start bias** is applied to the raw weighted scores.
2. **Author diversity** is optionally applied (controlled by the feature flag `rust_home_mixer_enable_author_diversity`).
3. **OON multiplier** is applied to the diversity-adjusted scores.
4. The resulting scores may then be fed through **DPP filtering** which can further prune the slate for diversity.

The following Rust excerpt from [`ranking_scorer.rs`](https://github.com/xai-org/x-algorithm/blob/main/ranking_scorer.rs) demonstrates this exact pipeline implementation:

```rust
// Inside `ranking_scorer.rs` – the core adjustment pipeline
let adjusted_scores = self.author_cold_start.apply(query, candidates, &weighted_scores);

let diversity_adjusted = if enable_author_diversity {
    Self::apply_author_diversity(query, candidates, &adjusted_scores)
} else {
    adjusted_scores.clone()
};

let final_scores: Vec<f64> = candidates.iter().enumerate().map(|(i, c)| {
    let after_diversity = diversity_adjusted[i];
    if oon_applies(c) {
        after_diversity * effective_oon
    } else {
        after_diversity
    }
}).collect();

```

Feature flags control these adjustments dynamically without requiring redeployment. Key configuration parameters include:

- `rust_home_mixer_enable_author_diversity`: Toggles diversity decay application
- `rust_home_mixer_author_diversity_decay`: Sets the decay factor (e.g., "0.5")
- `rust_home_mixer_author_diversity_floor`: Defines minimum score retention (e.g., "0.25")
- `rust_home_mixer_out_of_network_multiplier`: Configures OON scaling (e.g., "1.2")

The Python wrapper example below illustrates how to configure these post-processing parameters when invoking the scorer:

```python

# Example: Using the Rust scorer from Python via a wrapper (illustrative)

from x_algorithm.home_mixer import RankingScorer, ScoredPostsQuery

# Build a query with feature‑switch flags that enable the adjustments

query = ScoredPostsQuery(
    params = {
        "rust_home_mixer_enable_author_diversity": "true",
        "rust_home_mixer_author_diversity_decay": "0.5",
        "rust_home_mixer_author_diversity_floor": "0.25",
        "rust_home_mixer_out_of_network_multiplier": "1.2",
    }
)

candidates = [
    {"author_id": 1, "in_network": True},
    {"author_id": 2, "in_network": False},
    {"author_id": 1, "in_network": True},
]

scorer = RankingScorer()
scored = scorer.score(query, candidates)   # → scores already contain cold‑start, diversity, and OON adjustments

print(scored)

```

## Key Source Files for Post-Processing Logic

Understanding the post-processing architecture requires familiarity with these specific components:

- **[`home-mixer/scorers/ranking_scorer.rs`](https://github.com/xai-org/x-algorithm/blob/main/home-mixer/scorers/ranking_scorer.rs)**: Implements the main scoring pipeline including cold-start bias, author diversity decay, and OON multiplier logic.
- **[`vm-ranker/scoring/dpp_model.rs`](https://github.com/xai-org/x-algorithm/blob/main/vm-ranker/scoring/dpp_model.rs)**: Contains the DPP-based re-ranking and filtering logic for final slate diversity optimization.
- **[`home-mixer/scorers/author_cold_start.rs`](https://github.com/xai-org/x-algorithm/blob/main/home-mixer/scorers/author_cold_start.rs)**: Defines the `AuthorColdStart` struct and its `apply` method for new account bias correction.
- **[`home-mixer/scorers/author_diversity.rs`](https://github.com/xai-org/x-algorithm/blob/main/home-mixer/scorers/author_diversity.rs)**: Implements `apply_author_diversity` and the helper `diversity_multiplier` for successive author penalties.

## Summary

- **Author-Cold-Start Bias** in [`ranking_scorer.rs`](https://github.com/xai-org/x-algorithm/blob/main/ranking_scorer.rs) tempers scores for new authors to prevent over-promotion.
- **Author-Diversity Decay** applies configurable decay factors to successive posts from identical authors, controllable via `rust_home_mixer_enable_author_diversity`.
- **Out-of-Network Multiplier** scales scores for content outside the user's social graph based on feature-switch settings in the adjustment pipeline.
- **DPP Filtering** performs final slate-level diversity optimization in [`dpp_model.rs`](https://github.com/xai-org/x-algorithm/blob/main/dpp_model.rs), potentially removing low-scoring candidates and logging affected post IDs.
- Post-processing adjustments execute sequentially (cold-start → diversity → OON → DPP) and remain configurable through runtime feature flags.

## Frequently Asked Questions

### What is the purpose of author cold-start bias in x-algorithm?

The author cold-start bias prevents newly created accounts from receiving disproportionately high rankings by applying a learned penalty to their raw scores. This adjustment ensures that authors with limited historical data receive tempered promotion while they build reputation and engagement history, as implemented in [`home-mixer/scorers/ranking_scorer.rs`](https://github.com/xai-org/x-algorithm/blob/main/home-mixer/scorers/ranking_scorer.rs).

### How does x-algorithm handle out-of-network content?

The system identifies out-of-network candidates through the `oon_applies` function and applies the `effective_oon` multiplier to their scores after diversity adjustments. This mechanism, implemented in [`home-mixer/scorers/ranking_scorer.rs`](https://github.com/xai-org/x-algorithm/blob/main/home-mixer/scorers/ranking_scorer.rs) at lines 811-817, allows fine-grained control over how prominently content from outside a user's social graph appears in their feed.

### What is DPP filtering and where is it implemented?

Determinantal Point Process filtering is a probabilistic re-ranking method that improves slate diversity by selecting subsets of posts that maximize both quality and variety. According to the x-algorithm source code, this logic resides in [`vm-ranker/scoring/dpp_model.rs`](https://github.com/xai-org/x-algorithm/blob/main/vm-ranker/scoring/dpp_model.rs) at lines 137-149, where it logs filtering actions and specific post IDs removed from the slate.

### Can post-processing adjustments be configured via feature flags?

Yes, the pipeline supports runtime configuration through feature flags such as `rust_home_mixer_enable_author_diversity`, `rust_home_mixer_author_diversity_decay`, and `rust_home_mixer_out_of_network_multiplier`. These parameters control whether diversity decay applies, set specific decay rates and floors, and adjust out-of-network multipliers without requiring code redeployment.