Engineering brief

LLM inference is a memory problem, not a compute problem

AI Engineer1 min read · saves 87 min

At a glance

Relevance
Practical value
Warnings
None

LLM inference cost is recurring, not one-off. The KV cache is the real bottleneck: memory grows with context and users.

Inference cost determines AI product viability; getting it right is a competitive advantage.

Summary

LLM inference cost is a recurring operating expense that scales with usage, unlike training's one-time cost. The core bottleneck is the KV cache—memory grows linearly with context length and concurrently with users, creating a tradeoff between quality, latency, and throughput.

Prefill is compute-bound; decode is memory-bound. Understanding these phases drives optimisation decisions. Model-level techniques like quantization (int8/int4) and grouped-query attention reduce memory footprint, often at negligible quality loss in practice. Flash attention and multi-head latent attention further compress compute.

On the serving side, KV cache management via page attention, continuous batching, and prefix caching dramatically improves throughput. Benchmarks show VLM and SGLang perform similarly for standard workloads, but SGLang can be 3-4× faster for agentic tasks with repeated prompts.

Speculative decoding is overhyped—presenters found it ineffective. The real signal is that architecture decisions (attention mechanism, serving engine) matter more than squeezing last bit of FLOPs. Teams should fix one constraint (latency or throughput) and model the capacity tradeoff systematically.

Watch the video

This video is blocked due to your privacy settings. To watch this video, please accept YouTube marketing cookies.

Related breakdowns

Get TL;DW

Too Long; Didn't Watch.

A concise breakdowns of the AI and devtools videos that actually matter for engineering leaders.

Free. Weekly. No hype.

Video and thumbnails remain the property of their respective creators. tldw.news provides editorial analysis, commentary, and discovery links to original content.