Where Did the Compute Go? Understanding the Compute Crunch Behind Chinese LLMs
This article explains why a perceived compute shortage is showing up at the same time as falling API prices and long-context features. It breaks down where compute is actually consumed—non-linear context costs, the different resource profiles of prefill and decode, the multiplicative effect of long-horizon tasks and coding agents, and physical supply constraints—then outlines practical responses such as context budgeting, prefix and semantic caching, batch processing, model tiering, and cost observability, along with elastic architecture patterns and a capacity planning checklist.
1. The Symptom: Why Compute Feels Tight Even as Prices Drop and Contexts Grow
Over the past two years, a seemingly contradictory pattern has kept recurring. On one side, the price of model inference APIs keeps falling. On the other, individual developers on monthly subscription plans widely report that their quotas “don’t last.” At the same time, general-purpose capabilities—support for million-token context windows and strong performance on code generation and long-horizon tasks—are pushing up the resource cost of each individual request.
Put these three observations together and they don’t conflict at all. They are three sides of the same issue: the growth rate of compute supply has temporarily fallen behind the growth rate of how models are being called. Falling prices reflect a declining marginal cost per token, while the worsening quota experience reflects rising total consumption. Both can be true at once.
2. Root Causes: Where the Compute Actually Goes
2.1 Non-linear Pressure from Context Length
In standard autoregressive inference, the cost of attention computation and the key-value cache (KV Cache) rises quickly as sequence length grows. When the context expands from a few thousand tokens to hundreds of thousands or even millions, memory footprint and memory-bandwidth pressure increase sharply. More importantly, the share of genuinely useful information in a long context is often very low—a large part of the budget goes to repeatedly pasted specifications, historical logs, and redundant retrieval snippets.
2.2 Prefill and Decode Have Different Resource Profiles
A request typically splits into two phases: prefill and decode. Prefill is compute-intensive and can saturate the hardware’s compute capacity. Decode is memory-bandwidth-intensive: it produces only one token per step yet must repeatedly read weights and cache. So “compute” is not a single metric. Prefill queuing and decode throughput require different scaling strategies, and treating them as one pooled capacity figure will inevitably lead to misjudgment.
2.3 The Amplification Effect of Long-Horizon Tasks and Coding Agents
Coding agents and long-horizon task execution turn a single “question” into dozens of model calls: read files, modify code, run tests, inspect errors, and fix them. The cost of any single request is low, but the number of calls multiplies while the context keeps accumulating—a classic multiplicative consumption pattern.
2.4 Physical Constraints on the Supply Side
Compute expansion is limited by the delivery pace of high-end accelerator cards, the power and cooling capacity of data centers, and the efficiency of cluster networking and parallelism strategies. As cluster size grows, communication overhead and failure rates rise alongside it, so effective compute does not scale linearly. This explains why “the total keeps growing, yet things feel tighter.”
3. Practical Mitigations
3.1 Context Budget Governance
Treat context as a finite budget to manage, not an unlimited paste target.
# Example: assemble context by priority with a hard capdef build_context(system, retrieved, history, budget=32000):parts, used = [], 0for seg in [system] + retrieved + history:cost = estimate_tokens(seg) # estimated by the tokenizerif used + cost > budget:breakparts.append(seg); used += costreturn "\n".join(parts), used
Supporting practices include reranking retrieval snippets before truncation, applying rolling summaries to conversation history, and placing stable, unchanging specifications first to improve cache hits.
3.2 Prefix Caching and Result Caching
For stable prefixes such as system prompts, tool descriptions, and codebase summaries, prefer calling methods that support prefix reuse; this can significantly cut repeated prefill overhead. For highly deterministic subtasks (such as document summarization or format conversion), add a semantic cache layer that returns immediately on a hit.
3.3 Batching and Asynchronization
Send offline workloads (batch code review, log classification, data cleaning) through asynchronous batch queues, trading latency for throughput. For online interactive paths, strictly control output length and the number of call rounds. In engineering terms, use a message queue to decouple components and smooth out peaks and valleys.
3.4 Tiering Large and Small Models
Use smaller models or rule-based methods for intent recognition, field extraction, and initial filtering; hand off only the parts that genuinely need complex reasoning to the large model. This routing layer often yields a several-fold increase in effective capacity.
3.5 Observability and Cost Attribution
You have to see consumption clearly before you can optimize it. Log input/output tokens, cache hit rate, per-phase latency, and a business identifier for every call, then build cost attribution dashboards by team and by feature, with monitoring alerts and budget thresholds.
request_id | feature | in_tokens | out_tokens | cache_hit | prefill_ms | decode_ms
4. Elastic Design at the Architecture Level
The recommended approach is to put inference capability behind a unified gateway that handles routing, rate limiting, degradation, and multi-backend adaptation: prioritize latency for online interactions and place deferrable tasks in a low-priority queue; apply rate limiting during peaks rather than letting requests queue into an avalanche; and provide rule-based fallbacks or a smaller-model degradation path for non-critical flows. On the storage side, use object storage for long documents and artifacts so large blocks of content aren’t repeatedly stuffed into the context; use a container platform to host the stateless inference front layer so it can scale elastically with load.
5. Selection and Capacity Planning Checklist
- Clearly separate online and offline workloads, and set latency and throughput targets for each.
- Measure the real token distribution (P50/P95) instead of planning against theoretical maximums.
- Evaluate cache hit rates and prefix reuse capability as inputs to capacity estimation.
- Define hard budgets and over-limit policies for long-context scenarios.
- Establish cost metrics per unit of business volume (such as cost per thousand requests) and track them continuously.
6. Conclusion
The essence of the compute crunch is that the pace of change in calling paradigms has outrun the pace of supply and engineering optimization. In the short term, context governance, cache reuse, and batching recover capacity that was being wasted. In the medium term, tiering large and small models and a unified gateway make resource scheduling more precise. In the long term, it depends on improvements in cluster efficiency and energy conditions. For developers, the reliable way through this phase is to treat the “compute budget” as a first-class design constraint, on par with memory and latency.
