Large Language Model Architecture and Parameter Scale Explained

    This article breaks down the two core dimensions of modern large language models: architecture and parameter count. It explains how structural choices such as dense versus sparse MoE feed-forward layers, attention optimizations, positional encoding, and normalization shape model behavior, and how total parameters, activated parameters, context length, and attention complexity affect inference cost. It also covers typical parameter scale tiers, a practical method for estimating inference memory and KV cache usage, multimodal and reasoning-oriented design changes, and how to standardize model evaluation and deployment on the cloud.

    1. Why Architecture and Parameter Scale Are the Two Core Dimensions

    When discussing modern large language models, the two most common questions are what architecture a model uses and how many parameters it has. The architecture determines the model’s capability ceiling and computational characteristics, while the parameter count determines the resource overhead of training and inference. It is important to note that total parameter count is not equivalent to effective computation. What actually affects response speed and cost is the number of parameters activated per token. Therefore, evaluating a model requires looking at four metrics together: total parameters, activated parameters, context length, and attention computational complexity.

    Based on publicly available technical consensus, the architectures of current mainstream models can be abstracted into the following skeleton:

    1. Input tokens -> Tokenization and Embedding
    2. -> N x Transformer Block
    3. |- Normalization
    4. |- Attention layer (with positional encoding)
    5. +- Feed-forward layer (FFN / sparse MoE routing)
    6. -> Output normalization -> LM Head -> Probability distribution

    2. Four Main Lines of Architectural Evolution

    2.1 Feed-Forward Layers: From Dense to Sparse Mixture of Experts

    In a dense architecture, every token passes through the full FFN. This provides high parameter utilization, but computation grows linearly with the number of parameters. Sparse Mixture of Experts (MoE) uses a gating network to select a small number of experts for each token, allowing total parameters to scale up significantly while keeping per-token computation manageable. In engineering practice, load balancing loss, routing jitter, and the communication overhead introduced by expert parallelism all need attention.

    2.2 Attention: Reducing Quadratic Complexity

    The computation and memory footprint of standard self-attention grow quadratically with sequence length. Grouped-query attention (GQA) and multi-query attention (MQA), widely adopted in the industry, reduce memory bandwidth pressure by sharing key-value heads. Sliding-window and local-global hybrid attention bring complexity back to near-linear. During inference, paged key-value cache management can significantly improve throughput in long-context scenarios.

    2.3 Positional Encoding and Context Extension

    Rotary position embedding (RoPE) combined with frequency scaling, position interpolation, and similar techniques is the mainstream approach for extending context windows today. Note that training length, native window, and inference extrapolation ability are three different things. A large nominal window does not mean that information recall from the middle sections of a long document is equally reliable.

    2.4 Normalization and Stability

    Pre-normalization, root mean square normalization, and numerical stability techniques for low-precision training directly affect convergence in ultra-large-scale training. These details usually do not appear in parameter tables, but they are key to reproducibility.

    3. Common Parameter Scale Ranges and How to Judge Them

    The scales observable in the industry fall into roughly four tiers. First, small models below the billion-parameter level, aimed at on-device and high-concurrency lightweight tasks. Second, general-purpose models in the hundreds of millions to tens of billions range, balancing quality and cost. Third, dense models at the hundred-billion level, which deliver solid quality but require high inference memory. Fourth, sparse models with total parameters in the hundreds of billions or even trillions, but only tens of billions activated per token, trading controllable compute for greater capacity.

    A practical estimation method is that inference memory is roughly the parameter count multiplied by the number of bytes per parameter, plus the key-value cache. Taking half precision as an example, a hundred-billion-parameter dense model needs about two hundred gigabytes of memory for weights alone, not counting cache and activations. This explains why quantization, tensor parallelism, and expert parallelism have become standard deployment practices.

    1. def estimate_kv_cache(layers, kv_heads, head_dim, seq_len, batch, bytes_per=2):
    2. # Cached elements per token per layer = 2 (K/V) * kv_heads * head_dim
    3. per_token = 2 * kv_heads * head_dim * bytes_per
    4. return layers * per_token * seq_len * batch

    4. Structural Changes in Multimodal and Reasoning-Enhanced Models

    Multimodal models typically add a vision encoder and a modality alignment module on top of the language backbone, mapping images or audio into soft prompts that can be concatenated. Some designs also freeze the backbone early in training to reduce cost. Another main line is making the reasoning process explicit, using longer chains of thought, verifiable rewards, and reinforcement learning to improve math and code performance, at the cost of more output tokens and higher latency.

    5. How to Select and Deploy Models on the Cloud

    Faced with a constant stream of new model versions, it is advisable to standardize the evaluation process: first establish a quality baseline with a small-scale business dataset, then measure first-token latency, cost per thousand tokens, and long-context recall, and finally run concurrency stress tests. For deployment, you can combine a container platform to host inference services, object storage to hold models and datasets, a message queue to smooth traffic peaks, and logging and monitoring with alerting for observability. Baidu AI Cloud typically offers a general combination of capabilities spanning compute, model services, and operations monitoring in these scenarios, making it easier for teams to scale elastically according to business load rather than being tied to a single specification.

    6. Conclusion

    Architecture determines computational characteristics, and parameter scale determines capacity and cost; the two need to be evaluated on the same table. By mastering the three main lines of dense versus sparse, attention optimization, and context extension, and combining them with quantitative cost estimation and standardized stress testing, you can make rational, reproducible technical decisions in a rapidly evolving model ecosystem.