LLM Inference Optimization: How Pruning and Speculative Decoding Cut GPU Costs
As open-weight LLMs reach trillion-parameter scale, MoE architectures reduce active compute per token but still drive up GPU memory and infrastructure requirements. This article examines a practical case in which expert pruning removed up to 37% of MoE experts with minimal loss on reasoning and long-context benchmarks, and the freed GPU memory was reused to run a small draft model for speculative decoding. The combined approach cut GPU hardware costs by about 20% and cloud GPU rental costs by about 22%. It also lays out a full cost-reduction framework across model, inference, and service layers, plus actionable steps for teams looking to lower per-token inference cost.
1. Background: Parameter Scale vs. Inference Cost
As open-weight model parameters continue to grow, top-tier open-weight models have reached trillion-parameter scale. Most of these models use mixture-of-experts (MoE) architectures: the total parameter count is enormous, but each inference step only activates a subset of the expert modules. The larger the model, the more GPU memory its weights consume and the more—and higher-spec—GPUs are required.
For a trillion-parameter MoE model, even with low-precision quantization, the weights must be spread across several high-end accelerators. This creates three cost pressures:
- High hardware purchase cost: multi-GPU high-end systems can cost millions of yuan.
- High cloud rental cost: 8-GPU high-end instances carry significant hourly and monthly charges.
- Low resource utilization under variable load: capacity configured for peak demand is idle during troughs.
A recent case from a Korean AI inference optimization company is useful in this context. By optimizing inference for a 2.8-trillion-parameter model, the company reduced GPU hardware cost by about 20% and cloud GPU rental cost by about 22% while maintaining core capabilities. The technical logic behind that result is worth unpacking.
2. Path 1: Pruning MoE Expert Modules
2.1 Principle
Not all experts in an MoE model are equally important. Some experts are activated frequently across many tasks, while others are rarely used. The core idea is to analyze task distribution and expert activation statistics, then selectively remove the experts that are rarely activated or contribute little to the target scenarios. This shrinks the model without obvious performance loss.
2.2 Practical Results
In the referenced case, pruning removed up to 37% of the expert modules. The gains were multidimensional:
- Lower memory footprint: fewer modules means smaller weight memory, allowing the model to run on lower-spec, cheaper GPUs.
- Preserved benchmark performance: on the high-level scientific reasoning benchmark GPQA Diamond, the pruned model still scored above 99% of the original model, indicating that the removed experts made limited contribution to core reasoning ability.
- Preserved long-context capability: a version with 30% of experts removed supports 512K-token context, while a version with 37% removed still processes 1M-token context.
2.3 Engineering Considerations
The actual pruning process needs to cover several key steps:
Pruning pipeline:1. Collect calibration data -> cover the input distribution of real business scenarios2. Measure expert activation frequency -> record routing weights of each expert across tasks3. Define pruning strategy -> sort by importance score and decide retention ratio4. Prune and compensate with distillation -> restore accuracy with a small amount of training5. Regression evaluation -> verify no capability loss on benchmarks and business evaluation sets
The most common pitfall is calibration data representativeness. If pruning is calibrated only on general corpus, experts used for code, medical, legal, or other vertical domains may be removed incorrectly, causing a sudden performance drop in those scenarios. The calibration set must be aligned with the actual business distribution.
3. Path 2: Reusing Memory Headroom for a Draft Model
3.1 Speculative Decoding Mechanism
The memory saved by pruning is not left idle. Instead, it is used to load a smaller draft model that cooperates with the main model through speculative decoding:
- The draft model quickly proposes several future tokens based on the current context.
- The main model verifies the draft tokens in a single forward pass, accepting correct tokens and rejecting incorrect ones.
- Generation continues after the accepted tokens become part of the context.
Because the main model can validate multiple tokens at once, and the draft model generates very quickly, overall throughput improves significantly. The key requirement is that the draft model’s output distribution should be close to the main model’s distribution: the higher the acceptance rate, the greater the speedup.
3.2 Reusing Memory Savings
The elegant part of this design is that pruning is not about sacrificing capability to shrink the deployment; it is about converting saved resources into inference speed. In this configuration, the optimized model can generate faster on 8 B200-class GPUs, while an equivalent-scale deployment might require more or higher-end accelerators.
This approach applies broadly to LLM deployment teams: memory budget optimization should not simply aim to “use less.” The real goal is to find the best configuration across cost, throughput, and capability.
4. From Model Optimization to Service Optimization: A Complete Cost-Reduction Framework
The company’s CEO described the optimization direction as expanding from model lightweighting to inference execution and service optimization. This outlines a complete cost-reduction chain:
| Layer | Optimization Levers | Benefit |
|---|---|---|
| Model layer | Pruning, quantization, distillation | Reduce memory footprint and hardware-tier requirements |
| Inference layer | Speculative decoding, continuous batching, KV cache management | Increase throughput and reduce per-token cost |
| Service layer | Elastic scaling, request routing, mixed multi-model deployment | Improve resource utilization |
4.1 Additional Inference-Layer Techniques
Beyond speculative decoding, common industry practices include:
- Continuous batching: dynamically insert new requests into already running batches, avoiding the need to wait for an entire batch to finish.
- KV cache compression: reduce memory overhead in long-context scenarios through cache reuse and compression.
- Quantized deployment: apply low-bit quantization to both weights and activations to further compress memory.
4.2 Service-Layer Policies
In cloud environments, container platforms can scale elastically based on load. Monitoring and alerting systems track GPU utilization, and during low-traffic periods the deployment can automatically scale down or switch to cheaper instance types. Latency-insensitive offline tasks, such as batch summarization and data annotation, can be scheduled into idle periods to amortize unit costs.
5. The Broader Value of This Methodology
From compressing a deployment from eight high-end GPUs to four, and then lowering the GPU tier for subsequent models, this optimization path reveals an important trend: LLM competition is shifting from training capability to inference efficiency. As model capabilities become increasingly similar, per-token inference cost becomes a key factor in enterprise model selection.
Actionable recommendations for developers and enterprise users:
- Measure first, then optimize: establish a complete performance baseline and identify whether the bottleneck is memory, compute, or scheduling.
- Prioritize model compression: evaluate pruning and quantization early; they usually offer the best cost-effectiveness.
- Use speculative decoding: when memory allows, a draft model is almost a free acceleration mechanism.
- Make cloud resources elastic: use container platforms and automated scaling to avoid paying for peak capacity all the time.
- Build a regression evaluation system: before any compression method goes live, verify that core business evaluation sets show no capability loss.
Inference cost optimization is not a single-point technique; it is a system engineering effort spanning the model, the inference engine, and the service architecture. Teams that master this chain can maximize the value of LLMs within a limited AI infrastructure budget.
