LLM Inference Scaling and New Architecture Deployment: A Practical Guide
This article explains how to scale large language model inference when demand spikes after a release. It covers bottleneck classification, capacity planning formulas, a phased rollout path for new network architectures, and the engineering capabilities needed to keep elasticity sustainable. Developers can apply the same approach to self-hosted inference services to achieve steadier latency and more predictable costs.
1. Background: Peak Traffic on Day One, Inference Becomes the Bottleneck
A domestic LLM team hit a classic “peak on launch” scenario after a model version release: global traffic exceeded the existing capacity plan within days, requests began queuing, and both time to first token and overall response time rose together. Interactive coding scenarios became noticeably laggy. The team expanded its domestic chip cluster in batches, limited the number of coding packages sold, and publicly recruited compute partners, but supply-side additions never kept pace with the demand curve.
This was not a one-off operations incident. It was an inherent contradiction in LLM service architecture, amplified: training can be queued offline, while inference must respond in real time; training has a relatively stable resource profile, while inference fluctuates sharply with input length, output length, and concurrency structure. The correct scaling order is therefore to fix the architecture first, then add hardware.
2. Bottleneck Identification: First Determine Which Kind of “Not Enough” It Is
Attribution is required before scaling; otherwise a software problem gets treated as a hardware problem. Common bottlenecks fall into four categories:
- Memory capacity bottleneck: weights, KV Cache, and activations together exceed the usable memory of a single card, pushing batch size down to a very low level.
- Compute bottleneck: matrix multiplication units are fully utilized, and adding concurrency only raises latency linearly.
- Bandwidth bottleneck: frequent communication within tensor-parallel groups makes inter-card interconnect bandwidth the ceiling.
- Scheduling bottleneck: request queuing, uneven load, and long-tail requests blocking an entire batch; GPU utilization looks low but latency is poor.
The diagnostic method is not complicated. Establish percentile metrics rather than averages:
Key observations:TTFT P50 / P95 # Time to first tokenTPOT P50 / P95 # Interval between output tokensThroughput tokens/s / GPUQueue wait time, queue depthMemory KV Cache occupancy, fragmentation rate
If GPU utilization is high and P95 latency deteriorates at the same time, it is a compute bottleneck. If utilization is low but latency is high, it is almost certainly a scheduling or bandwidth problem.
3. Capacity Planning: Convert Concurrency into Memory and Throughput
The core formula for inference capacity estimation can be simplified as:
Concurrency per card ≈ (usable memory - weight usage - activation reserve) / KV Cache size per requestKV Cache per request ≈ 2 × layers × KV heads × head dimension × (input length + output length) × bytes per precisionCards needed ≈ peak concurrency / concurrency per card × redundancy factor
In engineering practice, a redundancy factor of 20%–30% is recommended to absorb traffic bursts and capacity fluctuations during rolling releases. Also replace “average concurrency” with two variables: “peak concurrency” and “long-context share,” because long-context requests consume KV Cache linearly or even faster, and a small number of long requests can drag down an entire batch.
4. Architecture Upgrade: Why New Network Architectures Can Relieve Pressure
A recent industry approach is to replace traditional dense structures with new network connectivity and computation organization. It has been deployed at scale in the production cluster of a domestic team. Its value lies mainly in three areas:
- Lower memory usage per request. Through sparser activation paths and more compact cache organization, the same memory can hold higher concurrency.
- Better interconnect efficiency. Aligning communication patterns with topology reduces cross-node synchronization and relieves the bandwidth bottleneck.
- Improved in-batch uniformity. After sparsification, long and short requests mix more easily into batches, reducing long-tail blocking.
Do not switch everything at once during rollout. A progressive path is recommended:
Phase 1: Shadow traffic replay, compare output consistency and latency distributionPhase 2: 5% canary, handling only short-context interactive requestsPhase 3: Route by context-length buckets, send long requests to a dedicated resource poolPhase 4: Full rollout while keeping the old path as a rollback channel
5. Engineering Support: Making Elasticity Actually Work
Beyond architecture, the following capabilities determine whether scaling is sustainable:
- Elastic scaling: use queue depth and P95 latency as scale-up/scale-down signals, not just CPU/GPU utilization.
- Tiered rate limiting: set concurrency quotas by package or tenant to protect critical paths and avoid an overall avalanche.
- Cache reuse: reuse prefix caches for system prompts and long-document prefixes, which can significantly cut repeated computation.
- Batching strategy: continuous batching combined with length bucketing balances throughput and latency.
- Observability: connect logging services with monitoring and alerting, aligning metrics, traces, and logs to the same request ID.
In the cloud, container platforms typically host elastic replicas, object storage holds model and cache artifacts, and message queues buffer requests and shave peaks, with monitoring and alerting closing the loop. The general capability categories Baidu AI Cloud provides for such scenarios follow the same combination: containerized inference replicas, storage and messaging services to buffer peaks, and monitoring and alerting to drive auto-scaling.
6. Conclusion
The right response to a demand surge is not simply adding hardware, but a four-step loop of “attribution, planning, architecture, and support”: first use percentile metrics to identify the bottleneck type, then use memory and throughput formulas for capacity conversion, then roll out the new network architecture gradually, and finally lock in the gains with elastic scaling, tiered rate limiting, and an observability system. For developers, this method also applies to self-hosted inference services, yielding steadier latency and a more controllable cost curve under limited resources.
