
The Answer Is Optional: An Abstention Contract for AI
A practical guide to deciding when AI should answer, seek evidence, defer, or refuse using calibrated signals, risk–coverage curves, and fallback capacity.
Read MoreZharfAI Team

When an AI feature feels slow, “use a faster model” is tempting advice. It is also frequently incomplete. A production request may cross authentication, policy checks, memory, retrieval, prompt assembly, provider routing, an inference queue, model prefill, token decoding, tools, safety checks, rendering, and post-action verification. The model can be the largest segment—or a small one hidden inside a poorly observed chain.
Latency engineering starts by defining what the user is waiting for. A chat user wants an immediate acknowledgement, a useful first chunk, and a readable generation pace. An analyst wants the first trustworthy finding and the completed evidence packet. A payment user wants confirmation that the business action committed exactly once. Those are different service objectives.
Industry benchmarks now separate important model-serving phases. MLCommons describes TTFT and TPOT as the server-scenario measures for recent large-language-model benchmarks; its MLPerf Inference v5 discussion sets benchmark-specific 99th-percentile constraints rather than collapsing performance into one average. OpenTelemetry’s evolving GenAI semantic conventions likewise include time-to-first-token metrics. The lesson is durable: measure the phases separately and at the tail.
At minimum, instrument:
| Metric | Definition | What it tells you |
|---|---|---|
| UI acknowledgement | User action to visible “working” state | Whether the product feels responsive |
| Time to first meaningful result | User action to first useful content, not empty stream bytes | When value begins |
| TTFT | Model request sent to first generated token or chunk | Queue + prefill + provider overhead |
| TPOT | Average time per output token after the first | Decoding pace |
| Inter-token latency | Gap between individual streamed chunks/tokens | Jitter and reading smoothness |
| Model end-to-end | Model request to completed model response | Full provider/model duration |
| Tool latency | Tool call to verified tool result | External dependency cost |
| Workflow latency | User action to all required steps complete | Actual task duration |
| Time to decision | User action to enough verified information for the next decision | Product value, not text completion |
| Time to confirmed side effect | User action to business post-condition verified | Trust for transactions and actions |
Be precise about clocks. “TTFT” measured at the inference server differs from “first meaningful result” measured in the browser. Network buffering can deliver a provider token without painting anything useful. A tool may return HTTP 200 before the application verifies the intended business state.
Google Cloud currently defines TPOT as the generation time after the first token divided across the remaining output tokens. Choose one formula, document edge cases such as one-token outputs, and use it consistently.
Create one trace ID at the user boundary and propagate it through:
Do not attach raw sensitive prompts or responses to every span. Record stable IDs, versions, token counts, cache status, model, route, tool name, result class, and timing. Sample or redact content under a separate access policy.
Trace parallel operations correctly. If three retrieval calls run together, their latencies do not simply add to user wait; the critical path is determined by the slowest required branch plus coordination overhead.
The related agent observability guide covers trace structure for multi-step workflows.
During prefill, the model processes the input context and builds the key-value cache used during generation. Longer prompts usually increase prefill work and memory. Large retrieved documents or a lifetime of conversation can therefore damage TTFT even if the final answer is short.
Autoregressive models generate output sequentially. Decode pace drives TPOT and total generation time. Output length matters: a fast token rate still produces a slow task if the system generates 3,000 unnecessary tokens.
Serving systems batch requests to use accelerators efficiently. Higher batching can improve total throughput while increasing an individual request’s wait or creating tail latency under mixed prompt lengths. Throughput and responsiveness are related but not interchangeable.
In an agent, database, browser, search, code execution, or approval wait may dominate the model. Measure each dependency, retry, and human boundary separately. Never label the entire trace “LLM latency.”
There is no universal good TTFT. Define service-level objectives based on the task:
Use p50 for the typical experience and p90/p95/p99 for the slow path. Segment by region, device, network, tenant, model, prompt length, output length, cache status, concurrency, language, tool, and request class.
Do not copy a benchmark threshold as a product SLO. MLPerf’s constraints make hardware submissions comparable under a defined workload. Your users, prompts, quality target, provider route, and full application chain differ.
Pair every latency SLO with a quality and safety floor. A routing change that meets p95 by choosing a model that hallucinates more is a regression.
A budget assigns an owner and target to each critical segment. For an interactive, retrieval-backed answer, an illustrative—not universal—budget might look like:
| Segment | p95 target | Owner |
|---|---|---|
| UI acknowledgement | 100 ms | Frontend |
| Edge, auth, and admission | 150 ms | Platform |
| Retrieval and rerank | 600 ms | Search |
| Context assembly | 150 ms | AI application |
| Provider queue + prefill to first token | 1,200 ms | Model platform |
| First useful sentence | 600 ms after first token | Model + product |
| Optional tool | 1,500 ms | Integration owner |
| Final validation and paint | 250 ms | AI application + frontend |
The point is not the numbers. It is the accountability. If retrieval spends 1.4 seconds, switching a model from 40 to 50 tokens per second may barely change time to first value.
Maintain separate budgets for warm and cold paths, cached and uncached prompts, tool and no-tool requests, and foreground and background work.
The browser should visibly respond before network work completes. The Core Web Vitals guide to Interaction to Next Paint explains why delayed visual feedback makes an interface appear unresponsive. This is not model latency, but users experience the whole product.
Disable duplicate submission, show the active scope, and provide a cancel or safe background option. A spinner without context is not sufficient for a long agent workflow; show meaningful stages such as “checking sources” or “waiting for approval.”
Eliminate duplicate retrieval, repeated policy loads, redundant model calls, excessive conversation history, and outputs longer than the task requires. The cheapest millisecond is work that should not exist.
Context engineering matters directly. See building trustworthy model context for permission-aware selection and compression.
Run independent retrieval or metadata lookups concurrently, but only when they are truly independent and respect resource limits. Do not parallelize side effects that require order or share a mutable record.
Use deadlines and cancellation. When one optional source exceeds its budget, a workflow may continue with a clearly labeled partial result; a required authoritative source should cause abstention or escalation.
Use a smaller or lower-reasoning model for classification, extraction, or low-risk formatting only after workflow-specific evaluation. Reserve larger models or additional reasoning for tasks where quality improves enough to justify time and cost.
Model routing across cost, latency, and quality provides a decision framework.
Cache immutable policy compilations, schemas, embeddings, retrieval results with freshness rules, and shared prompt prefixes when allowed. Include tenant, permission, locale, policy version, model, and data version in keys. Never trade speed for cross-user leakage or stale authorization.
Measure hit rate, time saved, stale-hit rate, and invalidation delay. A high cache hit rate is not success if the cache serves old policy.
Streaming reduces perceived wait, not total work. Do not stream speculative claims that are likely to be retracted after a tool or safety check. For evidence-heavy work, first stream stable structure or verified findings while clearly marking incomplete sections.
Chunk size affects smoothness. Tiny chunks create overhead and jitter; large chunks delay visible progress. Measure browser paint and readability, not only provider events.
The vLLM/PagedAttention paper addresses wasted key-value-cache memory and reports higher throughput at comparable latency in its tested workloads. Modern serving engines also use continuous batching and scheduling to admit work efficiently.
But a throughput win in one benchmark does not guarantee lower p99 for your mixed workload. Test actual prompt lengths, generation lengths, concurrency, model architecture, and hardware.
Speculative sampling uses a faster draft model to propose tokens that a target model verifies in parallel, preserving the target distribution when implemented correctly. Its benefit depends on draft cost and acceptance. A 2026 production-oriented latency analysis reports that speedups can diminish under load as effective batch size changes.
Benchmark at real arrival rates. An optimization that wins in single-request tests may lose when the server is saturated.
Lower precision can reduce memory and improve speed, but it can also change accuracy, tool-use reliability, multilingual quality, and calibration. Compare outputs to a higher-precision reference on your evaluation set, not only tokens per second.
Reusing prefill state for shared prefixes can reduce repeated work. Keys must include every element that changes semantics or permission. Provider-managed caching also has retention and data-governance implications; verify current terms and controls.
Scale before queues become the dominant latency, but account for model-load and warm-up time. Separate urgent interactive traffic from long background jobs. Under overload, reject or degrade explicitly rather than accepting work into an unbounded queue.
For every tool:
Hedged requests can reduce tail latency for idempotent reads by issuing a second request after a delay, but they increase load and can worsen congestion. Never hedge a non-idempotent payment or message send.
The durable agent workflow guide covers checkpoints and exactly-once business effects.
Build a workload distribution from production or privacy-preserving samples:
Use an open-loop load generator when you need to model independent arrivals; a closed-loop client that waits for each response can hide queue collapse by sending less traffic as the server slows.
For each scenario, capture latency histograms, throughput, queue depth, accelerator utilization, memory, token lengths, error rate, retries, cancellation, quality, and cost. Hold quality constant when comparing serving configurations.
Diagnose before optimizing. A faster decoder does not fix a slow document store.
It is important for interactive generation, but not sufficient. A low TTFT can coexist with slow tokens, tool stalls, poor rendering, or an unverified action. Use the metric closest to user value: first meaningful result, time to decision, or confirmed side effect.
It usually improves perceived responsiveness by showing work earlier. It may leave total latency unchanged and can add overhead. Measure both first meaningful paint and completion.
Yes for important interactive and transactional paths, but investigate the population behind it. Report multiple percentiles and segments; a single extreme tail may mix different request classes that need separate routing or SLOs.
When controlled evaluation shows it meets the same task-specific quality and safety threshold with a meaningful latency or cost benefit. Model size alone is not a routing policy.
This article was substantially reviewed on July 30, 2026 using:
Latency engineering is product design expressed in time: acknowledge immediately, spend delay only where it buys verified quality, and never let a fast animation substitute for a confirmed result.

A practical guide to deciding when AI should answer, seek evidence, defer, or refuse using calibrated signals, risk–coverage curves, and fallback capacity.
Read More
A field guide to admitting, quarantining, or rejecting MCP servers, plugins, and agent tools using provenance, capability tests, and enforceable runtime limits.
Read More
A field guide to baselines, delayed outcomes, change attribution, and deciding when deployed AI should be watched, constrained, rolled back, or rebuilt.
Read MoreIf this note maps to a real system in your organization, start with the services page or a shipped case study.