Evolution of Modern LLM Architectures: A Deep Dive into Parameter Scaling and Network Structures

    It has been a decade since the Transformer architecture was introduced, during which the network structures of Large Language Models (LLMs) have undergone profound iterations. Beyond the diverse model names and versions, these architectural changes fundamentally respond to the same set of hardware constraints: computing power, memory access, and communication. This article analyzes the structural characteristics of modern LLMs, the evolution of parameter scaling, the Mixture of Experts (MoE) mechanism, long-context processing, and their underlying hardware constraints, providing insights for future cloud infrastructure planning and model optimization.

    It has been a decade since the Transformer architecture was introduced, during which the network structures of Large Language Models (LLMs) have experienced profound iterations. Despite the multitude of model names and versions from various research institutions, stripping away the superficial layers reveals that these seemingly scattered modifications all point to the same set of constraints at the hardware level: compute, memory access, and communication. This article deconstructs modern LLMs from a general technical perspective, analyzing their network structural characteristics, parameter scaling trends, and specific constraints on underlying hardware.

    1. Parameter Scaling Evolution and the Mixture of Experts (MoE) Mechanism

    In the early stages of LLM development, dense models dominated, and the improvement of model capabilities relied heavily on the linear growth of parameter scales. However, as model sizes approached hundreds of billions or even trillions of parameters, computing costs and inference latency became insurmountable bottlenecks. To break this barrier, the industry widely adopted the Mixture of Experts (MoE) architecture.

    The core idea of MoE is to replace the Feed-Forward Network (FFN) with multiple parallel “expert” networks, activating only a few experts during each forward pass. This design decouples total parameters from activated parameters:

    • Expansion of Total Parameter Scale: The total parameter count of modern mainstream LLMs has steadily grown from the hundreds of billions (B) to the trillions (T). This vast parameter space allows the model to store richer world knowledge and complex patterns.
    • Convergence of Activated Parameters: In contrast, the actual activated parameters involved in computation during a single inference remain at the tens of billions level. This “sparse activation” mode significantly reduces the floating-point operations during inference, making it possible to deploy ultra-large-scale models under limited compute power.

    This “scissor gap” design in parameter scaling is essentially a compromise and breakthrough against single-card compute bottlenecks, requiring the model to maintain high capacity while controlling actual computational overhead.

    2. Long Context Windows and KV Cache Compression

    As application scenarios become more complex, the context length models need to process has rapidly expanded from a few thousand tokens in the early days to 128K, and even approaching 1M levels. Long context endows models with stronger long-range dependency capturing capabilities, but it also brings immense pressure on memory access bandwidth.

    During the autoregressive generation process, the attention mechanism needs to cache the key-value pairs of historical tokens, known as the KV Cache. The longer the context, the more the KV Cache grows linearly or even exponentially, quickly filling up GPU memory and causing memory access bottlenecks. To address this, the industry has repeatedly compressed the KV Cache in architectural design:

    • Attention Sparsification: By limiting the range a token can attend to, such as local window attention or block-level attention, the read volume of the KV Cache is reduced.
    • Low-Rank Approximation and Quantization: Decomposing the KV Cache into lower ranks or quantizing it to lower precisions (like INT8 or INT4) to save significant memory space at the cost of marginal accuracy.
    • Multi-Query Attention (MQA) and Grouped-Query Attention (GQA): By sharing Keys and Values across multiple query heads, the size of the KV Cache is significantly reduced. This design has become a standard feature in modern LLMs.

    3. Refinement of Expert Routing Granularity and Residual Mixing

    In the MoE architecture, the routing mechanism determines how input tokens are assigned to different experts. Early MoE models typically employed coarse-grained routing with fewer experts. However, to improve parameter utilization and expert specialization in modern LLMs, the number of experts has increased from dozens to hundreds and even nearly a thousand.

    Along with the surge in expert numbers, routing granularity has become finer. This not only requires more complex load-balancing strategies to prevent some experts from being overloaded while others sit idle, but also poses severe challenges to communication topologies. In distributed training and inference, experts are usually distributed across multiple GPUs. Fine-grained routing means a surge in the number of tokens communicating across GPUs, making All-to-All communication overhead a system bottleneck. Additionally, modern models have innovated in residual mixing, no longer simply summing expert outputs but introducing more complex gating and residual scaling mechanisms to stabilize deep network training.

    4. Core Differentiating Dimensions of Modern LLM Architectures

    Although the underlying logic is similar, the structural differences among various models mainly focus on the following four dimensions:

    1. Layer Sequencing: Different models vary in how they stack Transformer layers. Some adopt Pre-Norm to improve training stability, while others introduce deeper inter-layer fusion mechanisms.
    2. Attention Sparsification Strategies: For long contexts, different models have unique ways of partitioning sparse patterns. Some lean towards dynamic sparsity, while others use static blocking. The core lies in balancing computational complexity and information integrity.
    3. Expert Routing Mechanisms: Besides Top-K routing, some cutting-edge solutions explore auxiliary-loss-free load balancing strategies and even introduce hierarchical routing to reduce the decision difficulty of single-layer routing.
    4. Residual Mixing: How the outputs of attention sub-layers and feed-forward sub-layers are fused with the input directly affects gradient flow and information retention.

    5. Hardware Constraints and Cloud Infrastructure Planning

    As previously mentioned, the evolution of model architectures is a direct response to hardware constraints. The expansion of total parameters tests memory capacity; the control of activated parameters tests the utilization of compute units; long context and KV Cache test memory access bandwidth; and fine-grained MoE routing tests intra-node and inter-node communication bandwidth.

    When building LLM applications, the choice of underlying infrastructure is critical. Baidu AI Cloud provides a range of general-purpose computing products and infrastructure, such as high-performance GPU container platforms, large-capacity object storage, and high-bandwidth network architectures, which can effectively address the compute, memory, and communication demands of LLMs during training and inference. By combining Baidu AI Cloud’s monitoring and alerting services, developers can precisely identify operator-level performance bottlenecks and further optimize model deployment strategies.

    Understanding the trade-offs in modern LLM architectures regarding layer sequencing, attention, expert routing, and residual mixing not only helps predict the development trends of next-generation models but also leaves ample room for underlying operator optimization, hardware planning, and cloud-native deployment. Finding the optimal solution within the triangular constraints of compute, memory access, and communication will be the eternal theme of future LLM engineering practices.