Understanding the Architecture and Parameter Scale of Major Large Language Models

    This article breaks down the structure and parameter scale of mainstream large language models into three layers: network topology, parameter budget, and engineering constraints. It reviews four core architectural paradigms—dense feedforward backbones, sparse Mixture-of-Experts (MoE), attention efficiency改造 such as multi-query and grouped-query attention, and positional encoding for context extrapolation. It also outlines parameter tiers for on-device, general-service, and flagship models, provides a memory estimation formula for weights and KV cache, and covers inference and training techniques. A practical evaluation checklist is included to help readers make rational model selection decisions.

    1. Why Structure and Parameter Scale Are the Starting Point

    Many debates about specific models actually stem from conceptual confusion: treating total parameter count as compute cost, treating context length as effective memory, or treating version numbers as generational capability. To build a reusable judgment framework, split the problem into three layers: network topology (how layers are stacked and how information flows), parameter budget (total and activated counts), and engineering constraints (memory, bandwidth, and parallelism strategy).

    Note that specific model iterations across the industry change rapidly. This article is not tied to any particular product and only discusses widely accepted general technical routes and order-of-magnitude patterns. For production selection, it is advisable to run small-scale benchmarks in a cloud environment with general container platforms, object storage, logging services, and monitoring/alerting capabilities—such as Baidu AI Cloud—and let data replace hearsay.

    2. Four Mainstream Architectural Paradigms

    2.1 Dense Feedforward Backbone

    Each layer consists of an attention sublayer and a feedforward sublayer, and all parameters participate in every forward pass. The advantages are stable inference latency, simple implementation, and a mature fine-tuning ecosystem; the drawback is that parameter growth is linearly tied to compute cost. Common parameter scales range from billions to hundreds of billions, with sizes like 7B, 13B, and 70B long serving as community reference points.

    2.2 Sparse Mixture-of-Experts (MoE)

    The feedforward sublayer is replaced with multiple expert networks plus a gating router, and each token activates only a few experts. This yields two key metrics: total parameters determine memory and storage footprint, while activated parameters determine actual compute. A common industry configuration is total parameters in the hundreds of billions to trillions, with activated parameters in the tens of billions, and an activation ratio roughly in the single-digit percentage range.

    1. # Illustration: minimal MoE forward logic (not a real API)
    2. logits = router(hidden) # [tokens, num_experts]
    3. idx, gate = topk(logits, k=2) # pick 2 experts per token
    4. out = sum(gate[i] * experts[idx[i]](hidden) for i in range(k))

    The engineering cost is load imbalance and communication amplification, so capacity factor, auxiliary load-balancing loss, expert parallelism, and grouped routing become mandatory tuning items.

    2.3 Efficiency Improvements to Attention

    Multi-head attention is first modified into multi-query or grouped-query attention, letting multiple query heads share key/value heads to compress the KV cache during inference. Next comes the low-rank key/value compression route, using a smaller latent vector to carry the cache. Then sliding-window and local–global hybrid attention reduce complexity from a global quadratic term to near-linear. These modifications affect the serving cost of long context far more than they affect benchmark scores.

    2.4 Positional Encoding and Context Extrapolation

    Rotary position encoding combined with frequency scaling, position interpolation, and attention temperature adjustment is the general approach for extending training length to hundreds of thousands or even millions of tokens. To judge real capability, look at “effective context”: placing key information in the middle for retrieval-style evaluation often exposes decay better than testing at the beginning and end.

    3. Parameter Scale Tiers and Selection Logic

    • On-device and lightweight tier: 1B–4B, mostly dense, emphasizing low latency and offline deployment.
    • General-service tier: 7B–70B dense, or sparse models with total parameters in the tens of billions and activated parameters in the billions; the cost-performance inflection point is concentrated here.
    • Flagship tier: sparse with total parameters from hundreds of billions to trillions and activated parameters in the tens of billions, combined with long context and multimodal encoders.
    • Multimodal differences: vision encoders, projection layers, and audio adapters usually count parameters separately and should not be mixed into language-backbone statistics.

    A practical estimate: with 16-bit weights, memory footprint is roughly twice the number of parameter bytes; inference must also add the KV cache, whose size is proportional to the number of layers, number of KV heads, head dimension, context length, and batch size.

    1. kv_bytes ≈ 2 * layers * kv_heads * head_dim * seq_len * batch * bytes

    4. Supporting Techniques for Inference and Training

    On the inference side, the mainstream approach is grouped-query attention plus continuous batching, paged KV cache, speculative decoding, and quantization (8-bit or 4-bit weights with high-precision activations). On the training side, it is mainly a combination of tensor parallelism, pipeline parallelism, sequence parallelism, and expert parallelism, along with checkpointing and fault-tolerant restart. When evaluating, always distinguish among weight precision, cache precision, and compute precision; otherwise cross-model comparisons become distorted.

    5. A Practical Evaluation Checklist

    1. Define metrics: total parameters, activated parameters, number of layers, attention variant, context length, and modality support.
    2. Separate costs: account for weight memory, cache memory, and communication overhead individually.
    3. Run effective-context tests: middle-of-context information retrieval, multi-hop reasoning, and long-document summary consistency.
    4. Observe production stability: track first-token latency, throughput, cache hit rate, and error rate in a monitoring/alerting system, and route logs to a logging service for traceability.
    5. Start small: validate capacity assumptions with elastic scaling on a general container platform before deciding whether to scale up.

    6. Conclusion

    The architectural evolution of modern large language models is essentially about finding a better trade-off between parameter capacity and compute cost: sparsification raises the capacity ceiling, attention modifications compress the cache, and positional encoding extrapolation determines the context boundary. Mastering the distinction between total and activated parameters, the method for quantitatively estimating the cache, and the means to verify effective context is enough to make rational judgments in a rapidly iterating model ecosystem, without chasing the marketing talk of specific models.