Evaluation, Testing & Optimization·Task 4.5·Bloom: apply·Difficulty 3/5·8 min read·Updated 2026-07-14

P95 Latency as the Design Target

Optimize token usage, latency, and cost-performance trade-offs

SUBy Solomon UdohReviewed by Solomon UdohAI-assisted · human-reviewed
In short
P95 latency is the value below which 95% of requests complete, making it a more useful design target than the median because SLA breaches are driven by the slower requests at the tail, not the typical one. A demo tested one request at a time will not reveal p95 latency under concurrent production load. Latency is driven by task complexity, model size, and output length, while volume alone primarily pressures cost rather than latency at moderate request rates.

Design for the requests that breach, not the ones that don't

A latency SLA is not breached by the typical request, it is breached by the slow ones. That single fact is why designing a system to its median latency is a mistake: the median describes the request in the middle, which was never going to breach anything, while the requests that do breach live out at the tail where the median cannot see them. This apply-level knowledge point is about using p95 as the design target, understanding why a single-request demo hides it, and knowing what actually drives latency so you optimize the right variable.

P95 latency
The latency value below which 95% of requests complete; only the slowest 5% take longer. P95 is a more useful design target than the median because SLA breaches are driven by the tail, not the typical request. It must be measured under concurrent production load, since a single-request demo does not reveal it. Latency is driven by task complexity, model size, and output length, whereas request volume primarily pressures cost at moderate rates.

Why the median lies and p95 tells the truth

The median (p50) is the latency of the middle request, half are faster, half are slower. It is a fine description of a typical request and a poor description of the requests that cause problems. Since an SLA is breached whenever a request exceeds the threshold, and the requests that exceed it are the slow ones at the top of the distribution, the median simply does not describe the population you care about. Optimize to the median and you have built a system that is fast for the requests that were never at risk while leaving the tail free to breach.

P95, the value below which 95% of requests complete, deliberately reaches into that tail. It says: 95% of requests are at least this fast, and only the slowest 5% are worse. That is a target aligned with the SLA, because it constrains the part of the distribution where breaches actually happen. Designing to p95 (or a higher percentile for stricter SLAs) is designing for the requests that decide whether you meet the SLA.

A single-request demo cannot show you p95

There is a practical reason p95 is easy to miss: demos do not surface it. A demo typically issues one request at a time, with no competing load, so what you observe is close to a best-case single-request latency, essentially the median under no contention. Production sends many requests concurrently, and under that concurrency the tail stretches, some requests wait, some coincide with heavier ones, and p95 climbs well above the tidy number the demo showed. So a system that looked comfortably within its SLA in a demo can breach it in production, not because anything changed but because the demo never measured the metric that matters. P95 has to be measured under concurrent load that mimics production, not from one-at-a-time trials.

What actually drives latency

Optimizing latency requires knowing what moves it, and the drivers are task complexity, model size, and output length: harder tasks, larger models, and longer generated responses all take more time. Those are the levers, simplify the task, choose an appropriately sized model, cap or reduce output length.

What is not primarily a latency driver, at moderate request rates, is raw volume. High daily volume pressures cost, more requests, more tokens, more spend, but it does not automatically threaten latency if the requests are well spread and the system is not saturated. A large "requests per day" figure can average out to comfortably spaced requests that each complete quickly. Assuming high volume must breach a latency SLA confuses the cost axis with the latency axis; the two are driven by different things.

p95 not p50
the tail breaches the SLA, not the median
concurrent load
p95 only appears under production-like concurrency
complexity, size, length
the real latency drivers, not raw volume

What the exam trips candidates on

The first trap is designing a system to meet a latency SLA using median latency figures instead of p95, missing the tail requests that actually breach the SLA. A scenario will present a design signed off on median latency; the credited reading switches the target to p95, measured under concurrent load, because the median hides the breaching tail.

The second trap is assuming a high daily request volume automatically threatens a latency SLA, when the load may actually average out to well-spaced sequential requests. A scenario will treat a big volume number as a latency problem; the correct answer separates the axes, noting volume primarily pressures cost, and that latency is driven by task complexity, model size, and output length, so a well-spread high volume need not breach the SLA.

