정의
LLM Serving Latency and Cost Model은 대규모 언어 모델(LLM)을 실시간으로 서빙할 때 발생하는 지연(latency) 와 비용(cost) 을 예측하고 최적화하기 위한 수학적·하드웨어적 프레임워크이다.
모델 파라미터, KV‑Cache 크기, 배치 크기, 메모리 대역폭, 컴퓨팅 FLOPs, 가격 티어 등 다양한 변수를 통합해 t_compute 와 t_mem 를 계산하고, 이 두 값의 최대값이 실제 지연을 결정한다는 점을 강조한다.
핵심 속성
- t_compute:
batch × active_parameters / FLOPs_per_second
배치 크기와 활성화된 파라미터 수를 기반으로 컴퓨팅 시간 추정. - t_mem:
total_parameters / memory_bandwidth + KV_cache_time
모델 전체 파라미터와 KV‑Cache 로딩을 고려한 메모리 시간. - Bound:
latency = max(t_compute, t_mem)
두 값 중 큰 쪽이 실제 지연을 제한한다. - Cost per Token:
price_input × input_tokens + price_output × output_tokens
서비스 제공업체가 설정한 가격 티어를 반영. - Optimal Batch:
B_opt ≈ FLOPs_per_second / (memory_bandwidth × sparsity)
메모리와 컴퓨팅이 균형을 이룰 때의 배치 크기.
관계
- vllm-sglang-optimization — {연장}
vLLM과 SGLang이 KV‑Cache와 배치 채우기를 최적화하는 방법. - llm-inference-hardware — {연장}
NVIDIA HBM, NVLink, NVSwitch 등 하드웨어가 지연과 비용에 미치는 영향. - token-pricing-model — {연장}
DeepSeek, Gemini, Anthropic 등 서비스별 가격 티어 구조.
인용
“t_compute와 t_mem 중 더 큰 값이 실제 지연을 결정한다.
메모리 대역폭이 300배 빠르지만, KV‑Cache가 길어지면 결국 메모리‑바운드가 된다.”
— 2026‑06‑05 Ep96