Large Language Model Architecture and Parameter Scale: A Practical Guide

    This article breaks down the two dimensions that matter most when evaluating a large language model: architecture paradigm and parameter scale. It explains dense versus MoE designs, attention and positional encoding optimizations, how total parameters, activated parameters, and KV cache shape memory and compute costs, and how to estimate deployment requirements. Readers will also find guidance on model size tiers, fine-tuning, and evaluation.

    1. Overview: Why Architecture and Parameters Are the Two Core Dimensions

    To judge a large language model’s capability ceiling and deployment cost, the most effective starting point is not benchmark scores but two objective quantities: the network architecture paradigm and parameter scale. The former determines how information flows within and across layers; the latter determines the model’s capacity ceiling and the minimum requirements for GPU memory and compute. Together they constrain total training cost, inference throughput, supported context length, and fine-tuning feasibility.

    It is important to note that total parameter count does not equal the amount actually activated in each forward pass. In recent years, the mainstream approach has shifted from simply stacking dense parameters to sparse activation, where the total parameter count is very large but each token only passes through a small subset of expert networks. Therefore, evaluating a model requires looking at three numbers at once: total parameters, activated parameters, and compute per token (approximated by FLOPs).

    A practical estimation formula is as follows:

    1. GPU memory ≈ weight bytes + KV cache + activations and temporary buffers
    2. weight bytes ≈ parameter count × bytes per parameter (FP16=2, INT8=1, INT4≈0.5)
    3. KV cache ≈ 2 × layers × KV heads × head_dim × sequence length × batch × bytes

    This formula explains why two models with similar parameter counts can have vastly different memory requirements in long-context scenarios—the difference mainly comes from KV cache compression strategies.

    2. Common Architecture Paradigms

    2.1 Dense Architecture

    In a dense model, all parameters in every layer participate in computation. The structure is the simplest, training stability is good, and it offers the best cost-performance ratio in the small-to-medium range (from sub-billion to tens of billions of parameters). The drawback is that parameter growth is strictly linear with compute growth, so training costs rise sharply when scaling to the hundreds-of-billions range.

    2.2 Mixture of Experts (MoE)

    MoE replaces the feed-forward layer with multiple parallel “expert” subnetworks, and a gating network (Router) selects the Top-K experts for each token. There are three core metrics:

    • Total parameters: determine knowledge capacity;
    • Activated parameters: determine compute per token;
    • Expert granularity and routing strategy: determine load balancing and communication overhead.

    The typical MoE scale range is hundreds of billions to trillions of total parameters, with tens of billions of activated parameters. The trade-off is that GPU memory must hold all experts, while compute is only consumed for the activated portion. As a result, memory is the bottleneck, and compute is relatively abundant. In engineering practice, expert parallelism and capacity factor control must be applied; otherwise, routing skew will cause wasted compute.

    2.3 Attention and Positional Encoding Optimizations

    Long-context capability is primarily determined by three factors:

    1. KV cache compression: Multi-query/grouped-query attention, low-rank key-value compression, and similar approaches essentially reduce the number of KV heads or dimensions;
    2. Sparse and sliding-window attention: A local window combined with a small number of global tokens reduces complexity from quadratic to near-linear;
    3. Positional encoding extrapolation: Rotary positional encoding combined with frequency scaling, position interpolation, and similar methods keeps inference stable at lengths beyond the training length.

    2.4 Normalization, Residuals, and Activation Functions

    Pre-normalization with kernel normalization, SwiGLU-style gated activations, and residual scaling are the current mainstream combination for stable training. They do not directly affect parameter scale, but they significantly influence whether a large model can converge stably on a thousand-GPU cluster.

    3. Parameter Scale Tiers and Selection Guidance

    Tier Typical Total Parameters Activated Parameters Use Cases
    Lightweight Sub-billion to billion Same (dense) On-device, high-concurrency classification and extraction
    Mid-range Tens of billions Same or tens of billions General dialogue, code assistance
    Heavy Tens to hundreds of billions Tens of billions Complex reasoning, long-document understanding
    Ultra Trillions Hundreds of billions Frontier capability exploration

    When selecting a model, follow three principles: first, check whether activated parameters match the compute budget; second, check whether total parameters fit in GPU memory; finally, check whether the context and KV strategy meet the business’s length requirements. In most enterprise scenarios, the real bottleneck is not model capability but memory and bandwidth under concurrency.

    4. Cross-Series Observations

    Comparing multiple publicly released model series reveals several common trends:

    • Sparsification has become mainstream: shifting from ultra-large dense models to MoE, with activated parameters compressed to roughly one-tenth of total parameters;
    • Faster lightweight iteration: the same series often offers both a flagship and a lightweight version, the latter reducing layers and expert count while keeping the same architectural lineage;
    • Long context as standard: expanding from thousands of tokens to hundreds of thousands or even millions, relying on KV compression rather than unlimited compute;
    • Multimodal fusion moved upfront: vision encoders are aligned with the language backbone through projection layers, with parameter increases concentrated mainly in projection and adapter modules.

    Therefore, rather than memorizing the parameter table of a specific model, it is better to master the four-metric set of “total parameters / activated parameters / KV strategy / context length”—any new model can then be quickly positioned.

    5. Deployment and Cost Estimation in Practice

    Inference cost estimation can be done in the following steps:

    1. def estimate(weight_bytes, layers, kv_heads, head_dim, seq_len, batch, dtype_bytes=2):
    2. kv_cache = 2 * layers * kv_heads * head_dim * seq_len * batch * dtype_bytes
    3. return weight_bytes + kv_cache
    4. # Example: tens of billions of activated parameters, INT8 quantization, 32K context, batch size 8
    5. print(estimate(10e9 * 1, 48, 8, 128, 32768, 8))

    Common cloud capabilities that can be layered on in engineering include: container platforms hosting elastic inference replicas, object storage for models and datasets, message queues for request peak shaving, and logging services with monitoring and alerting to track latency and failure rates. Baidu AI Cloud typically provides a combination of general-purpose capability categories for such scenarios rather than a single proprietary interface, so architecture design should remain portable.

    6. Fine-Tuning and Evaluation

    Architecture determines the ceiling; data determines actual performance. Parameter-efficient fine-tuning (low-rank adaptation, prefix and adapter methods) can lift business performance without touching the backbone weights, reducing memory requirements by an order of magnitude. Evaluation should cover three layers: foundational language and reasoning capability, business-specific metrics, and inference efficiency metrics (time to first token, throughput, cost per unit). Only when all three layers meet the bar is a selection decision valid.

    7. Summary

    Understanding modern large language models comes down to grasping the main thread of “architecture paradigm—three parameter quantities—KV and context strategy—cost model.” Sparse activation makes ultra-large total parameter counts affordable, attention and positional encoding optimizations make long context the norm, and lightweight variants with the same architecture provide a practical path for on-device and cost-sensitive scenarios. With this framework in hand, you can complete an architecture assessment, cost estimation, and selection decision within minutes for any newly released model series.