Latency
Latency is the time an AI request takes to produce a response. Distinguish time to first token (TTFT), when output begins, from time to last token (TTLT), when generation completes.[1]
What does Latency mean in simple terms?
After you send a question, there is a wait before text starts appearing, and another interval while the answer is generated. TTFT measures the first wait; TTLT measures the total time until completion. Streaming can show output as it arrives and improve the experience of waiting, but does not mean all computation finishes sooner.[1]
How can Latency be explained with an analogy?
It is the time between sending a quotation request and receiving the first reply.
Where is Latency used?
Chat interface
Measure when a request is sent, when the first token appears, and when generation ends. Compare TTFT and TTLT separately instead of treating them as one number.[1]
Input and output length
Test representative prompts and response lengths. Model choice, prompt size, generated token count, and service load can affect latency, so compare like-for-like workloads.[1]
Streaming
Enable streaming when the interface can display incremental output. Evaluate when users see useful text as well as when the full response completes.[1]
Batch work
For bulk jobs, measure completion time and throughput alongside individual-request latency. The best operating configuration depends on the workload and service requirements.
Learning steps, limitations and developments
- Record request start, first-token, and completion times.
- Monitor TTFT and TTLT separately, using a distribution rather than one average.
- Compare the same workload before and after changing a model, prompt, output limit, or streaming configuration.
- Define targets appropriate to chat, voice, or batch work using measurements from your own workflow. Include tool time when measuring an end-to-end agent.
- Recheck under representative load before deciding whether a configuration meets your requirements.
Latency depends on multiple factors. Microsoft’s official guidance discusses model selection, token counts, workload and service characteristics, and streaming.[1] A fast first token and fast total completion are different goals. Avoid comparing timings from different models or workloads as though they were controlled measurements.
Which concepts are related to Latency?
- Similar conceptThroughputA concept that often appears alongside it within the same basics category.
- Similar conceptSWE-benchA concept that often appears alongside it within the same basics category.
- Similar conceptBenchmarkA concept that often appears alongside it within the same basics category.
Which sources explain Latency?
- Azure OpenAI in Microsoft Foundry Models performance and latency — Official documentation · Microsoft Learn — https://learn.microsoft.com/en-us/azure/foundry/openai/how-to/latency
Tell us what you think
Your feedback helps us improve the content.