Compute vs. Memory: The Real Bottleneck for On-Device LLMs

LLM inference, especially the token generation (decode) phase, is often memory-bound rather than compute-bound; performance is limited by memory bandwidth – how quickly model parameters and KV cache data can be moved.

The top 3

  1. Top 3 Memory Bottlenecks for On-Device LLMs: The primary memory constraints for on-device LLM inference are the exponential growth of the Key-Value (KV) cache with longer context windows, the large memory capacity required for model weights (e.g., 7B parameter models need at least 14GB at 16-bit precision), and fundamental memory bandwidth limitations on hardware [3, 5, 6, 8, 15].
  2. Leading Techniques to Mitigate LLM Memory Bottlenecks: Key strategies include quantization (reducing VRAM by 50-74.2% with 4-bit or 8-bit precision), KV cache optimization via methods like PagedAttention and FlashAttention-3 to minimize fragmentation, and distributed strategies such as ZeRO-3 or Tensor Parallelism for sharding models across multiple GPUs [1, 3, 10, 12].
  3. Key Memory Technologies for On-Device LLM Performance: High-Bandwidth Memory (HBM), like HBM3 found in GPUs, delivers up to 5.3 TB/s bandwidth, 10-12 times faster than typical DDR5, crucial for LLM inference. Emerging Compute-in-Memory (CIM) architectures also promise to reduce data movement by performing computations directly within memory [6, 7, 11, 14].

Sources

Open the full topic