Topic 4
Comparing providers and public benchmarks
With a model API you can't fix the hardware, the batch or the precision: the provider chooses them, and other customers' traffic may share the machine. So a published latency figure describes their workload on their day, not yours.
AI Engineering gives three reasons to measure for yourself:
- Latency depends on your requests. It depends on the prompt and the sampling settings, not only on the model (Ch. 4, "Evaluation Criteria" > "Cost and Latency"). The book's example criteria table measures TTFT at p90 on an internal user prompt dataset, not on a public benchmark.
- Providers can change the model's behaviour. The same Llama models scored differently on benchmarks when served by different inference providers, in an experiment by Cerebras (2024). The book's explanation: a provider might use optimizations that alter a model's behaviour (Ch. 9, "Inference Optimization", Figure 9-8). Check quality alongside speed.
- Providers limit you. Some throttle a service that sends too many concurrent requests (Ch. 9, "Throughput and goodput"), so a test at low concurrency can mislead about peak load. Token counts also differ by tokenizer, so compare cost per request.
The book doesn't discuss public latency leaderboards. The best-known public benchmark, MLPerf Inference, shows how strict a fair comparison is. Its rules fix the model, the dataset and accuracy targets, and define scenarios. In the Server scenario, requests arrive "according to a Poisson distribution" for at least 600 seconds, and the result is the "Maximum Poisson throughput parameter supported" within per-benchmark limits: for Llama2-70b's interactive category, TTFT 450 ms and TPOT 40 ms (MLPerf Inference Rules, "Scenarios" and "Benchmarks"; rules change between rounds).
Spot the unfair comparison
Exercise · our measurements and labelled illustrative numbers
1. “Our server does 2,133 tokens/s; theirs does 159. Ours is 13× faster.” Both numbers are this lesson's Apple GPU decode: batch 64 and batch 1.
2. “Provider A streams 120 tokens/s, provider B 100 tokens/s, so A answers faster and costs less per answer.” (Illustrative numbers.)
3. “We ran the benchmark once on each laptop. Ours: 219.6 ms. Yours: 239.4 ms. Your laptop is 9% slower.” Both numbers are the same CPU and the same prompt: two of our runs, each a median of 7.
4. “Mean TTFT: 300 ms for us, 320 ms for them, from 10 requests each.” (Illustrative numbers.)
5. “We started the server and timed the very first request to compare against theirs, which had been running for an hour.” (Illustrative.)
0 of 5 answered correctly.
Quick check