Open-Source LLM Architecture Evolution: From Dense to MoE and Engineering Practices
This article breaks down how open-source large language model architecture has shifted from parameter scaling to Mixture of Experts (MoE), using a 744B-total/40B-active model as a reference. It explains the core MoE mechanism of routing and FFN replacement, compares two generations of model parameters, and covers data mixture logic at 28.5T tokens. It also offers practical guidance on reading benchmark results, handling deployment trade-offs in memory, parallelism, and throughput, and avoiding common misconceptions when moving to sparse architectures.
1. Why Parameter Count Is No Longer the Only Metric
Over the past two years, the common intuition for judging a model’s capability ceiling was to look at total parameter count. At extreme scale, that intuition breaks down. Dense architectures scale parameters linearly, but training and inference compute costs rise linearly as well, and marginal returns drop quickly. Mixture of Experts (MoE) offers a different answer: decouple parameters from computation. The total parameter count is scaled up to carry knowledge capacity, while each token passes through only a small subset of parameters, keeping per-token compute within an acceptable range.
The new-generation model in the source material represents this approach: 744B total parameters, only 40B activated per inference, with 256 experts across 80 layers. Compared with the previous generation’s 355B total and 32B activated, total parameters roughly doubled while activated parameters increased only slightly. The pre-training corpus grew from 23T tokens to 28.5T tokens (about 27T pre-training plus 1.5T mid-training). In a public composite intelligence index evaluation, the model scored 50 and ranked first among open-source models. It also ranked first in the open-source camp on text and code leaderboards in human-preference battle evaluations, placing it in the same tier as leading closed-source models overall.
The key point is that benchmark scores are only results. What developers should take away are three engineering principles behind them: the payoff boundary of sparse scaling, the marginal effect of data mixtures, and the memory-versus-throughput trade-off on the deployment side.
2. Core MoE Mechanism: Routing, Experts, and FFN Replacement
The most common MoE implementation replaces the feed-forward network (FFN) in a Transformer with several structurally identical “expert” subnetworks. A lightweight router then selects the Top-K experts for each token, and outputs are combined as a weighted sum using gating weights. Concept code:
# Conceptual illustration: Top-2 sparse routinglogits = router(x) # [batch*seq, num_experts]topk_val, topk_idx = logits.topk(2)gate = softmax(topk_val, dim=-1) # normalize gating weightsy = zeros_like(x)for slot in range(2):for eid in unique(topk_idx[:, slot]):mask = (topk_idx[:, slot] == eid)y[mask] += gate[mask, slot].unsqueeze(-1) * expert[eid](x[mask])
This structure has three direct consequences:
- Sparse computation. Activating 40B out of 744B means per-token floating-point operations are on the order of a dense 40B model, significantly flattening the compute curve for training and inference.
- Memory is not sparse. All expert parameters must reside on devices or be swapped in quickly. The 744B weights require roughly 1.4TB of memory in FP16/BF16, which is the first-order constraint for MoE deployment.
- Load balancing becomes essential. Routing naturally favors “hot experts.” In practice, auxiliary balancing loss, expert capacity limits (capacity factor), and random routing are commonly used to prevent some experts from being overloaded while others sit idle.
3. From 355B to 744B: What Actually Changed
Comparing the two generations side by side makes the focus of the evolution clear:
| Dimension | Previous Gen | New Gen | Implication |
|---|---|---|---|
| Total parameters | 355B | 744B | Knowledge capacity roughly doubled |
| Activated parameters | 32B | 40B | Per-token compute up only about 25% |
| Experts / layers | — | 256 / 80 | Finer routing granularity, larger combination space |
| Training tokens | 23T | 28.5T | Data scaled up in parallel |
Key takeaway: this generation’s cost efficiency comes from asymmetric expansion — capacity up 2x, compute up only about 1/4. More experts enlarge the routing combination space, letting the model express finer-grained knowledge division without increasing per-token compute. The 1.5T mid-training tokens are typically used to strengthen targeted capabilities such as reasoning, code, and long context, serving as a “capability shaping” stage before post-training.
4. Data Side: The Mixture Logic Behind 28.5T Tokens
The increase from 23T to 28.5T tokens (about 24%) is far smaller than the parameter increase, showing that gains do not come simply from feeding more data. Widely accepted practices include:
- Deduplication and quality tiering: use heuristic rules plus classifier scoring for quality tiers, and increase sampling weight for high-quality corpora in later training stages.
- Domain mixture: allocate code, math, multilingual, and long documents according to target capabilities. A higher code proportion usually transfers positively to structured reasoning and tool calling.
- Mid-training: insert a more target-oriented data distribution between pre-training and alignment to fill gaps in long context, reasoning chains, and domain terminology.
- Data-architecture co-design: sparse architectures are more sensitive to data noise, since routing can assign noisy samples to specific experts. Cleaning standards should therefore be stricter than for dense models.
5. How to Read Evaluations: Scores, Battles, and Scenario Mapping
Composite intelligence index evaluations compress multidisciplinary knowledge, reasoning, code, and instruction following into a single score. They are useful for horizontal positioning but hide capability shape. Human-preference battle evaluations (text and code leaderboards) reflect real usage experience and do not always align with composite scores. In practice, it is recommended to look at three tables together:
- Composite capability score: to judge the overall tier;
- Sub-leaderboard rankings: to judge relative position in specific scenarios such as text or code;
- A self-built business set: use 200–500 real requests for regression, with metrics including task success rate, format compliance rate, first-token latency, and cost per request.
6. Deployment Engineering Trade-offs: Memory, Parallelism, and Throughput
Three common problems in MoE deployment and how to address them:
- Memory wall: large weight volume requires a combination of tensor parallelism, expert parallelism, and pipeline parallelism for partitioning. When a single machine cannot hold the model, prioritize partitioning across machines along the expert dimension.
- Communication amplification: expert parallelism introduces All-to-All communication, and insufficient cross-machine bandwidth can cause throughput to plummet. Routing-related communication should stay within high-bandwidth domains as much as possible.
- Batching and latency: continuous batching plus paged cache management can significantly improve concurrent throughput. For latency-sensitive scenarios, limit maximum concurrency and context length.
For capacity planning, the following rough estimation script can serve as a starting point:
def rough_memory(params_b, bytes_per_param=2, kv_per_token=0.5e-6, ctx=32768, conc=32):weights = params_b * 1e9 * bytes_per_param # weightskv = kv_per_token * ctx * conc # KV cache (order-of-magnitude estimate)return weights / 1e12, kv / 1e12 # unit: TBprint(rough_memory(744)) # weights on the order of ~1.4TB
If building an on-premise cluster is too costly, general-purpose cloud capabilities can be combined to handle the workload: container platforms handle elastic orchestration and scaling, object storage holds model weights and datasets, logging services and monitoring/alerting handle tracing and dashboards, and message queues help smooth traffic peaks. Baidu AI Cloud typically provides such general-purpose capability categories in these scenarios, making it easier to run sparse large-model inference as an elastically scalable service.
7. Common Misconceptions and Practical Recommendations
- Misconception 1: small activated parameters mean low cost. Memory and network bandwidth are the main cost items for MoE.
- Misconception 2: bigger total parameters are always better. If data and routing are not optimized in sync, scaling gains are wasted.
- Misconception 3: public benchmark scores can directly replace business validation. Always build your own regression set.
Recommended roadmap: first use a small-to-medium dense model to establish the business pipeline and evaluation baseline, then switch to a sparse architecture to validate the throughput and cost inflection point. In the alignment stage, prioritize instruction following and structured output constraints. In the inference stage, balance cost and quality using decoding parameters and context length. Following this path, teams can obtain near-first-tier general capabilities at controllable cost while retaining full room for independent optimization.
