←News detail

Alibaba Cloud Developer Community AIUpdated Oct 27 01:25

What actually happens during a single AI inference: from fixed parameters to the trade-off between latency and throughput

AI summary

The article explains that training is learning parameters, while inference is using parameters without changing them; a single inference run only performs forward propagation and does not require loss, gradients, or weight updates. The article breaks down the autoregressive generation of large language models, distinguishing the Prefill and Decode phases: the former is compute-intensive and determines time to first token, while the latter is limited by memory bandwidth and determines the inter-token interval. The article also provides an example of estimating KV cache usage, and discusses the benefit boundary of batching for improving throughput, the unbounded growth of waiting time as utilization approaches 100%, and how chat scenarios prioritize reducing TTFT while Agent scenarios focus on end-to-end latency.

Why read this

AI score 62

The original article breaks down the difference between training and inference at the levels of forward propagation, KV cache, and batching, helping readers understand the sources of online latency and cost.

Topics

Tags

Body

Only a summary is authorized here. Continue at the validated source link.

Source

Alibaba Cloud Developer Community AI