Time to First Token
Delay between sending a request and the appearance of the first token in the response. This is what the user perceives as the model 'thinking'.
Why It Is a Separate Metric
Response generation consists of two phases:
- Prefill — the model reads the entire input prompt and calculates KV-cache;
- Decode — step-by-step token generation.
TTFT is primarily the first phase. The longer the input and the larger the model, the longer the prefill phase.
Factors Affecting TTFT
- length of the input context;
- size of the model and its quantization;
- server load and request queue.
Relation to Other Metrics
Together with token generation speed, TTFT forms the overall inference latency. For dialogue systems, TTFT is critical: users do not like waiting for the first response.