Why LLM Inference Costs Can Drop to One-Quarter
This article explains why long-term LLM inference price reductions are an engineering outcome rather than a subsidy. It covers the repeated computation in autoregressive generation, how KV Cache turns it into a single computation, how to estimate KV Cache memory usage, why a high cache hit rate drives costs down, and the engineering practices that improve reuse and throughput.
1. Behind the Phenomenon: Falling Inference Costs Are Not Magic
There has been recent industry discussion about LLM inference services being priced long-term at one-quarter of their original cost. Many developers’ first reaction is “subsidy” or “clearing inventory.” But from an engineering perspective, when a price can stay low over the long run, it usually means the resource consumption per request has been substantially reduced. Understanding this requires going back to the most fundamental and critical LLM inference optimization: KV Cache, and the cache reuse system built around it.
This article does not evaluate any specific vendor or product. Instead, it abstracts the phenomenon into a general technical question: in autoregressive generation tasks, how can caching and GPU memory management push the marginal cost of each request low enough?
2. The Repeated Computation Problem in Autoregressive Generation
Text generation is an autoregressive process: the model produces one token at a time, appends it to the end of the sequence, and then generates the next one. For example:
Step 1: input [Today's weather] -> predict "is"Step 2: input [Today's weather is] -> predict "nice"Step 3: input [Today's weather is nice] -> predict ...
In the attention mechanism, every token produces three vectors: Q (query), K (key), and V (value). The problem is that although Step 2 adds only one new token, the K and V of the preceding tokens are exactly the same as in Step 1, yet they are computed again. The longer the sequence, the more obvious the waste, and the greater the pressure from the quadratic growth of computational complexity with length.
3. KV Cache: Turning Repeated Computation into a Single Computation
The core idea of KV Cache is simple: every time a new token is generated, write its K and V into GPU memory; subsequent steps read the historical cache directly, compute Q, K, and V only for the latest token, score the new Q against all cached K, and then weight the cached V.
# Pseudocode: single-step decoding with KV Cachepast_kv = load_cache() # read historical K/Vq, k, v = model.forward_new_token(x) # compute only the new tokenk_all = concat(past_kv.k, k) # concatenatev_all = concat(past_kv.v, v)attn = softmax(q @ k_all.T / sqrt(d)) # new Q queries all Kout = attn @ v_all # weight all Vsave_cache(k_all, v_all) # write back to cache
This step reduces “processing the entire sequence” to “processing one token,” and it is the foundation of higher inference throughput and lower cost.
4. How Much GPU Memory Does KV Cache Actually Use
The cache is not free; it consumes GPU memory, and it can be estimated precisely:
KV Cache = 2 × num_layers × num_heads × head_dim × sequence_length × bytes_per_value
With 32 layers, 32 heads, 128 dimensions per head, a sequence length of 4096, and FP16 (2 bytes):
Per token per layer: 2 × 32 × 128 × 2 = 16384 bytes = 16 KBTotal cache: 16 KB × 32 layers × 4096 tokens ≈ 2 GBWith batch=10: about 20 GB
As this shows, in long-text, large-batch scenarios, KV Cache can even exceed the model parameters themselves and become the GPU memory bottleneck. This also explains why the cache hit rate and GPU memory management directly determine cost.
5. Why a High Cache Hit Rate Means Substantial Cost Reduction
When multiple requests share the same prefix (such as a common system prompt, a fixed template, or a repeated document), a cache hit means the K and V of that prefix do not need to be recomputed and can be reused directly. The closer the hit rate is to 100%, the closer repeated computation gets to zero, and the compute consumption per request naturally drops substantially. This is why the savings only become apparent “after a few days of use”: the discount is not one-time, but is continuously realized through reuse on every request.
6. How to Improve Reuse and Throughput in Practice
- Prefix reuse: place stable system prompts and templates at the front and keep them fixed to maximize the shared prefix length.
- Tiered caching and eviction: when GPU memory is insufficient, use tiered storage for cold data, together with a reasonable eviction policy.
- Batching and scheduling: use continuous batching to increase concurrency and amortize fixed overhead.
- Precision and quantization: use lower precision to reduce cache bytes while keeping quality acceptable.
- Observability: use monitoring, alerting, and logging services to track hit rate, GPU memory, and latency, and keep tuning.
When deploying on the cloud, you can combine a container platform to host inference services, object storage to hold long documents, and a message queue to smooth out traffic spikes, forming a stable and reproducible cost-reduction approach.
7. Conclusion
An inference price dropping to one-quarter is essentially the result of eliminating the repeated computation in KV Cache and maximizing GPU memory and scheduling efficiency. For developers, the truly reusable lesson is this: understand the caching mechanism, quantify GPU memory usage, and design systems around the hit rate. Only then does cost optimization have a sustainable engineering foundation.
