Sub topic 10
Balancing Exploration and Exploitation
This chapter assumes you understand basic feed ranking, candidate generation, and probability values from 0 to 1. You should also be able to read short Python programs. We will focus on how a feed gives attention to both familiar high-performing content and less-known content.
The central trade-off
A feed ranker faces two competing choices:
- Exploitation means showing content that the system already expects you to like or discuss.
- Exploration means showing content whose value is uncertain so the system can learn more about it.
Exploitation usually improves short-term engagement. If a model predicts that you will enjoy posts from a particular author, showing those posts is a reasonable choice. Exploration creates opportunities to discover new authors, topics, and formats. It also gives new posts a chance to collect enough reactions for better predictions.
A system that only exploits can become narrow. A system that explores too much can feel irrelevant because it spends too many feed slots on uncertain choices.
| Strategy | Benefit | Risk |
|---|---|---|
| Exploitation | Strong immediate relevance | Repeats familiar content and favors established authors |
| Exploration | Finds new content and improves model knowledge | May reduce short-term satisfaction |
| Balanced policy | Learns while preserving relevance | Requires tuning and measurement |
Why exploration is necessary
Ranking models learn from observed behavior. A post cannot receive likes, comments, or hides if it is never shown. This creates a data problem called selection bias: the system sees reactions mainly for content it already chose to display.
Suppose a new author publishes a useful post. The ranker has little history for that author, so the post receives a low predicted score. If the system always chooses the highest scores, the post may never appear. The system then collects no evidence that its prediction was wrong.
This is one form of the cold-start problem. A new user has little interaction history, and a new post or author has little performance history. Exploration supplies limited exposure so the system can gather evidence.
A simple exploration policy
One basic method is epsilon-greedy selection. The system normally chooses the highest-ranked post, but with probability epsilon, written as ε, it chooses from an exploration pool instead.
If ε = 0.1, the policy explores about 10 percent of the time over many decisions. It exploits the current ranking for the other 90 percent. The exact rate would need testing in a real system.
import random
def pick_slot(ranked_post, explore_pool, epsilon=0.1, rng=random):
"""Choose the ranked post or explore another candidate."""
if explore_pool and rng.random() < epsilon:
return rng.choice(explore_pool)
return ranked_post
rng = random.Random(7)
chosen = pick_slot(
ranked_post="post_from_known_author",
explore_pool=["new_post_a", "new_post_b"],
epsilon=0.1,
rng=rng,
)
print(chosen)The exploration pool should not contain arbitrary content. Integrity filters can remove spam, unsafe material, duplicate posts, or content outside the user's selected settings before exploration occurs.
Where exploration happens
Exploration can be applied at several stages:
- Select a small number of candidates from less-known authors.
- Reserve one or more feed positions for eligible new posts.
- Test different topics or formats for users with uncertain preferences.
- Vary recommendation sources while keeping the rest of the feed stable.
Exploration can also be targeted. A user who frequently reads cooking posts might receive an unfamiliar cooking author rather than an unrelated topic. This keeps the experiment useful while still expanding the user's choices.
Measuring the balance
Teams should measure both immediate outcomes and learning outcomes. Useful measures include:
- Engagement on explored posts compared with similar established posts.
- The number of new authors or topics a user meaningfully encounters.
- Negative signals such as hides, reports, quick exits, or unfollows.
- Whether later predictions become more accurate.
- Whether exposure becomes concentrated among a small group of authors.
A high click rate alone can hide a poor balance. Exploration might generate clicks but also increase reports or reduce long-term retention. Conversely, exploration that produces few immediate clicks may still reveal valuable content and improve future rankings.
The balance is not fixed forever. As a system gathers evidence, it may reduce exploration for a well-understood preference or increase it when predictions become uncertain. Product teams can also give users controls such as chronological viewing, topic preferences, mute options, or feedback buttons. These controls change which candidates are eligible and which signals the system receives.
Exercise
A feed uses epsilon-greedy selection with ε = 0.2. What does this setting mean, and what problem does it help address?
Show answer
Over many selections, the system explores about 20 percent of the time and exploits the current best-ranked choice about 80 percent of the time. Exploration helps collect evidence about new or uncertain content that would otherwise receive too little exposure.