Judge recommendation quality, completed tail latency, and cost on the same cohorts
Build a versioned evaluation contract that includes outcome meaning, request completion, timeouts, resource accounting, and population shifts.
On this page
The question for today
What you’ll understand
- Reconcile pooled and cohort-specific outcome rates under changing traffic weights.
- Calculate an end-to-end budget and a defined cost-per-request measure.
- Separate descriptive metrics, offline policy estimates, and randomized outcome evidence.
A recommendation change can increase pooled clicks while harming a new-user cohort, or lower successful-request latency by timing out the slowest requests. A larger candidate set can improve an offline metric while making feature lookup too expensive. Evaluation therefore needs a contract covering useful outcomes, the completed serving path, and cost for the same population. Keep versions, cohorts, denominators, and failure policies together. A single average or proxy cannot certify that the whole recommendation experience improved.
Define outcomes and keep population weights visible
Use a relevance or user-outcome definition with an explicit horizon and measurement unit. Click-through rate is clicks per defined exposure opportunity, not a universal measure of utility. Satisfaction, retention, task completion, and harmful repetition can move differently. Offline ranking metrics also depend on the candidate universe and whether negatives were sampled. Preserve those choices and feedback knowledge windows so a changed score is not actually a changed denominator, easier candidate set, or use of later information unavailable to the compared decision.
Break results down by meaningful request and user cohorts, including sparse history, new items, region, device, route, and cache state where appropriate. A pooled rate is a weighted combination of cohort rates. Traffic composition can change that rate even when within-cohort behavior is unchanged or worse. Report fixed-population standardized comparisons when useful, but do not pretend reweighting alone creates causal identification. For causal claims, use an appropriate randomized or otherwise justified design with consistent eligible populations and outcome collection.
Budget the actual completed path and failures
Measure request latency from a declared start to a usable response or defined failure, including readiness, feature fetches, retrieval, ranking, constraints, and serialization as appropriate. Parallel source retrieval follows its required join, not the sum of all branch times. Tail percentiles must come from the end-to-end distribution; summing stage p95 values or averaging route p95 values generally gives the wrong number. State how timeouts, cancellations, degraded fallbacks, and retries enter both latency and quality reports. A successful-only tail can improve simply because hard requests disappeared.
Track resource cost per stated work unit using a defined boundary: device time, host time, network bytes, storage, or money under a particular pricing scope. Allocated capacity and marginal utilization are different accounts. Include cold-cache or index-refresh regimes when they matter operationally. A larger candidate or embedding configuration should be evaluated on the same useful request mix and outcome requirement. Faster service that changes eligibility, omits work, or fails to return a meaningful slate is a different product behavior, not automatically an efficiency gain.
Approve a change from coherent evidence
First verify a compatible model-index-state version, correct exposure and feedback joins, and candidate coverage. Then compare relevance or outcome measures, the required tail and failure rates, and resource cost on aligned cohorts. Preserve uncertainty, experiment assignment, and enough request lineage to investigate regressions. A policy that changes exploration or eligible actions can require new support for offline evaluation. A controlled online comparison should still monitor long-horizon outcomes and cohort harms rather than declaring victory from an early click proxy alone.
The queue lab gives a limited capacity-warning analogy. Reset, set both λ=2 and μ=3, predict stable M/M/1 mean residence 1 second, then Play or Step. Reset and set both λ=2.5 and μ=3 for 2 seconds. Its visible fluid backlog starts at four and follows max(0,4+(λ−μ)t); its separate mean assumes Poisson arrivals and exponential single-server service. There are no recommendation cohorts, tail percentiles, failures, money, or user outcomes. Use measured end-to-end request distributions and the defined cost account rather than interpreting this toy mean as a production budget.
Work it through
A pooled click improvement can coexist with a worse cohort
Baseline exposure weights are 80% returning users and 20% new users, with click rates 0.10 and 0.04. Candidate weights are 90% and 10%, with rates 0.11 and 0.03. These are descriptive rates, not randomized effects. Separately, a completed request has 4 ms preparation, parallel retrieval branches of8 and 12 ms, and 6 ms required ranking; a cost window uses 120 resource units for 1000 attempts.
Baseline pooled CTR is0.8×0.10+0.2×0.04=0.088. Candidate pooled CTR is0.9×0.11+0.1×0.03=0.102, while the new-user rate fell from 0.04 to0.03. Both composition and within-cohort rates changed.
Standardizing the candidate rates to baseline weights gives 0.8×0.11+0.2×0.03=0.094. This separates a descriptive weight change but does not by itself identify the policy's causal effect or convert clicks to satisfaction.
Under the fixed-duration parallel-path assumptions, request completion is4+max(8,12)+6=22 ms. Defined cost per attempt is120/1000=0.12 resource units. Neither one path calculation nor a mean cost establishes a measured fleet p95 or a quality guarantee.
Keep cohort outcomes, traffic weights, path timing, and cost denominators visible. They constrain different parts of the decision to deploy a recommendation change.
The living notebook
Explore the model
Interactive lab · queue
A capacity warning is separate from a recommendation SLO
Reset, set both λ=2 and μ=3, predict the separate stable M/M/1 mean 1 s, then Play or Step. Reset and re-enter both λ=2.5 and μ=3 for 2 s. Fluid backlog is max(0,4+(λ−μ)t), starting at four; the residence assumes Poisson arrivals and exponential single-server service. There are no measured tails, cohorts, failures, costs, or quality outcomes.
- Fluid backlog
- 4
- Net rate · λ − μ
- −1 /s
- M/M/1 mean residence
- 1 s
Fluid backlog starts at 4 and follows max(0, 4 + (λ − μ)t). The separate M/M/1 residence-time formula assumes Poisson arrivals, exponential service and λ < μ. Parameter changes pause playback and recompute the model at the current elapsed time. Reset restores both parameters and returns time to zero. Playback starts paused. Adjust either parameter, then choose Play or Step.
Look forEvaluate the completed request and meaningful outcome under a shared cohort and cost contract.
Pause & reason
Check your understanding
Your turn
Try it yourself
A window costs 75 defined resource units across 500 attempts, of which 450 yield useful completed recommendations in10 seconds. Compute cost per attempt, cost per useful completion, useful throughput, and failure-or-not-useful fraction under these definitions.
Take a moment to make a prediction or work it out on paper. Open a hint when you need one.
Give me a hint
Keep the attempted and useful-completed denominators separate.
Compare with the solution
Cost per attempt is75/500=0.15 units; cost per useful completion is75/450=one sixth of a unit, about 0.1667. Useful throughput is450/10=45 completions/s. The fraction not counted useful is50/500=10%. These accounts need the declared usefulness and cost scope; excluding those fifty attempts from all reports would hide part of the serving behavior.
Keep the idea
Take it with you
- Outcome meaning, cohort weights, and feedback windows belong beside every recommendation metric.
- Measure completed request tails and failures rather than adding stage quantiles or filtering difficult requests away.
- Compare quality, valid throughput, and defined resource cost on the same versioned population.
Read further
Original sources and deeper explanations to follow at your own pace.
Optional progress, saved in this browser when available. Revisit any lesson at any time.
Lesson not marked complete.