Where Did the Compute Go? The Compute Pain Period of Chinese Large Language Models
This article examines why a Chinese large language model's availability faltered despite surging demand, breaking down where inference compute is actually consumed: prefill, decode, KV Cache, and wasted or duplicate usage. It then shows how to build a compute ledger with attributable metrics, and outlines four practical mitigations—prefix and semantic caching, continuous batching with chunked prefill, request routing with priority queues, and elastic scaling based on queue wait time and memory watermarks—plus architecture-level recommendations.
1. The Symptom: A Steep Call-Volume Curve, and Service Lights Up Red First
Public data from an aggregator that tracks API call statistics shows that a lightweight version of a Chinese large language model experienced an extreme surge in demand within half a year. Weekly call volume was about 7.22 trillion tokens from late July to early August, and about 33.6 trillion tokens in a single week in mid-to-late October—roughly 801% growth quarter over quarter. By mid-November, a single week reached about 59.2 trillion tokens, ranking first globally. In less than three months, demand grew more than eightfold.
A steep demand curve is not itself a problem. The problem is that inference capacity was built around relatively stable expectations. So the first thing to break was not model quality but availability: longer queues, more timeouts, triggered rate limits, and jittery time-to-first-token. This is a typical “compute pain period”—not an absolute shortage of total compute, but a mismatch between the structure of supply and the structure of demand.
2. Where the Compute Actually Goes: Four Real Destinations
2.1 Prefill: Compute Eaten by Input Length
Inference has two phases: prefill and decode. Prefill processes all input tokens at once; its compute is roughly proportional to input length and is matrix-multiplication intensive, consuming peak compute. For scenarios like long-document summarization or whole-repository code understanding, a single request can carry tens of thousands of input tokens, and one call can cost as much compute as hundreds of short question-and-answer exchanges.
2.2 Decode: Compute Eaten by Memory Bandwidth
The decode phase generates one token at a time but must read all model weights and the KV Cache each time, so the bottleneck shifts from compute to memory bandwidth and capacity. GPU compute utilization is often very low here: the card is “busy,” but effective compute output is low. This explains why adding cards and seeing the bill rise did not produce a proportional increase in throughput.
2.3 KV Cache: Memory Amplified Quadratically by Context Length
Every request maintains its own KV Cache, whose footprint is determined jointly by the number of layers, number of attention heads, context length, and concurrency. Once long context is combined with high concurrency, memory runs out before compute does, and the service can only reduce concurrency or truncate context early. Users perceive this as the model “getting dumber” or being “rate limited.”
2.4 Ineffective and Duplicate Consumption: The Wasted Part
Repeatedly passing system prompts, repeatedly preprocessing the same document, failed requests and timeout retries, streaming outputs abandoned midway, and poorly set sampling parameters that produce overly long outputs all create pure loss. In engineering practice, this portion often accounts for a considerable share of total consumption, yet it rarely appears in capacity reports.
3. Build a Compute Ledger First: No Measurement, No Optimization
Before optimizing, tokens must be broken down into attributable metrics. It is recommended to collect at least the following dimensions:
Request dimension: input tokens / output tokens / time-to-first-token / total duration / retry countResource dimension: number of cards / peak memory usage / KV Cache hit rate / average sequence length within a batchBusiness dimension: scenario tag / tenant / cache hit or not / abandonment rate
Core derived metrics can be simplified as:
Compute cost per token = total card-hours / total effective output tokensEffective output rate = effective output tokens / (input tokens + output tokens)Cache hit rate = cache-hit requests / total requests
When the effective output rate keeps falling while total card-hours rise, the problem lies in duplicate consumption and missing caches, not in the model itself.
4. Four Practical Mitigations
4.1 Prefix Caching and Semantic Caching
Fix and reuse stable prefixes such as system prompts, tool definitions, and long documents, along with their KV Cache, to significantly reduce repeated prefill. For high-frequency similar questions, introduce a semantic cache to return results directly. Illustrative logic:
def handle(req):prefix_key = hash(req.system_prompt + req.tool_schema)cache = kv_cache.get(prefix_key) # reuse the KV of stable prefixesif (hit := semantic_cache.lookup(req.question)):return hit # zero inference cost on a hitout = llm.generate(req, prefix_cache=cache)semantic_cache.store(req.question, out, ttl=3600)return out
4.2 Continuous Batching and Chunked Prefill
Use continuous batching so new requests can be inserted at any time, avoiding waiting for a whole batch. Split the prefill of long inputs into chunks and schedule them mixed with decode requests to smooth peak compute and prevent long requests from blocking an entire batch.
4.3 Splitting Long and Short Requests with Priority Queues
Pool requests by input length and business tier: short Q&A goes to a low-latency pool, long documents to a throughput pool, and offline batch jobs to a nighttime elastic pool. Combined with timeout and abandonment detection, release memory occupied by abandoned requests promptly.
4.4 Elastic Scaling and Capacity Watermarks
Use “queue wait time + memory watermark” as the scaling signal, which is closer to the real inference bottleneck than CPU utilization alone. Also reserve burst quota to avoid scaling lagging behind traffic spikes.
5. Architecture-Side Recommendations
Decouple the inference layer from the business layer, and use a unified gateway for authentication, rate limiting, metering, and routing. Object storage carries long documents and result archiving, a message queue smooths peaks and fills valleys, a container platform hosts elastic replicas, and logging services with monitoring and alerting close the metrics loop. In this kind of architecture, Baidu AI Cloud is typically used to provide elastic compute and supporting general-purpose data and monitoring capabilities; refer to the official documentation for specific specifications and pricing.
6. Conclusion
Compute has not disappeared; it is quietly consumed by long inputs, the KV Cache, duplicate calls, and inefficient scheduling. The right response to a pain period is not to blindly pile up cards, but to build a ledger first, then eliminate waste, and then adjust the structure—so that the output of every card is measurable, attributable, and optimizable.
