Planning search relevance experiments
I'm working on producing a plan for search relevance experiments involving interleaving, counterfactuals, click models, and guardrails. I need to structure the plan concisely but include enough details about metrics, design steps, sample sizes, and logging.
I'll mention team roles and use approaches like online interleaving for fast detection, counterfactual learning to rank using inverse propensity scoring, and click models for labeling.
I also want to address biases, including position bias and novelty, and provide guidelines on instrumentation. A step-by-step timeline and checklists would be critical for clarity.Outlining online experimentation
I'm laying out an online experimentation plan. I'll focus on interleaving techniques, distinguishing between team draft interleaving and probabilistic interleaving for specific scenarios.
For the design, I'm considering randomization per query or user session. Metrics will include win rates and preferences. I'll plan counterfactual evaluations and collect exploration logs using methods like epsilon-greedy.
Additionally, I'm emphasizing guardrails for technical factors like latency, relevance metrics, and user engagement. Monitoring is essential for ongoing adjustments, and I’ll outline pitfalls to consider, such as interference and caching.
0) Frame the problem (pre-experiment spec)
Objective: detect whether a new ranker (or retrieval/rerank change) improves user-perceived relevance without harming system/business health.
Primary hypothesis: “Variant B is preferred to A on a per-query basis.”
Define the query universe & segments:
- Head/torso/tail queries (by frequency)
- Navigational vs informational vs transactional
- New vs returning users; locale/device
- “Hard” cases (long queries, ambiguous, high reformulation rate)
Decide unit of randomization:
- Prefer query-level within a session for interleaving (reduces variance)
- Prefer user/session-level for A/B if carryover or personalization effects are strong
1) Instrumentation & logging (required for everything)
Log at impression granularity with stable IDs:
request_id, user_id/session_id, timestamp, query text + normalization, locale/device
- Full ranked list shown: doc IDs, positions, scores, result types (web/product/etc)
- Any truncation/blocks (ads, panels) and what was above/below the fold
- Interaction events with timestamps: clicks, long clicks/dwell, add-to-cart, reformulation, back, scroll depth
- Latency breakdown: retrieval, rerank, rendering, network; cache hits
- Randomization metadata: experiment assignment, interleaving method, propensity if using exploration (see counterfactuals)
Without reliable logging/propensity, counterfactual evaluation will be weak or invalid.
2) Fast online comparisons: Interleaving (primary for “ranker vs ranker”)
Use interleaving when both systems return largely the same candidates and you want sensitivity with low traffic.
Recommended method
- Team Draft Interleaving (TDI) for simplicity/robustness
- Probabilistic Interleaving (PI) if you need better handling of overlap/ties and want a cleaner statistical model
How to run it
- For each eligible query, generate two ranked lists: A and B.
- Interleave into one shown list; attribute each shown position to A or B.
- Define “credit” rules:
- Basic: credit the team owning the clicked result
- Better: credit only satisfied clicks (e.g., dwell > N seconds, or no immediate pogo-stick)
- Compute per-query outcome: A win / B win / tie.
- Test on paired outcomes (e.g., sign test / binomial; or mixed-effects for segments).
Primary metric
- Interleaving win-rate (or preference probability):
P(B preferred over A).
Practical guardrails for interleaving validity
- Ensure both rankers draw from the same candidate set if possible (otherwise you compare retrieval + ranking, which may be fine but changes interpretation).
- If page has multiple modules (ads, carousels), either:
- Interleave only the organic block and hold others constant, or
- Treat the entire page as the unit and accept more noise (and add guardrails).
When not to use interleaving
- Large UI changes, layout changes, major retrieval changes that alter the set drastically
- Heavy personalization where showing a mixed list is undesirable
3) Standard online validation: A/B test (for product truth)
Interleaving is great for sensitivity; A/B is needed to measure full-page/system effects and business outcomes.
A/B setup
- Randomize by user/session (avoid cross-contamination)
- Run long enough to cover weekly cycles
- Use variance reduction (e.g., CUPED) if available
Primary relevance proxies (choose 1–2)
- Long-click / satisfied-click rate
- Reformulation rate (down is better), “query success” rate
- Time-to-success / abandonment
Secondary/business metrics
- CTR (careful: can increase with worse relevance via clickbait)
- Conversion / add-to-cart / downstream engagement (domain-dependent)
4) Counterfactual evaluation (OPE): measure & learn from logged data
Use this to:
- Evaluate many candidate rankers offline before spending online traffic
- Train ranking models from implicit feedback with bias correction
Requirement: logged propensities via exploration
You need a data collection policy that assigns known probabilities to displayed rankings/results, e.g.:
- Epsilon-greedy re-ranking (small random swaps)
- Shuffle within buckets
- Top-k randomization with constraints (safe exploration)
Log propensity for each displayed item at each position.
Estimators
- IPS (Inverse Propensity Scoring) for expected reward (click/satisfied click)
- SNIPS (self-normalized IPS) for stability
- Doubly Robust (uses a reward model + IPS) for lower variance
What to evaluate counterfactually
- Expected satisfied clicks@k
- Expected reformulation reduction (if modeled)
- Any reward that can be attributed to impressions/clicks with timestamps
Guardrails for counterfactual use
- Check propensity support: candidate policy must not put weight on actions never/rarely taken under logging policy.
- Monitor variance/exploding weights; clip weights if needed and report sensitivity.
5) Click models (debias clicks into relevance signals)
Click models help you:
- Convert biased clicks into estimated relevance
- Diagnose position bias and UI effects
- Generate soft labels for LTR training and offline evaluation
Start with a simple model, then iterate
- PBM (Position-Based Model): click ≈ examination(position) × relevance(doc,query)
- If you have enough data: DBN/UBM to model dependencies, satisfaction, and multiple clicks.
Outputs you’ll use
- Estimated examination probabilities by position/device/query type
- Per (query,doc) relevance posterior or expected relevance
- Debiased metrics (e.g., expected relevance@k)
Validation loop
- Validate click-model-derived improvements against interleaving outcomes on matched query sets.
- If click model says “better” but interleaving disagrees consistently, investigate UI/position bias mismatch or label leakage.
6) Guardrails (non-negotiable constraints + monitoring)
Define hard guardrails (must not regress beyond threshold) and soft guardrails (monitor).
System health guardrails
- p95/p99 latency by stage (retrieval, rerank, render)
- Error/timeout rate
- Cache hit rate changes
- Infrastructure cost (CPU/GPU, QPS capacity)
Relevance & UX guardrails
- Zero-results rate / empty-module rate
- Abandonment rate, pogo-sticking
- Query reformulation rate
- Diversity/duplication (e.g., near-duplicate results in top-k)
Business/safety guardrails (domain-specific)
- Conversion, revenue/session
- Policy/safety violations, “bad content” rate
- Fairness/exposure constraints (if applicable)
Operational guardrails
- Ramp plan: 1% → 5% → 25% → 50% → 100%
- Automated rollback triggers tied to hard guardrails
- Alerting on metric drift and logging breaks
7) Recommended experiment sequence (practical plan)
-
Offline sanity
- Run offline metrics (NDCG on judged set if you have it; otherwise click-model expected relevance@k).
- Check latency/cost on shadow traffic.
-
Interleaving pilot (fast signal)
- 1–5% traffic, query-level assignment.
- Primary decision: is B preferred overall and in key segments?
-
Exploration logging (if you don’t already have it)
- Start safe randomization to enable counterfactual evaluation/training.
- Collect for 1–4 weeks depending on traffic.
-
A/B validation
- User/session randomization.
- Evaluate end-to-end metrics + guardrails.
- Confirm interleaving directionality holds.
-
Rollout + monitoring
- Gradual ramp with automated rollback.
- Post-launch checks for drift (query mix changes, seasonality).
8) Common pitfalls to explicitly guard against
- CTR lies: improved CTR can mean worse relevance; rely on satisfied clicks, reformulations, and interleaving.
- Interference/carryover: personalization and session learning can contaminate query-level experiments; use session-level when needed.
- UI confounds: changes in snippets, badges, or layout can dominate click behavior—separate UI tests from ranker tests when possible.
- Selection bias in logs: without exploration, counterfactual estimates can be invalid (no support).
- Metric gaming: enforce guardrails and review query examples for regressions.
If you share your context (web search vs ecommerce vs enterprise; traffic scale; whether you already have exploration/propensity logging; and whether UI/modules are stable), I can turn this into a concrete 2–4 week experiment schedule with specific metrics, stopping rules, and an interleaving + OPE logging design tailored to your stack.