A Deep Dive into the Open-Source GLM-5: Architecture, Training, and System Design
This article examines a new open-source large language model as a technical case study and abstracts the general engineering methods behind it. It covers three layers: model fundamentals (parameter count, activation strategy, and data mix), architectural changes (attention mechanisms, optimizer splitting, multi-token prediction, and sparse attention), and the training system (fully asynchronous agentic reinforcement learning). The goal is to explain how sparse architectures, long-context optimizations, and asynchronous RL together push open-source models into the same tier as leading closed-source models on public benchmarks.
1. Introduction: Pushing the Capability Boundary of Open-Source Models
Open-source large language models have iterated rapidly over the past year. A notable trend is that, on several third-party composite evaluation leaderboards, the overall scores of open-source models have approached or entered the range of the top closed-source models overseas. In text and code arena-style blind tests, open-source solutions also consistently rank near the top. This article uses a recently released new-generation open-source model as a technical sample, abstracts the general engineering methods behind it, and discusses three levels:
- Model fundamentals: how parameter count, activation strategy, and data mix determine the capability ceiling;
- Architectural changes: why attention mechanisms, optimizers, and training objectives need to be changed together;
- Training system: how the reinforcement learning stage trades throughput using asynchronous pipelines and in-house infrastructure.
Note that all capability descriptions below are generalized from common practices in public technical reports and do not involve any vendor’s proprietary interfaces or commercial parameters.
2. Model Fundamentals: Sparsification as the Main Thread
The model follows the mixture-of-experts (MoE) route, with about 744B total parameters and about 40B activated per inference, 256 experts, and 80 layers. Compared with the previous generation (355B total parameters, 32B activated), the total parameter count has doubled, activated parameters have increased slightly, and the pre-training corpus has expanded from about 23T tokens to about 28.5T tokens, including about 27T for pre-training and about 1.5T for mid-training.
The engineering logic behind these numbers is “decoupling capacity from compute”:
- Total parameters determine knowledge capacity, while activated parameters determine per-token inference cost. Making the total parameter count large and compressing the activation ratio to about 5% trades for stronger knowledge coverage under tolerable memory and bandwidth constraints.
- Mid-training takes on the role of capability “shaping”: continued training on small-scale, high-quality data over target distributions such as long text, code, and mathematics is more cost-effective than simply piling on pre-training tokens.
- On the evaluation side, a third-party composite intelligence index score in the 50 range, ranking first among open-source models, shows that the sparse architecture can already compete in the same tier as leading closed-source models on composite tasks.
3. Architectural Change One: Multi-Head Latent Attention and Optimizer Splitting
On the attention side, the model uses multi-head latent attention (MLA), which shares the same lineage as the mainstream sparsification route in the industry. Its core idea is to compress the key-value cache into a low-dimensional latent space and project it back up during inference, significantly reducing memory usage and bandwidth pressure in long-context scenarios. Long-text throughput is better than that of traditional multi-head attention.
However, the training stage exposed a typical contradiction: low-rank compression changes the distribution of gradients across parameter blocks, so parameter update scales are no longer consistent. Using a unified full-parameter optimizer can easily cause some modules to be under-updated and others to oscillate. A common solution is to split the optimizer into two groups:
# Illustration: splitting the optimizer by parameter block (pseudocode)attn_params, other_params = split_by_module(model)opt_attn = MuonLike(lr=3e-4, momentum=0.95) # Matrix-type parameters use orthogonalized updatesopt_other = AdamW(lr=1.5e-4, betas=(0.9, 0.95)) # Vector/embedding-type parametersfor batch in loader:loss = model(batch)loss.backward()opt_attn.step(); opt_attn.zero_grad()opt_other.step(); opt_other.zero_grad()
The key point is that matrix-type weights are suited to orthogonalized updates to stabilize the spectral norm, while vector and embedding-type parameters are better suited to adaptive moment estimation. After splitting, the training curve is smoother and long-context tasks converge faster.
4. Architectural Change Two: Multi-Token Prediction
The second change introduces multi-token prediction (MTP) at the training-objective level. Traditional autoregression predicts only the next token at each position, resulting in low supervision signal density. MTP attaches lightweight prediction heads at each layer or several layers to predict the second and third future tokens simultaneously, bringing three benefits:
- Improved sample efficiency: the same batch of data produces denser gradient signals;
- Enhanced planning: it forces representations to encode longer-range dependencies, which is especially effective for code and reasoning-chain tasks;
- Usable for speculative decoding: the extra prediction heads naturally act as a draft model, allowing multiple tokens to be verified at once during inference and reducing latency.
5. Architectural Change Three: Order-of-Magnitude Gains from Sparse Attention
The third change is deep sparse attention (DSA). Its key finding is that, with a continued-training budget of about 20B tokens, it can match the effect of a dense attention baseline trained on about 943.7B tokens, with a compute difference of nearly two orders of magnitude. In engineering terms, it usually involves three steps:
- Scoring: use a lightweight index network to estimate the relevance of each query to historical keys;
- Selection: keep only the top-k keys for attention computation and skip the rest directly;
- Training alignment: use a small amount of dense attention for distillation or loss alignment to avoid distribution drift caused by sparsity.
In deployment, attention should be paid to the memory layout of the index structure, the parallelism of the top-k operator, and the compatibility with the MLA latent cache. These three points determine whether the actual speedup can approach the theoretical value.
6. Training System: Fully Asynchronous Agentic Reinforcement Learning
The core challenge of the post-training stage is that sampling and training wait on each other: generation time for long chains of thought fluctuates greatly, and a synchronous pipeline leaves GPUs largely idle. The fully asynchronous agentic RL framework splits generation, scoring, and updating into independent services, uses version numbers with weights to control data freshness, allows slightly-off-policy samples to enter training, and corrects bias through importance sampling.
The accompanying RL infrastructure (often called a slime-style framework in the industry) typically features fine-grained task orchestration, trajectory caching and reuse, failure retries, and dynamic scaling of training and inference resource pools. On the cloud, it can be implemented by combining a container platform for elastic compute, object storage for trajectories and checkpoints, a message queue to decouple sampling from training, and logging, monitoring, and alerting services to track throughput and stability.
7. Practical Recommendations and Conclusion
- Selection: prioritize evaluating activated parameters rather than total parameters, as they are closer to real inference cost;
- Long text: after stacking MLA and sparse attention, verify the impact of index recall on downstream tasks;
- Training: optimizer splitting and asynchronous RL are the two changes with the highest returns and are recommended for priority implementation;
- Evaluation: combine the composite intelligence index with code and text blind tests from multiple perspectives to avoid misjudgment from a single metric.
Overall, the methodology of this generation of open-source models can be summarized as: using sparse architectures for capacity, latent and sparse attention for long-text efficiency, multi-token prediction for sample efficiency, and asynchronous RL for training throughput. Only when the four are stacked together do open-source solutions enter the same tier as leading closed-source models on composite leaderboards.
