# Latency

- **Canonical URL:** https://getaimath.com/dictionary/latency/
- **Topics:** [LLM Inference: Prefill & Decode](https://getaimath.com/dictionary/category/llm-inference-prefill-and-decode/), [AI Infrastructure & Runtime](https://getaimath.com/dictionary/category/ai-infrastructure-and-runtime/), [AI Evaluation & Performance Metrics](https://getaimath.com/dictionary/category/ai-evaluation-and-performance-metrics/)
- **Also called:** Inference Latency
- **Last updated:** 2026-11-25

## What is Latency?

**In one sentence:** Latency is the delay between asking for something and getting a response.

In AI, latency includes network time, waiting in queues, prefill and generation. Low latency makes apps feel fast and responsive.

![How an AI Replies: 1. Read Your Question → 2. Type the Answer — Simple two-step cartoon: Step 1 (Prefill) shows the AI scanning your entire question in one flash (causing the brief pause before it starts talking); Step 2 (Decode) shows it typing out the reply one word at a time.](https://getaimath.com/diagrams/llm-inference-prefill-and-decode.png)
*Napkin Diagram (LLM Inference: Prefill & Decode): Every AI reply has two halves: gulping down your whole prompt at once, then speaking the answer one word at a time.*

### Quick Math / Rule of Thumb

Total Response Time = TTFT + (TPOT × Output Tokens). For a 200-token answer at 400 ms TTFT and 20 ms TPOT: 0.4 s + 4.0 s = 4.4 s total.

## What is an example of Latency?

If a voice assistant takes 2 seconds to start answering, its latency is 2 seconds.

## Why does Latency matter?

Latency is one of the most noticeable parts of AI quality for users.

## Latency vs. Throughput

Latency measures how fast one single user gets their answer (seconds), while throughput measures how many total tokens per second a server delivers across all concurrent users.

| Dimension | Latency | [Throughput](https://getaimath.com/dictionary/throughput/) |
| --- | --- | --- |
| Unit | Milliseconds or seconds per request | Total tokens/sec or requests/sec across server |
| Effect of bigger batches | Usually makes each user wait a bit longer | Greatly increases total GPU throughput |
| Who cares most | Individual user waiting on a reply | Infrastructure team paying the GPU bill |

## Related Concepts

- [Throughput](https://getaimath.com/dictionary/throughput/): Throughput is the total amount of work a system completes over time, like the number of tokens or requests per second across all users.
- [Memory Bandwidth](https://getaimath.com/dictionary/memory-bandwidth/): Memory bandwidth is how fast data can move between a chip's memory and its processors, usually measured in gigabytes per second.
- [Quantization Backend](https://getaimath.com/dictionary/quantization-backend/): A quantization backend is the software that implements a particular quantization format and runs quantized models.
- [Win Rate](https://getaimath.com/dictionary/win-rate/): Win rate is the percentage of comparisons a model wins against another model or a baseline.
- [Sampling](https://getaimath.com/dictionary/sampling/): Sampling is how a model picks the next token from its list of possible options, using their probabilities.
- [Compute-Bound](https://getaimath.com/dictionary/compute-bound/): A task is compute-bound when its speed is limited by how fast the chip can do math.

---
Source: The AI Math Dictionary (https://getaimath.com/dictionary/latency/)
