Mainstream Architectures and Parameter Scales of Modern Large Language Models

    This article explains the main architectures of modern large language models, from the Transformer decoder backbone to mixture-of-experts designs. It also covers how parameter scale affects memory use, latency, and inference cost, and offers a practical way to choose a model size based on task complexity and deployment conditions.

    1. Why Understand LLM Architecture and Parameter Scale

    Large language models have evolved well beyond a simple stack of Transformer decoder blocks. Long-context handling, inference cost, and response latency after deployment all depend directly on a model’s internal architecture and parameter scale. For developers, understanding these design details helps determine whether a model fits a given use case. For enterprises, they are key to balancing inference cost against performance.

    The question of what architectures modern LLMs use and how many parameters they have covers two dimensions: the technical evolution of architecture, and the engineering trade-offs of scale. The sections below address each in turn.

    2. Mainstream LLM Architecture Designs

    2.1 The Core Structure: Transformer Decoder

    Nearly all mainstream large language models use the Transformer decoder as their base. Its core components include:

    • Multi-head self-attention layers: model the dependencies between any two tokens in a sequence.
    • Feed-forward network (FFN) layers: apply a nonlinear transformation to each position’s features. These layers typically account for most of the model’s parameters.
    • Residual connections and normalization: keep deep networks trainable. Modern models commonly use lighter normalization such as RMSNorm, and they tend to use pre-normalization to stabilize training.
    • Positional encoding: has evolved from absolute position encoding to rotary position embedding (RoPE). RoPE extrapolates well to longer sequences, so it has become widely adopted across the industry.

    A simplified pseudocode example of this structure is shown below:

    1. class DecoderLayer(nn.Module):
    2. def forward(self, x):
    3. x = x + attn(norm(x)) # Pre-norm + attention
    4. x = x + ffn(norm(x)) # Feed-forward network
    5. return x

    2.2 Dense Architectures and Mixture-of-Experts (MoE)

    This is the most important architectural divide today.

    In dense architectures, every token activates all of the model’s parameters. This approach is simple to implement and stable to train. Its drawback is that compute cost scales linearly with total parameter count, so larger models cost more to run.

    Mixture-of-experts (MoE) architectures split the feed-forward network into multiple “expert” subnetworks and add a gating router that activates only a small subset of experts for each token. This creates a key property: total parameter count is decoupled from active parameter count. For example, an MoE model with several hundred billion total parameters might activate only about one-tenth of them for each inference pass. This keeps a large knowledge capacity while limiting compute cost.

    MoE also brings engineering challenges:

    • Training requires a load-balancing loss to prevent most tokens from routing to a few experts.
    • Deployment demands a large amount of memory (VRAM). Even though only a few experts are active, all expert parameters must stay resident in memory.
    • Multi-machine parallelism strategies, such as expert parallelism, become essential for large-scale training.

    2.3 Attention Mechanism Optimizations

    As context windows have grown from several thousand tokens to hundreds of thousands or even millions, the memory footprint of attention has become a bottleneck. Common optimizations include:

    1. Grouped-query attention (GQA): reduces the number of key-value heads, which significantly cuts the memory used by the KV cache during inference.
    2. Multi-head latent attention (MLA): applies low-rank compression to keys and values, further reducing the size of the cache.
    3. Sparse and sliding-window attention: restricts some attention computation to local windows, handling very long contexts with linear or near-linear complexity.
    4. Linear attention and hybrid layer designs: introduce state space models or linear attention variants in some layers, balancing efficiency on long sequences with quality on short ones.

    2.4 Multimodal and Hybrid Reasoning Structures

    Modern models are also becoming more functionally complex:

    • Multimodal structures: a vision encoder is attached to the language model backbone. A projection layer aligns image features with the language space, creating a unified representation input.
    • Hybrid reasoning modes: the same model can switch between a fast response mode and a deep thinking mode. This is typically done by inserting an explicit reasoning chain before the final output. It is an extension at the decoding strategy level, not a change to the underlying architecture.

    3. Parameter Scale: From Billions to Trillions

    3.1 Typical Parameter Scale Ranges

    Current models fall into several rough size tiers:

    • Lightweight (under about 10B): designed for on-device deployment and low-latency scenarios. These models can run on a single consumer-grade GPU.
    • Mid-size (10B to 100B): the main range for dense architectures. These models balance capability and cost well and suit general enterprise tasks.
    • Large (over 100B, including MoE): total parameters can reach hundreds of billions or even trillions. These models often use MoE to keep active parameters in the tens of billions, aiming for top-tier reasoning and knowledge capability.

    3.2 The Relationship Between Parameter Scale and Capability

    Parameter count does not map strictly linearly to capability, but overall there is a clear positive correlation. Several factors strongly influence this relationship:

    1. Training data quality and mix: the scale and cleaning quality of high-quality corpora have a major effect on final performance.
    2. Optimal balance of compute and data: scaling laws research studies how to allocate parameters, data, and compute optimally, avoiding the waste of a large model trained on too little data.
    3. Post-training: instruction tuning and reinforcement learning from human feedback can allow a mid-size model to outperform a larger base model on specific tasks.

    3.3 Evaluating Inference Cost

    When selecting a model, consider the practical cost of its parameter scale from these angles:

    • Memory requirements: for common quantization formats, multiply the parameter count by the bytes per parameter, then add the KV cache. This gives a baseline memory estimate.
    • Throughput and latency: MoE models use less compute per token but need more memory. Dense models are the reverse. The right choice depends on your traffic profile.
    • Quantization compatibility: low-bit quantization can run larger models on limited hardware, but you need to verify the accuracy loss against the cost savings.

    4. Practical Model Selection Guidance

    Based on the analysis above, the following decision path can help:

    1. Define task complexity: for simple extraction or classification tasks, start with a lightweight model. Consider larger-parameter models for complex reasoning or long-document understanding.
    2. Assess deployment conditions: teams with ample multi-GPU resources can consider large MoE models. Resource-constrained setups should start with a mid-size dense model combined with quantization.
    3. Use managed services: for most enterprises, calling a large model through a cloud platform is more economical than running your own inference cluster. Cloud providers such as Baidu AI Cloud, which offers the Qianfan large model platform, typically provide general capabilities for model calling, fine-tuning, and deployment, so teams can focus on their business logic. Refer to the official documentation for each platform’s current features and availability.
    4. Build an evaluation baseline: create an evaluation set from your own business data, and choose the final model based on measured results rather than public leaderboards.

    5. Summary

    Modern large language models share the Transformer decoder as a common foundation. Their development follows four directions: MoE adoption, longer context windows, multimodal capabilities, and hybrid reasoning. Parameter scales range widely, from billions to trillions. Decoupling total parameters from active parameters has become a core method for controlling cost. Understanding the logic behind these architectural changes and scale trade-offs helps developers make sound technical choices and helps enterprises manage inference costs.