Efficient Large Language Models: Approaching Frontier Performance with Less Compute
This article examines techniques for reducing LLM training and inference costs under constrained compute budgets while keeping model quality within an acceptable range. It covers MoE architecture design, long-context KV cache compression, low-precision training, parallelism and communication overlap, inference optimizations such as speculative decoding and continuous batching, and post-training methods including reinforcement learning with verifiable rewards and distillation. It also compares trade-offs, provides a selection checklist, and highlights common pitfalls. Reported multipliers, ratios, and throughput gains are context-dependent; readers should verify experimental conditions in the original papers or reproducible benchmarks.
I. Scope of This Article
This article focuses on a general problem: when the compute budget is limited, how can technical methods reduce training and inference costs while keeping model quality within an acceptable range? It does not analyze any specific company or product, nor does it provide benefit numbers that can be applied directly.
The multipliers, ratios, and throughput gains mentioned in this article are typical representations of various techniques under specific conditions. Actual results depend on hardware model, model scale, sequence length, batch size, and evaluation task. Before citing any number, return to the original paper or a reproducible benchmark to verify the experimental conditions.
II. Where Efficiency Problems Come From
A dense model activates all parameters during each forward pass. As the model grows larger, the compute and memory bandwidth consumed per generated token increase. Training cost occurs once, while inference cost accumulates continuously with user requests. Therefore, efficiency optimization usually falls into two lines: one reduces total training compute, and the other reduces the unit cost of inference.
Another often-overlooked issue is where the bottleneck is located. Compute-bound, memory-bandwidth-bound, and communication-bound are three different problems, and the corresponding optimization methods differ. Before making changes, use profiling tools to confirm where the bottleneck is; this avoids spending time on ineffective optimizations.
III. Architecture Layer: How Does MoE Reduce Per-Step Compute?
Mixture of Experts (MoE) splits the feed-forward layer into multiple expert subnetworks. Each token is routed to only a few of these experts. The total number of model parameters can be large, but only a small portion of parameters actually participates in computation at each step.
In practical deployment, common designs include the following three points:
- Fine-grained experts: Experts are split into smaller and more numerous units, making routing combinations more flexible and each expert’s responsibility more focused.
- Shared experts alongside routed experts: Shared experts handle general knowledge, while routed experts handle more specialized capabilities, reducing duplicate storage across experts.
- Load balancing: If routing is overly concentrated on a few experts, devices will wait on each other. Common approaches include auxiliary loss functions, bias-based dynamic adjustment, and capacity limits per expert.
The risks of MoE are also clear. All expert parameters still need to be stored in GPU memory or system memory, so the deployment threshold does not decrease just because fewer parameters are activated. Routing also introduces additional cross-device communication. During training, if load is imbalanced, both model quality and convergence speed may be affected.
IV. Attention Layer: How Can Long-Context Memory Be Reduced?
In long-context scenarios, the size of the KV cache grows with sequence length and often becomes the main source of memory usage. Common methods for this problem fall into three categories:
- Low-rank KV cache compression: Project keys and values into a lower-dimensional space for storage and restore them when used. Designs such as Multi-head Latent Attention (MLA) fall into this category. The higher the compression ratio, the greater the quality risk is usually.
- Sliding-window and sparse attention: Keep only local windows and some key positions for attention, reducing computational complexity from quadratic to near-linear. The cost is that long-range dependencies may be weakened, and this needs dedicated validation on long-document retrieval and multi-hop reasoning tasks.
- Quantized KV cache: Store cache values at lower precision to save memory. Precision loss may accumulate over long sequences and should be checked with long-context evaluation sets.
V. Training Layer: What Should Be Noted in Low-Precision Training?
Mixed-precision training is already standard practice. Using even lower precision such as FP8 can improve matrix multiplication throughput, provided that the hardware itself supports the corresponding tensor core instructions.
In practice, stable training usually relies on the following measures:
- Fine-grained scaling: Calculate scaling factors per small tile or block rather than applying a single scale to the entire tensor, reducing the probability of numerical overflow.
- Keep sensitive parts in high precision: Normalization layers, gradient accumulation, and master weights continue to use BF16 or FP32.
- Low-precision communication: Data transmitted across devices can also use lower precision to reduce bandwidth usage, but gradient error must be checked for acceptability.
Note that theoretical speedup in matrix multiplication does not equal end-to-end training speedup. Communication, memory-bound operators, and data loading all dilute the actual benefit. Before launch, compare loss curves at the same number of steps and downstream evaluation results to confirm that quality has not dropped noticeably.
VI. Parallelism and Communication: How Can Device Idle Time Be Reduced?
In large-scale training, device idle time usually comes from three places: pipeline bubbles, communication waits, and recomputation overhead.
- Pipeline scheduling: Reduce idle time in the pipeline by interleaving forward and backward microbatches. Bidirectional scheduling schemes such as DualPipe follow this idea. The more complex the schedule, the higher the implementation and debugging cost.
- Communication and computation overlap: MoE All-to-All communication can execute in parallel with computation, provided that the topology and communication library support it. If network bandwidth is insufficient, the benefit of overlap will drop noticeably.
- Activation recomputation: Do not store non-critical intermediate activations; recompute them during backpropagation. This trades memory for larger batch sizes or longer sequences but increases compute. Whether it is worthwhile depends on whether memory or compute is the bottleneck.
VII. Inference Layer: How Can Per-Service Cost Be Reduced?
Inference cost usually continues to grow with user scale, making it the part that requires the most attention in long-term operations. Common optimization methods include the following:
- Speculative decoding: A smaller draft model first generates multiple candidate tokens, which are then verified in parallel by the large model. With standard acceptance and rejection sampling, the output distribution matches that of direct generation by the large model. The speedup depends on the agreement between the draft model and the large model, that is, the acceptance rate. When the acceptance rate is low, extra overhead may offset the benefit.
- Continuous batching: Requests do not need to wait for an entire batch to finish before entering or leaving a batch, reducing GPU idle time. It is especially effective for services with uneven request length distributions.
- KV cache paging management: Borrowing the paging idea from operating systems to reduce memory fragmentation and increase the number of concurrent requests a single machine can handle.
- Inference quantization: Quantize weights or activations to INT8 or FP8 to reduce memory usage and memory access pressure. Output quality should be compared on the target business evaluation set before and after quantization.
Inference-side benefits depend heavily on business workload. Input and output lengths, concurrency patterns, and response latency requirements all affect final results. It is recommended to first stress-test on sampled data from real traffic, and then decide on the launch plan.
VIII. Post-Training: How Should Reinforcement Learning and Distillation Be Used?
In the post-training stage, two types of methods deserve attention:
- Reinforcement learning with verifiable rewards: Tasks such as whether code passes unit tests or whether math answers can be automatically checked can provide objective reward signals. Compared with relying entirely on human preference annotation, this has lower labeling cost. However, if the reward function is poorly designed, the model may learn to game it, for example by writing code only for test cases rather than solving the real problem.
- Distillation: Use a large model to generate reasoning data and train a small model to imitate its outputs. Data quality determines distillation effectiveness, so incorrect samples and duplicate samples need to be filtered. In addition, when using the outputs of a model to train other models, confirm whether the model’s license terms allow this. Distillation data may also overlap with evaluation sets, inflating benchmark scores; deduplication checks are needed.
Test-time compute is another approach. A model can use a longer chain of thought before answering, improving performance on complex tasks, but the latency and cost of each answer increase. Whether to adopt it should depend on the task’s requirements for accuracy and latency.
IX. Comparison of Approaches
| Optimization | Main problem solved | Suitable scenario | Main risk |
|---|---|---|---|
| MoE | Large per-step compute | Training with large parameter scale and limited budget | High memory footprint; routing communication and load imbalance |
| Low-rank KV compression | Long-context memory usage | Long-text inference | Over-compression can lose attention expressiveness |
| Sliding-window attention | Attention compute grows with length | Very long document processing | Long-range dependencies may be weakened |
| FP8 training | Insufficient matrix multiplication throughput | Training clusters with FP8-capable hardware | Numerical instability; end-to-end speedup below theoretical value |
| Activation recomputation | Insufficient memory | When memory is the main bottleneck | Adds compute and slows training |
| Speculative decoding | Slow per-user generation | Draft and target model distributions are close | Limited gain when acceptance rate is low |
| Continuous batching | Low GPU utilization | Online services with highly varied request lengths | Complex scheduling implementation |
| Inference quantization | High memory and memory access pressure | Workloads with higher tolerance for accuracy loss | Quality degradation on specific tasks |
| RL with verifiable rewards | High manual labeling cost | Code, math, and other auto-gradable tasks | Reward hacking |
| Distillation | Weak small-model capability | Scenarios requiring lightweight deployment | Data quality and license compliance issues |
X. Selection Checklist
Before deciding to introduce a technique, check in the following order:
- Use profiling tools to confirm whether the bottleneck is compute, memory bandwidth, memory capacity, or communication.
- Define the quality baseline and prepare an evaluation set covering the target business, including long-tail scenarios.
- Confirm whether the hardware and software stack support the required precision and operators.
- Assess whether the team can maintain the chosen approach, especially the parts related to scheduling, quantization, and distributed communication.
- Introduce it in stages, changing only one item at a time, and run before-and-after comparison experiments.
- After launch, continuously monitor changes in loss curves, latency, throughput, error rate, and output quality.
XI. Common Pitfalls
- Treating theoretical peak as actual benefit: Peak throughput often appears only under ideal conditions, and end-to-end improvement is usually smaller.
- Looking at only a single metric: If quality or stability declines while cost is reduced, the overall benefit may be negative.
- Not running long-tail evaluations after quantization or compression: Average metrics showing no obvious change does not mean that a small set of request types has not been affected.
- Ignoring communication overhead: In MoE and large-scale parallel training, the network often becomes the bottleneck earlier than compute.
- Ignoring data and licensing risks: The source, license, and evaluation contamination issues of distillation and synthetic data need to be considered from the start of the project.
XII. Conclusion
There is no single optimal solution for efficiency optimization. Every technique is a trade-off among compute, memory, communication, quality, and engineering complexity. A more reliable approach is to first identify the bottleneck, then choose a matching solution, and validate the results with real business data.
