Understanding Mainstream Large Language Model Architectures and Parameter Scales

    This article breaks down the two dimensions that matter most when evaluating large language models: architecture paradigm and parameter scale. It explains the difference between total and activated parameters, walks through dense, Mixture-of-Experts (MoE), and evolving attention and positional encoding designs, and offers a practical checklist for reading model specifications. It also covers common deployment and tuning practices, plus guidance on choosing between dense and sparse models for different scenarios.

    1. Why Architecture and Parameter Scale Are the Starting Point

    In engineering practice, two dimensions are genuinely meaningful when discussing a model’s capability boundaries: the network architecture paradigm and the parameter scale magnitude. The former determines computational complexity, GPU memory usage curves, and parallel partitioning strategies; the latter determines the capacity ceiling and inference cost. It is worth emphasizing that parameter scale is not a single number representing “total parameters.” Instead, it depends on the combination of total parameters, activated parameters, layer count, hidden dimension, number of attention heads, vocabulary size, and other configuration items.

    Based on publicly available technical material, current mainstream open-source and commercial models fall into a few clear magnitude tiers:

    • Small / on-device tier: roughly 1B–8B total parameters, targeting low latency and local deployment;
    • Medium tier: roughly 10B–40B, balancing quality with what a single or dual GPU can host;
    • Large dense tier: roughly 70B–240B, usually requiring multi-GPU tensor parallelism;
    • Ultra-large sparse tier: 200B–1T+ total parameters, but activated parameters per token are often only 5%–20% of the total.

    Understanding the separation between “total parameters / activated parameters” is the first key to reading modern model specification sheets.

    2. Breaking Down Mainstream Architecture Paradigms

    2.1 Dense Feed-Forward Architecture

    The most classic implementation is a multi-layer Transformer Decoder, where each layer consists of normalization, an attention sub-layer, and a feed-forward sub-layer. The feed-forward layer typically uses an intermediate expansion of 2.7–4 times the hidden dimension. Its advantages are predictable memory and compute usage and mature parallelization strategies; its drawback is that, under an equal compute budget, capacity growth is tightly coupled to compute growth.

    1. # Simplified forward pass of a dense layer
    2. h = x + attn(norm(x))
    3. out = h + ffn(norm(h)) # ffn: Linear(d, 4d) -> act -> Linear(4d, d)

    2.2 Mixture-of-Experts (MoE) Sparse Architecture

    Replacing the feed-forward sub-layer with multiple “expert” networks and a gating router means each token activates only the Top-K experts. This allows total parameters to be very large while keeping per-token computation controllable. Three engineering concerns must be addressed: routing load balancing, communication overhead under expert parallelism, and expert cache hit rate during inference.

    1. logits = router(norm(h)) # [tokens, num_experts]
    2. idx, w = topk(logits, k=2)
    3. y = sum(w_i * expert_i(norm(h)) for i in idx)

    2.3 Evolution of Attention and Positional Encoding

    • Multi-head attention has gradually adopted grouped-query attention (GQA) and multi-query attention (MQA) to compress the key-value cache during inference;
    • Some models use sliding-window or local–global hybrid attention, bringing long-sequence complexity from quadratic back to near-linear;
    • Positional encoding has moved from absolute positions to rotary position embedding (RoPE) and its interpolation/extrapolation extension schemes, supporting 128K and even longer contexts;
    • Normalization placement (pre- or post-) and activation function choices (such as the gated linear unit family) also affect stability and convergence speed.

    3. How to Read a Model Specification

    When you get a model’s technical report, review it in the following order:

    1. Architecture type: dense or sparse, and what the activation ratio is;
    2. Scale configuration: layer count, hidden dimension, number of attention heads and key-value heads, vocabulary size;
    3. Context length and positional encoding extrapolation strategy;
    4. Precision and quantization: training precision and supported quantization bit widths for inference;
    5. Training data scale and token count, which is key to judging whether the parameters are “well fed”;
    6. Evaluation methodology: whether it is zero-shot, and whether tool calling and chain-of-thought are used.

    A practical rule of thumb: under equal activated parameters, sparse models offer larger capacity but higher engineering complexity; under equal total parameters, dense models are more stable for inference and easier to operate.

    4. General Deployment and Tuning Practices

    When deploying on a general cloud platform, you can combine a container platform to host inference services, object storage to hold model weights, a message queue to smooth out request spikes, and logging and monitoring/alerting services to track latency and throughput. Common optimization techniques include:

    • Tensor parallelism plus pipeline parallelism to partition ultra-large dense models;
    • Expert parallelism for sparse models, with a reasonable capacity factor set to avoid expert overflow;
    • Key-value cache reuse, continuous batching, and prefix caching to improve throughput;
    • Choosing a quantization scheme based on business latency targets, and running quality regression on a small sample set.
    1. # Observe key metrics of the inference service (illustrative)
    2. watch -n 2 'curl -s http://127.0.0.1:8000/metrics | grep -E "tokens_per_s|kv_cache"'

    5. Selection Recommendations

    If you prioritize stability and low operational cost, prefer a medium-sized dense model; if you need large capacity and can take on distributed engineering investment, a sparse architecture is an option; for on-device scenarios, focus on the 1B–8B tier combined with quantization. Baidu AI Cloud provides general capabilities in model serving and compute scheduling, and the final decision can be made in combination with your own business load-testing results.