Modern Large Language Models: Mainstream Architectures and Parameter Scales Explained

    This article explains the architectural patterns and parameter scale trends of modern large language models from a general technical perspective. It covers why Decoder-Only has become the standard design, how normalization, activation functions, positional encoding, and attention mechanisms have evolved, and how Mixture of Experts separates total parameter count from compute cost. It also looks at how parameter count relates to memory requirements and deployment choices.

    Introduction

    Over the past few years, large language models have iterated at an explosive pace. With new model versions appearing constantly and parameter counts often reaching hundreds of billions, developers most often ask two questions: What is the internal structure of these models? How large are the parameter counts, and what do they mean? This article does not focus on any specific product. Instead, it breaks down the architectural patterns and parameter scaling rules of modern large language models from a general technical perspective.

    1. Mainstream Architecture: Decoder-Only as the De Facto Standard

    1.1 Why Decoder-Only

    Nearly all modern large language models are built on the Transformer decoder (Decoder-Only) structure. Compared with the encoder-decoder architecture, the Decoder-Only design has three advantages:

    • Unified task formulation: All tasks, including classification, extraction, and generation, can be converted into autoregressive “next-token prediction,” which makes large-scale pretraining easier.
    • High training efficiency: The causal mask naturally supports parallel computation. Combined with the causal language modeling objective, data utilization is high.
    • Good scalability: Experiments show that as parameter and data scales grow, the emergent abilities of pure decoder models become more stable.

    1.2 Evolution of Core Components

    Modern Decoder-Only models have made several key improvements over the original Transformer.

    (1) Normalization: Pre-Norm + RMSNorm

    The original architecture used Post-Norm, which applies normalization after the residual connection. This made deep models prone to gradient instability during training. Modern models generally switch to Pre-Norm and replace LayerNorm with the lightweight RMSNorm. RMSNorm removes the mean-centering operation and reduces computational overhead by about 10% to 20%.

    (2) Activation function: From GELU to SwiGLU

    The feed-forward network (FFN) commonly uses the gated linear unit SwiGLU, which has a three-matrix design:

    1. FFN(x) = (SiLU(xW_gate) ⊙ xW_up) · W_down

    Compared with the two-matrix GELU FFN, SwiGLU converges faster and performs better at the same computational cost. The trade-off is a higher parameter count. To keep total compute unchanged, the hidden dimension is usually reduced to two-thirds of its original size.

    (3) Positional encoding: RoPE and position extrapolation

    Rotary Position Embedding (RoPE) injects positional information into the attention computation through rotation. It combines relative position properties with good extrapolation potential. Combined with techniques such as interpolation and NTK scaling, it can extend the context from a few thousand tokens during training to hundreds of thousands or even millions of tokens.

    (4) Attention mechanism: From MHA to GQA / MLA

    To reduce KV cache overhead during inference, Multi-Head Attention (MHA) has gradually evolved into the following variants:

    • MQA: All query heads share a single set of K/V. It has the smallest cache, but the output quality suffers some loss.
    • GQA: Query heads are grouped to share K/V. It is a compromise between quality and efficiency and is the most widely used approach today.
    • Low-rank compressed attention: K/V are projected into a low-rank latent space and then expanded. This further compresses the cache and suits ultra-long context scenarios.

    2. MoE: Decoupling Parameter Scale from Compute Cost

    2.1 How Sparse Mixture of Experts Works

    In a dense model, every token activates all parameters. A Mixture of Experts (MoE) model replaces the FFN layer with several expert sub-networks. A router (gate) then selects only the Top-K experts for each token, usually 2 to 8 of them, to take part in the computation:

    1. y = Σ_{i∈TopK} softmax(Router(x))_i · Expert_i(x)

    2.2 Engineering Implications

    • Total parameters are not active parameters: An MoE model with several hundred billion total parameters may activate only tens of billions of parameters in a single forward pass. Its inference cost is close to that of a dense model with the same number of active parameters, while its knowledge capacity is substantially larger.
    • Training challenges: Load imbalance, where some experts become overloaded, is the core problem. It is typically addressed with an auxiliary load-balancing loss or a lossless routing bias adjustment mechanism.
    • Communication overhead: Expert parallelism requires cross-device All-to-All communication, which places high demands on cluster interconnect bandwidth.

    3. Parameter Scale: Size Categories and Their Meaning

    3.1 Common Size Categories

    Category Typical total parameters Typical positioning
    Small 1B to 3B On-device, mobile, and embedded inference
    Medium 7B to 34B Deployable on one or several GPUs; the main workhorse for general business use
    Large 70B to 150B Complex reasoning and knowledge-intensive tasks
    Very large Hundreds of billions and above (mostly MoE) Flagship capabilities, served in the cloud

    3.2 Converting Parameter Count to Memory

    Using the common FP16/BF16 format, which takes 2 bytes per parameter, as an example:

    1. Weight memory ≈ parameter count × 2 bytes
    • 7B parameters ≈ 14 GB
    • 70B parameters ≈ 140 GB (requires multiple GPUs or quantization)

    With INT8 or INT4 quantization, weight memory can be reduced to about one half and one quarter, respectively. Mainstream methods usually keep the accuracy loss within an acceptable range. Inference also needs space for the KV cache. Its size is proportional to the number of layers × KV heads × head dimension × sequence length × concurrency. This is the core value of designs such as GQA.

    3.3 Implications of Scaling Laws

    Parameter count is not the only variable. Widely accepted scaling laws show that model capability is determined jointly by parameter count, training data volume, and compute. Early models tended to scale up parameters. Recent models generally favor a “smaller parameter count with massive high-quality data” approach. For example, a model with tens of billions of parameters trained on several trillion tokens can outperform a hundred-billion-scale model that has not been trained sufficiently. This trend benefits engineering deployment. Inference cost grows linearly with active parameters, while data investment happens only during training.

    4. Engineering-Oriented Selection Guidelines

    1. Define the scenario before the scale: For simple classification and rewriting tasks, a 1B-class model may be sufficient. For complex reasoning, code generation, or long-document analysis, consider models above 10B parameters.
    2. Prioritize active parameters over total parameters: The inference cost of an MoE model is determined by its active parameters, so deployment budgets should be estimated from the active parameter count.
    3. Pay attention to context and cache costs: In long-context scenarios, the KV cache can exceed the memory used by the weights. Attention design, such as GQA or low-rank compression, affects deployment cost more than parameter count does.
    4. Make good use of general cloud capabilities: Elastic compute, object storage, logging, and monitoring and alerting services can support the full workflow, from fine-tuning and evaluation to production inference. Teams do not need to rebuild foundational infrastructure on their own.

    Conclusion

    The architecture of modern large language models has converged on a clear main line: a Decoder-Only backbone, a combination of Pre-Norm, SwiGLU, and RoPE components, GQA or low-rank attention to control cache size, and MoE to decouple parameter count from compute. Understanding these general principles is far more valuable in the long run than memorizing specific version numbers. Versions become outdated, but the underlying logic of architectural paradigms and scaling economics will continue to guide technical decisions for a long time.