A ranking cascade changes both its workload and the population reaching later stages
Analyze candidate filtering, request escalation, conditional quality, and mixture latency without confusing cohort differences with treatment effects.
On this page
The question for today
What you’ll understand
- Calculate average work for a conditional request-escalation policy.
- Distinguish mixture latency distributions from averages of stage quantiles.
- Evaluate later-stage quality on the appropriate eligible and routed cohort.
Recommendation systems often spend cheap work broadly and reserve expensive scoring for fewer items or harder requests. That cascade can save resources, but it changes which examples reach later stages. A higher observed click rate or quality score in one stage does not by itself measure that stage's causal improvement. The serving analysis needs both a dependency-aware cost model and an evaluation design that respects routing, filtering, and the resulting conditional populations. Average savings can also conceal an expensive tail.
Name whether the cascade filters items or routes requests
An item cascade scores many candidates cheaply and retains a subset for a heavier scorer. Its later cost depends on retained count, shape, batching, feature access, and hardware scheduling. A request cascade instead escalates only requests meeting a gate, such as low confidence or a particular context. Some systems combine both. Define each gate and preserve its reason in the request record. A change in an early threshold affects downstream work and the relevance ceiling, so evaluate its quality-cost curve rather than optimizing its rejection count alone.
For a simple request gate, expected cost is cheap-path cost plus the probability of escalation times its conditional added cost. If expensive requests take longer specifically because they contain more candidates, the added-cost expectation must be conditioned on escalation; multiplying the route rate by a fleet-wide mean is incorrect. Shared-resource queuing can also change the costs when the gate changes traffic. Start with a transparent fixed-cost calculation, then measure the real completed path and resource demand under the new routing policy.
A mixture's quantile is not an average of route quantiles
When requests have different paths, their aggregate latency CDF is a weighted mixture of the conditional path CDFs. A tail quantile must be obtained from that mixture. Averaging each path's p95, or adding individual stage p95 values, does not generally produce request p95. Record end-to-end latency by route, candidate count, cache state, and relevant user cohort. Include failed and timed-out requests under a stated policy so a fast successful-only distribution does not hide expensive dropped work or systematically exclude a difficult population.
Quality comparisons must respect the same conditional cohorts. Hard requests chosen for escalation can have lower baseline quality than easy requests, or the gate can select cases where an expensive model is unusually effective. Comparing their observed quality with the cheap-only population mixes model effect with selection. Evaluate controlled alternatives on the hard cohort, or use a justified randomized policy design, before claiming lift. Routing labels and model versions should accompany feedback so an offline metric does not silently pool different policies and reference sets.
Tune the gate under measured traffic and quality
Sweep one gate or retained-candidate limit while holding eligibility, data window, and score versions fixed. Measure unique candidate coverage, completed route latency, resource bytes or compute, and a justified quality measure for each affected cohort. Validate the fallback used when an expensive stage times out; it can produce a different slate and feedback distribution. A useful change reduces cost while satisfying the declared quality and tail requirements, rather than appearing better only because the hardest requests stopped contributing to its reported denominator.
The queue lab offers a narrower headroom illustration. Reset, set both λ=2 and μ=3, predict the separate stable M/M/1 mean residence one second, then Play or Step. Reset and set both λ=2 and μ=2.5 for two seconds. Its displayed backlog is deterministic fluid q=max(0,4+(λ−μ)t), starting at four, while that residence number assumes a stable Poisson-arrival, exponential-service single server. Neither models cascaded routes, conditional quality, batching, or a mixed service distribution. Use real routed-request traces rather than treating the toy residence value as your cascade's tail prediction.
Work it through
A cheap average does not describe the hard cohort's tail
In a hypothetical request cascade, 70% of requests take a cheap-only path of10 ms and have mean quality score 0.8. The remaining 30% use a40 ms escalated path with mean quality 0.9. Treat these as fixed route durations and descriptive conditional quality values, not a randomized causal comparison.
Mean latency is0.7×10+0.3×40=19 ms. Equivalently, every request pays 10 ms and 30% pay an additional 30 ms; the route probability and added-cost definition agree.
Pooled mean quality is0.7×0.8+0.3×0.9=0.83. The escalated cohort's0.9 compared with the cheap cohort's0.8 is not an identified 0.1 model effect because the gate selected different requests.
The latency CDF is0.7 at10 ms and 1 at40 ms, so its smallest 95th-percentile latency is40 ms. The 19 ms mean does not imply a tail near 19 ms or prove the escalation satisfies a deployment budget.
Evaluate the gate's average cost, route-specific behavior, mixture tail, and controlled quality effect as separate quantities.
The living notebook
Explore the model
Interactive lab · queue
Headroom matters, but a single-server toy is not a cascade
Reset, set both λ=2 and μ=3, predict the separate M/M/1 residence 1 s, then Play or Step. Reset and re-enter both λ=2 and μ=2.5 for 2 s. The backlog is fluid q=max(0,4+(λ−μ)t), starting at4; edits retain time. The residence assumes stable Poisson arrivals and exponential single-server service. There are no routes, ranking stages, mixed durations, or request-tail quantiles.
- 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 forModel routing and conditional service work explicitly before predicting a cascade's latency or quality.
Pause & reason
Check your understanding
Your turn
Try it yourself
A fixed-duration cascade sends 80% of requests to8 ms and 20% to28 ms. Compute mean latency and the smallest p95 under this two-point distribution. If the late route's observed satisfaction is lower, what cannot be concluded from that comparison alone?
Take a moment to make a prediction or work it out on paper. Open a hint when you need one.
Give me a hint
The CDF reaches only 0.8 at the fast duration; keep descriptive route outcomes separate from causal effects.
Compare with the solution
Mean latency is0.8×8+0.2×28=12 ms. The smallest latency whose CDF reaches 0.95 is28 ms. Lower satisfaction in the selected late route does not establish that its model caused lower satisfaction; the routed requests may have been harder before escalation, and a suitable comparison must hold that selection mechanism in view.
Keep the idea
Take it with you
- Item filtering and request routing create different cost and coverage effects.
- Conditional costs and mixture CDFs preserve information that pooled averages lose.
- Stage-quality comparisons need a valid cohort or randomized design before a causal interpretation.
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.