advanced28 min studyLesson 947 in Engineering

Service frontiers: preserve quality and latency while comparing cost

Distinguish feasible configurations and Pareto dominance from unconstrained low cost in controlled AI serving experiments.

On this page

What you’ll understand

  • Apply explicit quality and tail-latency feasibility constraints.
  • Test dominance using compatible workload and cost boundaries.
  • Explain why batching can move multiple service metrics at once.

Larger batches can improve resource efficiency while making requests wait longer. Other changes can reduce token cost by changing truncation, model quality, or the served workload. A useful comparison preserves the required service before declaring a cost improvement. All prices here are explicitly fictional stable teaching inputs in fictional credits, FC. The numerical configurations are controlled experimental fixtures, not vendor offers. We compare cost, measured quality, and latency under one workload and acceptance procedure, while treating uncertainty and resource feasibility as part of the evidence.

Define the service-feasible set first

Choose a fixed cohort, traffic process, quality oracle, and client-visible latency boundary. Specify whether cost is per offered task or successful logical task, and preserve that denominator across configurations. A p95 duration means a percentile under the measured workload; it is not the maximum or a universal per-request guarantee. Repeat measurements under relevant demand classes and keep rejected or timed-out tasks visible. Otherwise a system can improve its apparent tail by dropping exactly the requests whose latency would have been measured.

Quality and latency constraints define a feasible set rather than another unconstrained score to trade away silently. A configuration below the minimum quality requirement is not an equivalent cheap service, even if its throughput is excellent. A low average latency does not satisfy a tail constraint automatically. State how uncertainty affects borderline cases: a point estimate just above a quality threshold is weak evidence if its interval crosses the boundary. Capacity, isolation, and memory limits can further exclude a configuration despite attractive measured averages.

F={j:qj≥qmin⁡, L95,j≤Lmax⁡}\mathcal F=\{j:q_j\ge q_{\min},\ L_{95,j}\le L_{\max}\}
q is the specified unitless higher-is-better quality score and L95 and Lmax use the same time unit. This is a point-estimate teaching criterion; real qualification must address uncertainty and any additional constraints.↔ Scroll wide equations horizontally.

Dominance requires a common measurement basis

A configuration dominates another in this three-metric comparison if it is no more costly, no worse in quality, and no slower in the stated latency measure, with at least one strict improvement. Two points can instead be incomparable: one is cheaper while the other is better and faster. The remaining frontier does not pick a unique operating policy. Requirements and an explicitly justified objective are needed to choose among incomparable feasible points. Avoid hiding those choices in an arbitrary aggregate score whose weights users never approved.

The comparison is only meaningful under compatible resource budgets, workload, accounting boundary, and metric definitions. Serving research such as DistServe studies throughput and latency tradeoffs for specified systems and workloads, not a universal cheapness ranking. Record batching timeout, maximum batch size, output length policy, cache behavior, model version, and rejection rules. These parameters can change both resource efficiency and useful output. A cheap point that uses a different quality target or excludes recovery cost belongs to another experiment until the difference is explicitly accounted for.

A≺B ⟺ cA≤cB, qA≥qB, LA≤LB with at least one strict inequalityA\prec B\ \Longleftrightarrow\ c_A\le c_B,\ q_A\ge q_B,\ L_A\le L_B\ \text{with at least one strict inequality}
c values use identical fictional FC/task boundaries, q uses the same quality oracle, and L the same latency statistic. A≺B denotes A dominating B in this defined comparison, not a universal ordering.↔ Scroll wide equations horizontally.

Use controlled changes to explain the frontier

Sweep one policy at a time when possible and repeat at matched demand rather than compare an overloaded baseline with an underloaded candidate. Include warmup, steady-state, and failure behavior as separately identified phases. A batching timeout can lower device idle time while increasing queue residence before execution; a larger batch can also change workspace and memory pressure. Measure the client-facing result and full included effort instead of assuming that a kernel-throughput increase translates directly into lower cost per accepted task.

The queue lab supplies a narrow latency-headroom analogy. Reset, explicitly set arrival rate two and service rate three, predict, then Play or Step. Compare a separate fresh Reset with arrival rate 2.5 and service rate three explicitly set. Its M/M/1 mean residence rises from one to two seconds under the displayed formula’s assumptions; that value is a mean, not p95. The animated backlog is a separate deterministic fluid toy starting at four. There are no batches, quality scores, prices, or frontier computation, so the lab cannot locate a real serving configuration on this three-metric frontier.

Filter before preferring a cheaper configuration

All fictional costs are FC per offered task under one fixed cohort. A has cost 0.08, quality 0.92, and p95 80 ms; B has 0.06, 0.90, and 110 ms; C has 0.09, 0.91, and 90 ms; D has 0.07, 0.88, and seventy ms. Require quality at least 0.90 and p95 at most 100 ms.

  1. A and C satisfy both point-estimate constraints. B satisfies quality but fails latency at 110 ms; D satisfies latency but fails quality at 0.88. Their lower fictional prices do not make them feasible substitutes under this requirement.

  2. Compare A with C: 0.08≤0.09 FC/task, 0.92≥0.91 quality, and eighty≤ninety ms. A dominates C on all three measured dimensions within this controlled fixture.

  3. A and B are globally incomparable on these dimensions because B is cheaper while A is better and faster. The latency requirement excludes B here; another requirement could produce a different feasible set, so no universal ranking follows.

The result

A is the undominated feasible point in this small stated fixture. This conclusion does not extrapolate to other workloads or uncertain measurements.

Explore the model

Interactive lab

Interactive lab · queue

Queue residence is one ingredient of service feasibility

Use independent Reset → explicitly set BOTH λ and μ → predict → Play/Step runs for (2,3) and (2.5,3). Displayed M/M/1 mean residence is one versus two seconds, not a p95 estimate. No batching, price, quality, or frontier is modeled.

Queue residence is one ingredient of service feasibilityFluid backlog starts at 4 and follows max(0, 4 + (λ − μ)t). The separate M/M/1 residence-time formula assumes Poisson arrivals, exponential service and λ < μ. Current readings: Fluid backlog: 4; Net rate · λ − μ: −1 /s; M/M/1 mean residence: 1 s. All parameters are adjustable with the labeled controls below.02.557.51001.534.56Elapsed time · sFluid backlogλ < μ
Fluid backlogCurrent time
Fluid backlog
4
Net rate · λ − μ
−1 /s
M/M/1 mean residence
1 s
t = 0 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 forCompare complete feasible service configurations under matched measurement rules.

Check your understanding

One configuration is cheaper, while another has better quality and lower p95 latency. What follows from those facts alone?

Try it yourself

Under a common fictional cost boundary, E has cost 0.05 FC/task, quality 0.89, and p95 ninety ms; F has 0.07, 0.92, and eighty-five ms. Test dominance, then require quality at least 0.90 and p95 at most 100 ms.

Take a moment to make a prediction or work it out on paper. Open a hint when you need one.

Give me a hint

Check all three directions for dominance before applying the two feasibility inequalities.

Compare with the solution

Neither point dominates: E is cheaper, while F is higher quality and faster. E fails the quality requirement despite satisfying latency. F passes both, so it is the only feasible point among these two under the point-estimate fixture. This is a constrained experimental conclusion, not a real purchasing recommendation. If quality or latency estimates have meaningful uncertainty, collect enough matched evidence to establish that the requirements hold before promoting either configuration.

Take it with you

  • Apply quality and latency feasibility before comparing cheapness.
  • Dominance leaves some configurations incomparable.
  • Preserve workload, denominator, uncertainty, and full-service boundaries.

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.