Deep Dive into the GLM-5 Technical Report: Architecture, Training, and Infrastructure

    This article breaks down the GLM-5 open-weight model technical report, covering its MoE base specifications, key architectural changes such as sparse attention and multi-token prediction, the fully asynchronous agentic reinforcement learning framework, the supporting self-developed infrastructure, and a practical evaluation checklist for real-world deployment.

    1. Why This Technical Report Deserves a Block-by-Block Breakdown

    A recent conclusion from a third-party evaluation organization states that closed-source flagship models still hold the “most intelligent” position, but the gap between them and the open-weight models that follow closely has clearly narrowed. The significance of this judgment lies not in the ranking itself, but in the fact that it marks the point at which open-weight models already meet the conditions to compete head-on with closed-source solutions within the “usable capability range.” It is against this backdrop that an open-weight model technical report of roughly 40 pages has sparked extensive discussion. The keywords mentioned repeatedly concentrate on three areas: reduced training and inference costs brought by sparse attention, a fully asynchronous agentic reinforcement learning training framework, and self-developed reinforcement learning infrastructure.

    It is worth emphasizing that evaluation scores are only outcome metrics. What truly deserves study by developers and platform providers is the architectural trade-offs and engineering implementation behind the scores. This article unfolds layer by layer in the order of “base specifications — architectural changes — training methods — infrastructure — deployment evaluation,” helping readers build a transferable judgment framework rather than memorize a specific number.

    2. Base Specifications: The Division of Labor Between Total and Activated Parameters

    The overall form of the model belongs to a Mixture of Experts (MoE) architecture. The core idea is to decouple “knowledge capacity” from “compute per pass”: the total parameter scale determines the upper limit of knowledge the model can carry, while the activated parameters determine the actual compute cost per token.

    The fundamentals disclosed in the report are roughly as follows:

    • Total parameters of about 744B, about 40B activated per token, 256 experts, and 80 layers;
    • Compared with the previous generation, total parameters doubled from the 355B scale to the 744B scale, and activated parameters increased from 32B to 40B;
    • The pre-training corpus scale increased from 23T tokens to 28.5T tokens, of which about 27T was pre-training and about 1.5T was mid-training.

    The engineering implications of these numbers are richer than they appear on the surface. Activated parameters increased by only 8B while total parameters doubled, which means sparsity increased significantly: the gains from model capacity growth are offset by a small rise in single forward-pass compute, achieving a balance between “stronger” and “cheaper.” For users, this directly determines how memory and compute are planned—weight loading cost is calculated by total parameters, while throughput capacity is closer to an estimate based on activated parameters. Conflating the two is the most common source of error in capacity planning.

    3. Three Key Architectural Changes

    3.1 Adapting the Attention Mechanism to the Optimizer

    The model adopts a Multi-head Latent Attention (MLA) approach, sharing the same origin as existing low-rank compression schemes in the industry: it reduces memory usage by compressing the dimension of the key-value cache, offering clear advantages over traditional multi-head attention in long-text scenarios. However, the team found a counterintuitive phenomenon during training: when paired with a commonly used matrix-type optimizer, its performance actually fell short of the structurally simpler Grouped Query Attention scheme.

    The final solution is described as “optimizer splitting”: the orthogonalization operation originally applied to the entire projection matrix is changed to be performed separately for each attention head. The logic is not mysterious—orthogonalization is used to make the weight distribution more uniform, and when the projection matrix contains multiple semantically independent subspaces, whole-matrix orthogonalization forcibly couples these subspaces and weakens the optimization effect; splitting by head is equivalent to restoring the independence of the subspaces.

    The general value of this type of problem is that architectural innovation often does not happen in isolation; it requires optimizers, initialization, and learning rate schedules to adapt synchronously. Any expectation that “swapping the structure will boost performance” should reserve a budget for tuning and adaptation costs.

    3.2 Multi-Token Prediction

    Multi-token prediction allows the model to predict tokens at multiple future positions simultaneously in a single forward pass. The benefits are twofold: during training, it provides denser supervision signals and improves sample efficiency; during inference, it provides a natural draft source for speculative decoding, thereby reducing the actual number of decoding steps. In engineering terms, the number of prediction heads, loss weights, and late-stage training strategies all significantly affect final performance, making this a component that must be jointly tuned with the main task.

    3.3 Sparse Attention

    The most discussed mechanism in the report is sparse attention: in extremely long-context training, only about 20B tokens were used to approach the performance of a dense attention baseline on 943.7B tokens. The correct reading of this comparison is not “a 40x efficiency improvement,” but rather that sparsification changed the “learning curve slope” of long-context capability, allowing limited compute to be invested more in data with higher capability density. The takeaway for practitioners is that long-context capability does not have to be obtained only by piling up tokens; modifying the attention structure is an equally effective lever.

    4. Training Method: Asynchronous Agentic Reinforcement Learning

    The second key point disclosed in the report is a reinforcement learning framework for agentic tasks, whose core feature is being “fully asynchronous”: generation (inference) and training are decoupled, so long-tail trajectories no longer block the overall iteration.

    The pain point of traditional synchronous frameworks is that the length of individual trajectories in agentic tasks varies greatly. A single rollout may contain dozens of tool calls, and the slowest sample determines the completion time of the entire batch, severely dragging down compute utilization due to the long tail. After asynchronization, the inference cluster continuously produces experience, and the training side consumes it in available batches. Combined with experience replay and importance sampling correction, utilization can be pushed to a high level while maintaining algorithmic stability.

    The schematic process structure is as follows:

    1. # Pseudocode: main loop of asynchronous agentic reinforcement learning
    2. trainer = Trainer(policy)
    3. buffer = ReplayBuffer(capacity=N)
    4. # The inference side continuously produces trajectories without waiting for training
    5. for traj in rollout_worker.stream(env_pool, policy_snapshot):
    6. buffer.add(traj)
    7. # The training side consumes in batches, using corrected importance weights
    8. while not converged:
    9. batch = buffer.sample(batch_size)
    10. ratio = policy.log_prob(batch) / batch.behavior_log_prob
    11. loss = clipped_objective(ratio, batch.advantage)
    12. trainer.step(loss)
    13. if step % sync_interval == 0:
    14. policy_snapshot = trainer.sync_weights() # Periodically synchronize weights

    Three risk points must be watched in engineering: policy staleness (too long a weight synchronization interval leads to data distribution shift), reward design (agentic task rewards are sparse, requiring process rewards or staged checks), and sandbox isolation and least-privilege permissions for tool calls.

    5. Infrastructure and Platform-Side Support

    Supporting the above training paradigm is a set of self-developed reinforcement learning infrastructure. Abstractly, such a system usually consists of four parts: a high-throughput inference engine responsible for trajectory generation, an orchestration layer responsible for task scheduling and fault tolerance, a parameter synchronization module responsible for weight version management, and a metrics and logging system responsible for observability of the training process. Mapped onto a general cloud environment, this can correspond to a container platform carrying elastic compute, object storage holding checkpoints and datasets, a message queue decoupling generation and consumption, and logging, monitoring, and alerting services tracking long-tail tasks and failure retries.

    6. Deployment Evaluation Checklist

    When facing a new generation of open-weight models, it is recommended to conduct your own scenario validation along the following dimensions rather than directly trusting leaderboards:

    1. Real long-context gains: construct retrieval and summarization tasks of 32K or more using your industry’s business documents, and observe memory usage and first-token latency;
    2. Cost model from sparsity: estimate memory by total parameters and throughput by activated parameters separately, and calculate the cost per token;
    3. Agentic capability: design multi-turn tool-calling tasks and evaluate stability and failure recovery under long-tail trajectories;
    4. Fine-tuning adaptation cost: reserve a tuning budget for optimizer and structural adaptation;
    5. Compliance and deployment form: confirm weight licensing, data residency requirements, and the feasibility of private deployment.

    7. Conclusion

    The real value of this report lies not in a particular score or a set of parameters, but in the fact that it demonstrates a clear path: trading a sparse architecture for a balance between capacity and cost, trading structural modification for the sample efficiency of long context, and trading asynchronous reinforcement learning for the engineering efficiency of agentic training. For developers, thoroughly understanding these three layers of logic brings more long-term returns than memorizing any specific model.