The Evolution of Open-Source Large Models: From Scaling Laws to Mixture-of-Experts Architectures
This article examines two major forces shaping open-source large language models: scaling laws, which guide the allocation of model size, data, and compute, and mixture-of-experts architectures, which expand model capacity while keeping per-token inference costs manageable. It also covers data quality, fine-grained experts, shared experts, engineering challenges, and practical guidance for training, fine-tuning, and deployment.
The Evolution of Open-Source Large Models: From Scaling Laws to Mixture-of-Experts Architectures
1. Introduction: Why Open-Source Large Models Deserve a Closer Look
Over the past few years, open-source large language models (LLMs) have evolved rapidly. The field has moved from general-purpose foundation models toward more efficient architectures that balance capability with inference cost. Understanding this evolution helps developers and organizations make better decisions about when to build or fine-tune a model, how to evaluate model size and data ratios, and why mixture-of-experts (MoE) architectures have become a popular way to reduce inference costs.
This article focuses on two major themes:
- Scaling laws: how to choose the right balance between model size and training data under a limited compute budget;
- Mixture-of-experts architectures: how to increase the total number of model parameters without proportionally increasing the computation required for each token.
2. Scaling Laws: A First-Principles Framework for Model Training
2.1 What Scaling Laws Mean
Scaling laws describe the relationship between model performance and three key variables: the number of model parameters, the amount of training data, and the available compute. When data quality and the training recipe remain stable, increasing these variables together typically reduces model loss in a predictable way.
This means that large-model training is not simply a matter of adding more GPUs and hoping for better results. Teams can run smaller experiments, fit scaling curves, and extrapolate the expected performance of a much larger model. This approach can significantly reduce the cost of trial and error.
2.2 An Often-Overlooked Prerequisite: Data Quality
An early assumption in the community was that more data and more parameters were always better. In practice, scaling laws depend on high-quality data. If a dataset contains large amounts of low-quality, duplicated, or noisy content, simply increasing its size leads to diminishing returns and may even reduce model performance.
A more practical training process is:
Data cleaning and deduplication↓Small-scale ratio experiments with different model sizes and data volumes↓Fit scaling curves and determine an appropriate ratio↓Start large-scale training
2.3 Compute Allocation: Scale the Model or Add More Data?
Under a fixed compute budget, teams face a fundamental trade-off: should they train a larger model on less data, or a smaller model on more data?
Experience from leading open-source models suggests that, once data quality is under control, it is generally preferable to scale the model rather than increase the data volume indefinitely. The main reasons are:
- High-quality training data is naturally limited. Beyond a certain point, the marginal value of additional data declines rapidly;
- Larger models generally provide stronger knowledge compression and generalization, allowing compute to produce more durable capability gains;
- More data can still be added in later stages, while the capability ceiling of the foundation model is largely established during pretraining.
This approach is sometimes associated with a long-term strategy: instead of optimizing only for short-term benchmark results, teams build a stronger foundation for later fine-tuning, alignment, and inference optimization.
2.4 Practical Implications
For engineering teams, the main lessons include:
- Run small experiments first: use models in the 1B–7B range to compare hyperparameters, model sizes, and data ratios before committing to large-scale training;
- Prioritize data engineering: deduplication, quality filtering, and data-mixture adjustments can often deliver greater benefits than simply switching to a larger model;
- Plan the compute budget carefully: use scaling curves to estimate the compute required to reach the target loss and avoid running out of resources midway through training.
3. MoE: Combining Large-Model Capability with Smaller-Model Costs
3.1 The Structure and Limitations of Traditional MoE
The central idea behind MoE is to replace the feed-forward network (FFN) in a Transformer with multiple “expert” networks. Each token activates only a subset of those experts. As a result, the model can have a large total parameter count while keeping the computation and memory access required for each token relatively low.
A typical traditional MoE design includes:
- A small number of large experts, such as eight, with each expert having a parameter count comparable to the original FFN;
- A router that calculates routing scores for each token and selects the Top-K experts, such as Top-2, for computation.
This design has a key limitation: there are relatively few experts, and each expert is large. A large expert may learn several different types of knowledge at the same time, which can lead to:
- Knowledge redundancy: multiple experts learn similar general patterns;
- Limited specialization: experts have difficulty focusing on a specific domain or capability;
- Uneven load distribution: routing may concentrate too many tokens on a few popular experts, creating load-balancing problems.
3.2 Fine-Grained Expert Splitting for Greater Specialization
One improvement is to split each large expert into multiple smaller experts while increasing the number of experts activated by each token, meaning that the value of Top-K is increased.
This approach provides several benefits:
- Smaller experts are more likely to converge toward specific patterns during training, improving expert specialization;
- Because more experts are activated, the total number of active parameters per token can remain comparable to the original design, preserving expressive capacity;
- The routing space changes from selecting a few experts from a small pool of large experts to selecting a group from a much larger pool of smaller experts. This significantly improves routing flexibility and representational capacity.
The structure can be illustrated with the following pseudocode:
class MoELayer(nn.Module):def __init__(self, d_model, num_experts, top_k):# num_experts is relatively large, such as 64, 128, or 256# Each expert is a small FFNself.experts = nn.ModuleList([SmallFFN(d_model) for _ in range(num_experts)])self.router = TopKRouter(d_model, num_experts, top_k)self.shared_expert = SmallFFN(d_model) # Always active for every tokendef forward(self, x):shared = self.shared_expert(x)weights, idx = self.router(x) # Select top_k experts and weightsexpert_out = sparse_dispatch(x, self.experts, weights, idx)return shared + expert_out
3.3 Shared Experts: Separating Common Knowledge
Fine-grained experts can still waste parameters by repeatedly learning common knowledge, such as basic grammar and general facts. A shared expert helps address this issue:
- The shared expert is always activated for every token and focuses on common knowledge;
- Fine-grained experts can concentrate on their specialized domains instead of repeatedly learning general patterns;
- Overall parameter redundancy is reduced, allowing the available active parameters to provide more useful capacity.
The combination of shared experts and fine-grained routing has become a basic pattern in modern efficient MoE architectures.
3.4 Engineering Challenges in Training and Deployment
The benefits of MoE come with additional engineering requirements. Key challenges include:
- Load balancing: auxiliary losses or auxiliary-loss-free balancing strategies are needed to prevent routing from collapsing onto a small number of experts;
- Parallelism: expert parallelism is commonly used to distribute different experts across devices, but this introduces all-to-all communication overhead;
- Memory management: the total parameter count can be very large, so techniques such as ZeRO and sharded optimizers may be required to reduce memory pressure on individual devices;
- Inference batching: sparse activation is not always friendly to batching, so efficient inference frameworks are needed to optimize throughput;
- Routing stability: routing can fluctuate significantly during the early stages of training. Techniques such as router temperature adjustment and z-loss can help stabilize training.
4. Where the Two Themes Meet: A Complete Picture of Efficient Large Models
Scaling laws answer the question, “How large should the model be, and how much data should be used?” MoE answers a different question: “How can a larger model be supported within a limited compute budget?”
Together, they form a major technical path for modern open-source large models:
- Use high-quality data and an appropriate model scale to train a capable foundation model;
- Use a fine-grained MoE architecture to keep inference costs within an acceptable range;
- Apply conversational fine-tuning and alignment to produce a practical, product-ready model.
In practice, these models can often approach the performance of much larger dense models while maintaining inference costs closer to those of smaller dense models. This balance is the main source of their cost-effectiveness.
5. Practical Recommendations for Developers
- Focus on active parameter count during model selection: the total parameter count and active parameter count of an MoE model can differ substantially. Inference cost should be evaluated primarily based on the active parameter count;
- Account for MoE characteristics during fine-tuning: when fine-tuning an MoE model, understand the division of responsibilities between the router and the experts, and avoid disrupting existing expert specialization;
- Prioritize data quality over data volume: in both pretraining and fine-tuning, investment in cleaning and deduplication often provides the highest return;
- Run small-scale experiments first: validating data ratios and hyperparameters with a smaller model before full-scale training is essential for controlling costs;
- Combine deployment with general cloud capabilities: container platforms, GPU resource scheduling, logging, monitoring, and alerting can significantly reduce the operational burden of large-scale training and inference services.
6. Conclusion
The evolution of open-source large models is fundamentally driven by two advances: scaling methodology and architectural efficiency.
Scaling laws provide a predictable framework for training, but they depend on high-quality data and support prioritizing model scale when allocating compute. MoE architectures, through fine-grained expert splitting and shared experts, help resolve the tension between a large total parameter count and low inference cost.
Understanding these two themes helps developers make better decisions about model selection and deployment. It also provides a solid methodology for planning data strategies, choosing architectures, and estimating costs when building models in-house.
