Modern Large Language Models: Mainstream Architectures and Parameter Scales Explained

    This article explains the Decoder-only Transformer architecture that most current large language models use, and the design choices within it, including normalization, attention variants, and positional encoding. It also compares dense and mixture-of-experts (MoE) models, outlines common parameter-size tiers, and provides a rough method for estimating the memory needed to deploy these models.

    Developers choosing a model and teams planning a deployment usually face two basic questions: what structure does a given model use, and how many parameters does it have? This article answers both by covering architecture and parameter scale, based on technical points that are broadly accepted in the industry.

    1. The Basic Backbone: Decoder-only Transformer

    Most mainstream large language models use the Decoder-only Transformer architecture. This design keeps only the decoder portion of the original Transformer and generates text autoregressively, one token at a time. It has become the de facto standard because it balances scalability, training stability, and generation quality.

    Within the Decoder-only framework, models differ mainly in the following structural details.

    1.1 Normalization and Activation Functions

    Modern models generally use Pre-Norm placement and replace traditional normalization layers with RMSNorm, which performs only root-mean-square normalization. This lowers computational cost and improves training stability in deep models. For activation functions, SwiGLU and its variants have become nearly standard. With the same compute budget, they typically converge better than classic activation functions.

    1.2 Evolution of Attention Mechanisms

    The attention mechanism accounts for most of a model’s computational cost, and it is also where much of the architectural innovation happens. Common directions include:

    • Multi-Head Attention (MHA): The most basic form, where the query, key, and value heads are equal in number. It is highly expressive but requires a large KV cache during inference.
    • Multi-Query and Grouped-Query Attention (MQA/GQA): Several query heads share one set of key-value heads, which significantly reduces the KV cache during inference. These are the mainstream choices for open-source and commercial models today.
    • Latent attention approaches: Low-rank projections compress key-value information into a low-dimensional latent space, reducing the cache further. These approaches suit very long context scenarios.
    • Sparse and linear attention: These methods reduce the quadratic cost of attention on long sequences. They are common in models designed for long-text processing.

    An example attention configuration is shown below:

    1. config = {
    2. "hidden_size": 4096,
    3. "num_layers": 32,
    4. "num_attention_heads": 32, # number of query heads
    5. "num_kv_heads": 8, # number of key-value heads (GQA configuration)
    6. "max_position_embeddings": 128000,
    7. "rope_theta": 1000000, # RoPE base frequency
    8. }

    1.3 Positional Encoding

    Rotary Position Embedding (RoPE) has become the dominant approach. It injects relative position information into the attention computation, which naturally supports a range of length extrapolation techniques. Combined with base frequency adjustment and position interpolation, context windows have grown from a few thousand tokens to hundreds of thousands, and in some cases over a million tokens.

    2. Dense and Mixture-of-Experts Models: Two Paths to Scaling Parameters

    Any discussion of parameter scale has to cover two approaches: dense models and mixture-of-experts (MoE) models.

    2.1 Dense Models

    In a dense model, every token activates all of the model’s parameters. The structure is simple, and inference behavior is predictable. Dense models with a few billion to tens of billions of parameters suit local deployment, edge scenarios, and fine-tuning, which makes them a common starting point for most developers.

    2.2 Mixture-of-Experts (MoE) Models

    An MoE model splits the feed-forward network into multiple “experts,” and each token is routed to only a few of them. This keeps the number of activated parameters per inference step manageable, even when the total parameter count is very large. Representative models now have total parameter counts in the hundreds of billions, or even over a trillion, while activating only tens of billions of parameters per token.

    Key technical points for MoE include:

    • Routing strategies: Load balancing is central to training stability. Common approaches include auxiliary-loss-based balancing and auxiliary-loss-free bias adjustment.
    • Fine-grained expert partitioning: Splitting experts into smaller units and adding shared experts can improve expert specialization.
    • Communication overhead: During distributed training and inference, expert parallelism creates heavy cross-device communication, which places higher demands on cluster networking.

    For users, the practical meaning of MoE is this: at the same inference latency and cost, an MoE model can offer greater capacity. However, the total GPU memory needed to load the full model still depends on the total parameter count.

    3. Common Parameter Tiers and How to Choose

    Parameter counts vary across models, but the industry has settled on a few general tiers:

    Tier Typical Parameter Count Typical Use Cases
    Lightweight 1B to 10B On-device deployment, real-time interaction, large-scale concurrent fine-tuning
    Medium Tens of billions Enterprise knowledge bases, code assistance, vertical-domain applications
    Heavy dense Hundred-billion scale High-quality general Q&A, complex reasoning tasks
    Ultra-large MoE Hundreds of billions to over a trillion total parameters Flagship capabilities, high-throughput cloud services

    When choosing a model, aim for the smallest model that meets your needs. Larger parameter counts do not automatically produce better results for a given workload. Domain fine-tuning quality, context length, and inference cost often matter more.

    4. Rough Estimation of Memory and Compute

    Parameter scale directly determines deployment cost. You can use the following rule of thumb for a quick estimate:

    1. Inference memory ≈ parameter count × bytes per parameter + KV cache + activation overhead
    2. FP16 precision: 2 bytes per parameter; INT8 quantization: about 1 byte; INT4: about 0.5 bytes

    For example, a dense model with 70 billion parameters needs about 140 GB of GPU memory just to load its weights in half precision. The KV cache, which scales with context length and concurrency, and temporary activations add to this. In practice, deployment often requires multiple GPUs working in parallel. Engineering techniques such as quantization, continuous batching, and prefix caching can significantly reduce these costs. For enterprise deployments, teams often run inference services on general cloud capabilities, such as container platforms, elastic compute, and monitoring and alerting, instead of building and maintaining their own infrastructure.

    5. Conclusion

    Modern large language models share a common foundation, the Decoder-only Transformer. Components such as GQA, RoPE, and RMSNorm have converged across models, while MoE routing, sparse attention, and long-context extension remain active areas of exploration. Parameter scales range from about a billion on edge devices to around a trillion in the cloud, which forms a full spectrum of capability and cost. Understanding the principles behind architecture and parameter scale is more valuable over time than memorizing specific model names. This understanding helps developers make sound model selection and deployment decisions as models continue to evolve quickly.