Technical Analysis of Open-Source LLMs: How Mixture of Experts Architecture Achieves Cost-Effective Inference
This article explores how emerging Chinese open-source large language models (LLMs) leverage the Mixture of Experts (MoE) architecture and extreme engineering optimizations to achieve cost-effective training and inference. It covers the core principles of MoE, engineering challenges, training optimizations, performance benchmarks across various tasks, deployment strategies, and current limitations.
1. Background: The Cost Dilemma of LLMs and Breakthroughs
For a long time, the training and inference costs of large language models have been a major barrier for most enterprises. Traditional dense models require activating all parameters to process every input token. This means that as model capabilities increase and parameter scales grow, the computational overhead for a single inference increases linearly or even super-linearly. For leading models pursuing maximum capabilities, parameters in the hundreds of billions demand astronomical computational investments.
Against this backdrop, a group of Chinese open-source teams has offered a different answer: through architectural innovation and engineering optimization, they drastically compress actual computational consumption during training and inference without sacrificing capabilities. The so-called “king of cost-effectiveness in the AI industry” emerged from this approach—approaching or even matching the comprehensive performance of top-tier models at costs far below industry peers.
2. Core Technology: Mixture of Experts (MoE) Architecture
These models generally adopt the Mixture of Experts architecture, whose core concept can be summarized as “on-demand activation and division of labor.”
2.1 What is MoE
In dense models, the feed-forward network in each layer performs the same computation for all inputs. In the MoE architecture, the feed-forward network is replaced by several parallel “expert networks” and introduces a router mechanism. Whenever a token enters a layer, the router dynamically selects the most suitable one or a few expert networks for computation based on the token’s features, while the rest of the experts remain “dormant.”
Taking a model with a total parameter count of about 671 billion as an example, the actually activated parameters per token are only about 37 billion, with an activation rate of less than 6%. This means:
- Sufficient capability reserve: The model’s overall knowledge capacity is determined by all parameters, and the massive total parameter count ensures a broad coverage of world knowledge.
- Controllable computation costs: The actual computation volume of a single forward propagation depends only on the activated parameters, significantly reducing inference latency and memory bandwidth pressure.
- Improved training efficiency: During training, each sample only needs to activate a subset of experts, equivalently reducing the computational overhead of gradient calculation.
2.2 Engineering Challenges of MoE
MoE is not a “free lunch”; its engineering implementation has several key difficulties:
- Load balancing issue: If the router tends to assign a large number of tokens to a few “popular experts,” it causes uneven loads across computing nodes and a sudden drop in training efficiency. Mainstream approaches include adding auxiliary load balancing loss to the training objective or introducing auxiliary-loss-free balancing strategies.
- Expert capacity and token dropping: The number of tokens each expert can process in each batch has an upper limit; excess parts may be dropped, requiring fine-tuning of the capacity factor.
- Communication overhead: Experts are usually distributed across multiple accelerator cards. Cross-device data transfer can become a bottleneck, which needs to be mitigated through overlapping scheduling of computation and communication.
2.3 Extreme Optimizations at the Training Level
In addition to the architecture itself, these models have also made extensive optimizations in training engineering, which is another major source of their cost advantages:
- Mixed precision training: Adopting low-precision numerical formats like FP8, compressing storage and computation overhead to about half of traditional BF16 while ensuring numerical stability.
- Multi-Token Prediction (MTP): Allowing the model to predict multiple future tokens simultaneously at each position, increasing the density of training signals and improving data utilization efficiency.
- Communication and memory scheduling optimization: Through manual operator-level optimization, dual pipeline parallelism, and other strategies, each card is kept in a fully loaded computing state as much as possible, reducing waiting and idle time.
3. Performance: Reaching Top-Tier Levels in Multiple Benchmarks
Ultimately, architecture and engineering must speak through capabilities. Based on results from multiple public evaluation benchmarks, these models perform prominently in the following areas:
3.1 Comprehensive Knowledge and Reasoning
In knowledge Q&A and reasoning tests covering more than 50 disciplines, these models rank among the top among open-source models, standing in the same tier as internationally recognized top-tier closed-source models, and significantly widening the gap with other open-source models.
3.2 Mathematics and Coding
Math problem-solving and code generation are the “touchstones” of LLM capabilities. On competition-level math problem sets, these models achieved accuracy rates close to top-tier closed-source models through chain-of-thought reasoning. In tasks such as real-world code completion and algorithm problem solving, they also demonstrated engineering-level coding capabilities comparable to top-tier levels. Below is a typical coding task example:
# Task: Implement a concurrency-safe rate limiterimport threadingimport timeclass RateLimiter:def __init__(self, max_requests: int, window_seconds: float):self._max = max_requestsself._window = window_secondsself._lock = threading.Lock()self._timestamps = []def allow(self) -> bool:with self._lock:now = time.monotonic()self._timestamps = [t for t in self._timestampsif now - t < self._window]if len(self._timestamps) < self._max:self._timestamps.append(now)return Truereturn False
The ability to correctly understand concurrency semantics, boundary conditions, and provide such production-level implementations is one of the intuitive ways to measure a model’s coding capabilities.
3.3 Chinese and English Understanding and Translation
Thanks to the proportional design of high-quality Chinese data in the training corpus, these models often have an advantage over some English-centric international models in Chinese contextual understanding, Chinese writing, and Chinese-English translation tasks, which is a significant plus for developers working with Chinese contexts.
4. Open-Source Strategy and Implementation Value
Most of these models are released under permissive open-source licenses, allowing academic research and commercial use, and providing a complete product line from base models to chat models and code models. The significance of this for the industry ecosystem is mainly reflected in:
- Lowering the barrier to use: Developers can freely deploy, fine-tune, and conduct secondary development under compliant conditions.
- Promoting localized deployment: The sparse activation feature of MoE makes it possible to run ultra-large models with limited hardware resources after quantization. Combined with INT8/FP8 quantization technology, inference costs can be further compressed.
- Fostering ecosystem prosperity: The open-source community has derived a large number of quantized versions, inference acceleration frameworks, and application practices around the models, forming a positive cycle.
For enterprises hoping to implement them in their business, common deployment paths include three types:
- API calls: Directly using the model service interface, suitable for rapid validation and small-to-medium scale applications.
- Private deployment: Deploying on own computing power using open-source inference frameworks, suitable for scenarios with high data security requirements.
- Cloud hosting: Through model services and computing infrastructure provided by cloud service providers like Baidu AI Cloud, combined with general cloud products such as container platforms, object storage, and log monitoring, deployment and operations can be completed more effortlessly, balancing elasticity and cost.
5. A Rational View: Advantages and Limitations Coexist
While affirming the achievements, we should also remain technically clear-headed:
- Hallucination issues still exist: Ultra-large models still produce incorrect outputs on factual issues; critical business processes must design manual verification steps.
- Room for improvement in long-context and multimodal capabilities: Compared with some international top-tier models, there is still room for improvement in directions such as ultra-long document understanding and multimodal fusion.
- Hardware ecosystem adaptation: The collaborative optimization of these models and Chinese computing hardware is maturing rapidly, but engineering maturity still needs continuous polishing.
Conclusion
This batch of Chinese open-source LLMs, represented by the Mixture of Experts architecture, has proven through architectural innovation and extreme engineering optimization that “high performance” and “low cost” are not mutually exclusive. For developers, these are both technical samples worth in-depth study and practically usable infrastructure options. It is recommended to gradually verify their actual performance in tasks such as knowledge Q&A, code assistance, and content generation through small-scale pilots based on specific business scenarios, before deciding on the path for large-scale implementation.
