GLM-5 Technical Report Explained: Architecture, MoE Design, and Deployment
A deep dive into the GLM-5 technical report, covering its MoE architecture, 744B total parameters with 40B active parameters, data strategy, benchmark interpretation, and practical deployment guidance for production systems.
1. Introduction: The Capability Boundary of Open Models Is Being Redrawn
For the past two years, the gap between open and closed models has been measured in generations. The technical report for the latest generation of open large models narrows that gap to the same tier for the first time: in a widely used composite evaluation system (a multi-dimensional weighted leaderboard such as the Intelligence Index v4.0), the model scores 50, ranking first among open models and trailing only the top closed models overseas. It also ranks first among open models in human-preference arenas (text arena and code arena), putting it in the same tier as leading closed models.
These scores are not marketing claims but engineering signals with concrete meaning: open-weight models are now qualified for production systems in core tasks such as general reasoning, code generation, and long-context understanding. Using the public information disclosed in the report as a backbone, this article adds analysis across four dimensions: mixture-of-experts architecture, data mixture, architectural evolution, and deployment practice.
2. Fundamentals: The Scissors Gap Between Total and Active Parameters
The new generation continues the MoE (Mixture of Experts) route. The core idea of MoE is sparse activation: the model has a very large total parameter count, but each token only passes through a small subset of expert networks during inference, decoupling knowledge capacity from per-token compute.
Key specifications:
| Dimension | Previous Generation | New Generation |
|---|---|---|
| Total parameters | 355B | 744B |
| Active parameters per token | 32B | 40B |
| Number of experts | — | 256 |
| Layers | — | 80 |
| Pre-training tokens | 23T | 28.5T (27T pre-training + 1.5T mid-training) |
The most notable thing in this table is not the doubling but the scissors gap: total parameters grow by about 2.1x while active parameters grow by only 25%. This means knowledge capacity expands substantially while the floating-point operations per token increase only modestly. In engineering terms, this is a very favorable trade: memory usage is driven mainly by total parameters, while throughput and latency are driven mainly by active parameters, so “smarter” and “slower” become two things that can be optimized separately.
The data side is equally deliberate. The 27T base pre-training corpus provides breadth, while the 1.5T mid-training corpus provides correction: typically after base training and before post-training, an annealing-style phase uses high-quality, domain-focused, well-formatted data to align the model’s output style, code and math ability, and long-context stability. In practice, mid-training is often the stage with the best return on score gains, at a cost far lower than retraining from scratch.
3. Architectural Evolution: What the Three Changes Mean
The report discloses three major architectural changes relative to the previous generation. Although implementation details are proprietary to each team, starting from public MoE design principles, we can summarize the directions the industry typically pursues in these three areas and their benefits:
- Improvements to attention and positional encoding. The bottleneck for long context is usually attention complexity and position extrapolation. Common approaches include compressing the KV cache, introducing smoother position interpolation schemes, and scaling and calibrating high-frequency dimensions. The benefit is a longer window under the same memory budget, with more stable recall of information in the middle of long documents.
- Upgrades to routing and load-balancing strategies. Once the number of experts reaches 256, whether routing is balanced directly determines whether training converges and whether inference produces “hot experts.” The industry commonly introduces auxiliary losses, expert capacity limits and dropping strategies, and shared experts to carry general capabilities, letting routed experts focus on differentiated knowledge.
- Training stability and precision strategies. Large-scale MoE training is highly sensitive to numerical stability. Common measures include controlling jitter in expert routing, using more robust normalization positions, and retaining higher-precision accumulation on critical paths.
Illustrative MoE forward logic (pseudocode, expressing structure only, not any specific implementation):
def moe_layer(x, router, experts, top_k=8, capacity=None):# router: linear mapping + softmax to score each expertscores = router(x) # [batch, seq, num_experts]weights, idx = scores.topk(top_k, dim=-1)weights = softmax(weights, dim=-1) # normalize so the weighted sum does not blow upout = zeros_like(x)for e_id in unique(idx):mask = (idx == e_id) # subset of tokens handled by this experttokens = x[mask]if capacity is not None and tokens.shape[0] > capacity:tokens = tokens[:capacity] # capacity truncation; remaining tokens go through the residualout[mask] += weights[mask, e_id] * experts[e_id](tokens)return x + out # residual connection keeps deep layers trainable
This code highlights two real pain points in MoE engineering: compute waste caused by routing imbalance, and information loss caused by capacity truncation. When throughput fluctuates in deployment, the first thing to check is often the routing distribution rather than the GPUs themselves.
4. How to Correctly Interpret Leaderboard Scores
Developers tend to make two mistakes: treating a composite index as a pass for every task, and treating arena rankings as accuracy. A more rigorous reading is:
- The composite index is a weighted result across multiple tasks, with weights tilted toward general reasoning and knowledge, so it is only a reference for vertical business scenarios (such as internal domain Q&A);
- Arenas measure human preference and reflect how agreeable an answer is, which is not equivalent to factual accuracy or format compliance;
- Before launch, you must run a second validation on your own business evaluation set, covering at least four categories: instruction following, structured output, long-document recall, and code pass rate.
A minimal viable business evaluation skeleton:
cases = load_business_cases() # 100-300 real business samplesmetrics = {"instruction": 0, "json_valid": 0, "recall": 0, "code_pass": 0}for c in cases:r = model.generate(c.prompt, max_tokens=1024)metrics["instruction"] += judge_follow(r, c.constraints)metrics["json_valid"] += is_valid_json(r)metrics["recall"] += hit(r, c.golden_spans)metrics["code_pass"] += run_unittest(r, c.tests)print({k: v / len(cases) for k, v in metrics.items()})
5. Deployment Practice: Running 744B Total Parameters Smoothly
There is one iron rule for MoE deployment: memory is calculated from total parameters, speed from active parameters. The deployment plan therefore has to be designed around how to fit 744B weights.
- Precision and quantization: on the weight side, prefer mature low-bit quantization schemes from the industry. Note that expert layers and attention layers differ in quantization sensitivity, so it is advisable to run a per-layer sensitivity analysis before deciding on a strategy.
- Parallel partitioning: the expert dimension is naturally suited to expert parallelism, combined with tensor parallelism and pipeline parallelism; the expert parallelism degree should align with the number of experts to avoid load skew after partitioning.
- Caching and batching: use paged KV cache management to handle memory fragmentation, combined with continuous batching to improve concurrency; for long-context scenarios, be sure to account for the memory growth curve of the KV cache.
- Elasticity and cost: inference services can rely on container platforms for elastic scaling, use object storage for model weights and cold data, and use logging services plus monitoring and alerting to track time to first token, throughput, routing distribution, and error rates. Baidu AI Cloud offers standardized cloud infrastructure categories for these general capabilities, which teams can combine as needed.
- Cost conversion: break the “cost per million tokens” into fixed cost (weights resident in memory) and variable cost (compute from active parameters) to judge whether scaling out or quantizing is more cost-effective.
6. Conclusion
The significance of this generation of open models is not any single score but that it changes the structure of capability supply: sparsification decouples capacity from compute, mid-training makes the marginal return on data investment high again, and architectural improvements advance long context and routing efficiency together. For developers, the pragmatic path is to first narrow the candidate list with public leaderboards, then make the final call with a business evaluation set, and finally design the deployment topology based on the principle that memory follows total parameters and speed follows active parameters.
