Sub topic 12
Testing Feed Changes with A/B Experiments
Assume you understand basic probability, can read short Python code, and know that a feed ranks possible posts. This chapter focuses on how to test a change to that ranking system without confusing random variation with a real improvement.
What an A/B test measures
An A/B test is a controlled experiment with two versions:
- Control, or A: the existing feed system.
- Treatment, or B: the feed system with one planned change.
Eligible users are assigned randomly to one version. Random assignment makes the groups similar on average. If the groups later behave differently, the change is a plausible cause.
For example, a platform might test a new re-ranking rule that limits consecutive posts from the same author. The treatment group sees the new rule. The control group sees the current ordering.
The experiment must keep a user in the same group during the test. Otherwise, the same person may experience both systems and contaminate the comparison.
flowchart TD
U[Eligible users] --> R[Random assignment]
R --> A[Control: current feed]
R --> B[Treatment: new feed rule]
A --> M1[Collect metrics]
B --> M2[Collect metrics]
M1 --> C[Compare groups]
M2 --> C
C --> D[Decision]Choosing metrics
A feed change can improve one behavior while harming another. Choose a primary metric before starting the experiment. The primary metric is the main measure used to judge success.
Common metrics include:
| Metric | What it measures | Possible weakness |
|---|---|---|
| Session return rate | Whether users come back later | Slow to collect |
| Meaningful comments per user | Discussion activity | May favor controversial posts |
| Hide or report rate | Negative reactions | Can be noisy for small groups |
| Feed satisfaction | User-reported experience | Fewer users answer surveys |
A click, like, or long session is not automatically a good outcome. A ranking change may increase time spent because users struggle to find useful posts. Pair engagement metrics with quality and integrity metrics.
Use guardrail metrics as safety checks. A guardrail metric might be report rate, creator reach, latency, or unfollow rate. A treatment should not ship merely because its primary metric rises if a guardrail worsens sharply.
Interpreting the result
Suppose the treatment produces 5.2 meaningful comments per 1,000 users, while control produces 5.0. The observed difference is 0.2 comments per 1,000 users. That difference may come from the feed change, or it may be random noise.
A confidence interval gives a range of plausible values for the treatment effect. If the interval is wide, the experiment may need more users or more time. Statistical significance does not tell you whether an effect is useful. A tiny effect can be statistically reliable but not worth the engineering and user-experience cost.
Check results by important segments:
- New users versus established users.
- Heavy viewers versus occasional viewers.
- Different regions, devices, or languages.
- Users who follow many creators versus few creators.
Segment checks can reveal harm hidden by an average. However, testing many segments also increases the chance of finding an apparently meaningful result by luck. Treat unexpected subgroup findings as hypotheses until they are replicated.
Common experiment errors
Several mistakes make feed experiments unreliable:
- Selection bias: only certain users enter the treatment group.
- Interference: a user’s treatment changes what their friends see, affecting control users too.
- Novelty effects: users react to a new layout temporarily.
- Carryover: users exposed to one ranking system later influence results in another group.
- Peeking: stopping as soon as a metric briefly crosses a threshold.
- Multiple comparisons: declaring success because one of many metrics happened to improve.
Run the test long enough to cover normal weekly behavior. Monitor the system while the test runs, but define stopping rules in advance. Stop early for serious safety or reliability problems.
def relative_lift(control, treatment):
"""Return treatment's proportional change over control."""
if control <= 0:
raise ValueError("control must be positive")
return (treatment - control) / control
control_comments = 5.0
treatment_comments = 5.2
print(f"{relative_lift(control_comments, treatment_comments):.1%}")The output is a 4.0% relative lift. That number is descriptive; it does not by itself establish that the lift is real or valuable.
Making the decision
A practical decision uses several questions:
- Did the primary metric improve by enough to matter?
- Did guardrail metrics remain within acceptable limits?
- Did the result persist across the planned test period?
- Did important user groups experience comparable outcomes?
- Can the system operate reliably at full traffic?
If the result is uncertain, extend the experiment, run a follow-up test, or ship gradually with monitoring. If the treatment harms users, roll it back even when engagement rises.
Exercise
A treatment raises comments by 4%, but reports and unfollows also rise beyond their guardrail limits. Should it ship?
Show answer
No. The engagement gain does not outweigh the integrity and retention harm. Investigate the cause, revise the treatment, or reject it.