Worked example

A team is designing a document-review assistant with a 5-second latency SLA. Their demo, run one request at a time, showed 2.5-second responses, so they sign off on the SLA. Separately, a stakeholder worries that 800 documents a day will breach the SLA. Evaluate both judgments.

Both judgments are wrong, in opposite directions, and both come from confusing which number matters.

The sign-off is unsafe because 2.5 seconds is a single-request, no-contention measurement, essentially the median under ideal conditions, not p95 under production load. The SLA is breached by the slow tail, not the typical request, and a demo run one request at a time never exercises the concurrency that stretches that tail. Under real concurrent load, p95 could easily exceed 5 seconds even though the demo showed 2.5. The correct basis for signing off is a p95 figure measured under production-like concurrency, and the design should target p95 against the 5-second line, with the latency levers (task complexity, model size, output length) tuned to keep the tail under the SLA.

The stakeholder's worry is also misplaced, but for the opposite reason. 800 documents a day is a volume figure, and at that rate the requests average out to roughly one every 100-plus seconds, easily handled sequentially without saturating anything. Volume at that level pressures cost, more documents, more tokens, more spend, not latency. Latency is driven by how complex each document task is, how large the model is, and how long the output is, none of which is set by the daily count. So 800 documents a day does not, by itself, threaten a 5-second per-request SLA.

The combined lesson: judge the SLA on p95 measured under concurrent load, tune the true latency drivers to protect the tail, and do not mistake a high daily volume, a cost concern, for a latency threat.

Common misreadings to avoid

Misconception

If median latency is comfortably under the SLA, the system will meet the SLA.

What's actually true

The median describes the typical request, not the slow tail that actually breaches the SLA. Design to p95, measured under concurrent production load, because a good median can coexist with a tail that breaches.

Misconception

A high daily request volume will breach the latency SLA.

What's actually true

At moderate rates, volume primarily pressures cost, not latency, and a large daily count can average out to well-spaced requests. Latency is driven by task complexity, model size, and output length, so high volume does not automatically threaten a latency SLA.

How this shows up on the exam

Domain 4 questions on this knowledge point present a latency SLA signed off on median or demo figures, or a high-volume number framed as a latency threat. The reliable moves are to design to p95 measured under concurrent load, to tune the real latency drivers (complexity, model size, output length), and to keep the cost axis (volume) separate from the latency axis.

This is the latency half of cost and latency modeling inputs, and its tail reasoning parallels token distribution skew, where the tail drives cost just as it drives latency here. Caching helps the latency side by not reprocessing the prefix, connecting to prompt caching, and p95 is exactly the kind of tail metric that anomaly detection and alerting watches against the SLA line, with the tail protected in production by layered reliability controls.

Check your understanding

A team signs off on a 5-second latency SLA because a one-request-at-a-time demo showed 2.5-second responses, and a stakeholder separately fears that 800 documents a day will breach it. Which assessment is correct?

People also ask

What is p95 latency?
The latency below which 95% of requests complete; only the slowest 5% are worse. It captures the tail rather than the middle of the distribution.
Why design to p95 instead of median latency?
SLA breaches come from the slow tail, not the typical request the median describes, so p95 targets the part of the distribution where breaches actually happen.
What drives latency in a Claude system?
Task complexity, model size, and output length. Volume primarily pressures cost at moderate rates, so high daily volume does not automatically threaten a latency SLA.

Watch and learn

Official Anthropic Academy lessons first, then hand-picked walkthroughs. Videos load only when you press play.

No videos curated for this concept yet

We are still curating the best official and community videos for this topic.

Official prep for this domain

Anthropic's own free prep module for this part of the syllabus, on the official prep course. Free with an Anthropic Academy sign-in.

References & primary sources

Adaptive study

Master this concept with Archie

Practice it inside an adaptive study session. Archie, your Socratic AI tutor, tracks your mastery with Bayesian Knowledge Tracing and schedules the perfect next review.

Start studying