LLM Architecture and Parameter Scale: A Complete Overview of Modern Large Language Models
This article provides a systematic overview of modern large language model (LLM) architecture and parameter scale. It explains the autoregressive decoder backbone, attention mechanism variants and their KV-cache costs, dense versus Mixture-of-Experts (MoE) feed-forward designs, and how to interpret total versus activated parameters. It also covers long-context optimization, training and alignment pipelines, and offers practical engineering guidance for model selection, helping readers avoid common misconceptions such as equating total parameter count with model capability.
1. From Model Lists Back to General Technical Questions
The original material was organized as a list of model families and version numbers. However, building an article around specific products easily turns it into a product catalog. A more reasonable approach is to abstract the discussion into a general question: what structures do modern large language models typically consist of? How should parameter scale be understood? What actually changes between versions?
Technically, a modern LLM is not a synonym for a single “network architecture.” It is a combination of model architecture, sparsity strategy, attention optimization, training objectives, alignment pipeline, and inference system. A model’s capability boundary depends not only on parameter count, but also on training data quality, context length, routing strategy, quantization, and deployment method. Therefore, when analyzing model architecture, you should not focus on “total parameters” alone. You should also examine activated parameters, number of layers, hidden dimension, attention head configuration, feed-forward network type, vocabulary size, context window, and inference-time cache overhead.
In practice, common model lineages can be abstracted into several categories: base versions, enhanced versions, lightweight versions, long-context versions, reasoning-enhanced versions, and multimodal extensions. Version iterations do not necessarily change the base architecture; they may focus instead on data mixture, alignment strategy, context extension, tool-calling ability, inference efficiency, and deployment cost. The following sections expand along four main threads: architecture, parameters, optimization, and model selection.
2. The Overall Architecture of Modern LLMs
2.1 The Autoregressive Decoder Is the Mainstream Backbone
Most current mainstream LLMs adopt an autoregressive decoder architecture, consisting of a token embedding layer, a stack of decoder blocks, and an output projection layer. Each decoder block typically contains an attention sub-layer, a feed-forward network sub-layer, residual connections, and normalization layers. After embedding and positional encoding, the input sequence passes through successive layers of contextual modeling, and the output layer predicts the next token.
A single layer can be expressed in simplified form as:
x = x + Attention(Norm(x))x = x + FFN(Norm(x))
The normalization position is commonly Pre-Norm, and the normalization function is typically RMSNorm or LayerNorm. The feed-forward network is usually a two-layer MLP with gated activations such as SwiGLU or GeGLU. Positional encoding commonly uses rotary position embeddings, relative position bias, or learnable position embeddings. This backbone is highly scalable, stable to train, and well suited to large-scale parallelism, which is why it has become the general-purpose foundation architecture.
2.2 Attention Determines Context Modeling and Cache Cost
The attention sub-layer lets each token attend to other tokens in the context. Standard multi-head attention is highly expressive, but at inference time it requires storing a key-value (KV) cache for every sequence, which creates significant memory pressure under long-context and high-concurrency workloads. Modern models therefore often adopt variants such as grouped-query attention, multi-query attention, low-rank compressed attention, sliding-window attention, sparse attention, or blockwise attention.
These optimizations serve two core goals: first, reduce the number of heads and dimensions in the KV cache to lower memory usage; second, eliminate unnecessary attention computation in long sequences. It is important to stress that attention variants are not automatically better just because they are newer — the choice is a trade-off among expressiveness, training stability, inference throughput, and implementation complexity. For high-concurrency short-text scenarios, cache efficiency may matter more than extreme context length; for document analysis, positional extrapolation and the quality of long-sequence training data become more important.
2.3 Feed-Forward Networks and Sparse Mixture of Experts
Feed-forward networks carry a large share of the parameters and nonlinear transformations. In a dense model, every token activates all feed-forward parameters. A sparse Mixture-of-Experts (MoE) model instead splits the feed-forward layer into multiple experts and uses a router to select a small number of experts per token, scaling total parameters while keeping per-token computation under control.
Key MoE metrics include total parameters, activated parameters, number of experts, the number of experts selected per token, the routing load-balancing strategy, and expert-parallel communication overhead. A large total parameter count does not mean every token consumes equivalent compute; what actually drives inference cost is activated parameters, routing overhead, batching efficiency, and communication topology. Engineering must also handle expert load imbalance, capacity factors, training stability, and distributed communication.
2.4 Output Layer and Training Objectives
The output layer typically maps hidden states to vocabulary dimension and applies softmax to produce the next-token distribution. The pre-training objective is usually autoregressive language modeling — predicting the next token given the preceding context. This is followed by stages such as supervised fine-tuning, preference optimization, safety alignment, tool calling, and reasoning enhancement. Architecture determines “what can be learned”; data and alignment determine “how well it is learned and whether the output is usable.”
3. How to Understand Parameter Scale
3.1 Dense Model Parameter Scale
Dense models commonly range from hundreds of millions to tens of billions of parameters. Their defining trait is that every token activates all parameters, the compute path is relatively regular, and deployment and tuning are straightforward. Training compute can be roughly estimated with the common rule of thumb of about six times the parameter count times the number of training tokens; inference weight memory is approximately the parameter count multiplied by bytes per parameter. Actual memory usage must also account for the KV cache, activations, batch overhead, and framework reservations.
Dense models suit scenarios that demand stable latency, simple implementation, and demanding batch scheduling. However, as parameter scale grows, training and inference costs rise in tandem, so production systems often rely on distillation, quantization, pruning, and lightweight variants to meet high-concurrency requirements.
3.2 Sparse MoE Parameter Scale
Sparse MoE models can reach total parameter counts in the hundreds of billions or even trillions, but each token activates only a subset of experts, with activated parameters often in the billions to tens of billions. Here, “total parameters” represent model capacity and knowledge storage potential, while “activated parameters” more closely reflect per-inference compute cost. Both must be reported together, or the numbers can be misleading.
The engineering challenge of MoE lies in routing and parallelism. When experts are distributed across devices, tokens must be sent across devices, and communication can become a bottleneck; imbalanced routing can overload some experts. Load-balancing losses, capacity factors, expert parallelism, and pipeline parallelism are therefore important parts of training and inference system design.
3.3 Balancing Parameters, Data, and Compute
Parameter scale is not the only variable. Training data quality, data mixture, vocabulary design, context length, alignment data, and inference strategy all affect the final result. Scaling laws are commonly used to describe the relationship among parameters, data, and compute, but real-world deployment must also consider inference cost. A sparse model with small activated parameters and efficient routing may be better suited to high-concurrency online services than a dense model with a larger total parameter count.
3.4 The General Evolution Logic of Model Families
From a general perspective, model families typically evolve along four lines: the base-capability line improves pre-training data and architectural efficiency; the enhancement line strengthens reasoning, tool calling, and multimodality; the lightweight line reduces deployment cost through distillation, quantization, and sparsification; and the long-context line extends the window and optimizes cache management. A version bump does not necessarily mean a major architectural change — it may simply reflect upgrades in data, alignment, and the inference system. Model selection should be based on task evaluation and cost testing, not version numbers alone.
4. Long Context and Inference Optimization
The core tension of long context is attention complexity and KV-cache growth. As sequence length increases, standard attention computation grows quadratically, while the KV cache grows linearly with the number of layers, heads, sequence length, and batch size. Common optimizations include grouped-query attention, low-rank compression, sliding-window and sparse attention, chunked prefill, paged cache management, continuous batching, and cache quantization.
KV cache size can be roughly estimated with pseudocode:
kv_bytes = 2 * layers * kv_heads * head_dim* seq_len * batch * bytes_per_element
This formula is only for understanding orders of magnitude; in practice you must also account for alignment padding, framework overhead, and multi-GPU sharding. When deploying, reserve headroom based on maximum context length, concurrency, and precision strategy. Speculative decoding, distillation, and quantization can reduce per-token generation cost, but their impact on output quality needs to be evaluated.
5. Training, Alignment, and Engineering Model Selection
The training pipeline typically includes pre-training, continued pre-training, supervised fine-tuning, preference optimization, and safety alignment. Reasoning-enhanced capability often comes from high-quality reasoning data, tool-calling format training, and evaluation feedback. A model with a large parameter count but insufficient alignment may still be unstable in factuality, instruction following, and safety.
For engineering selection, evaluate across six dimensions: task complexity, latency, throughput, context length, privacy, and cost. For high-concurrency short-text workloads, prioritize lightweight dense models; for complex reasoning and knowledge-intensive tasks, consider enhanced sparse MoE models; for long-document processing, focus on context window and cache efficiency; for private deployments, evaluate post-quantization memory footprint and containerized deployment capability. General-purpose cloud capabilities such as container platforms, object storage, logging, and monitoring — for example, those offered by Baidu AI Cloud — can support elastic deployment and observability, but specific configurations should always be validated through real load testing.
6. Common Misconceptions and Conclusion
Common misconceptions include: equating total parameter count with capability; assuming sparse MoE is always superior to dense models; believing longer context is always better; and assuming a higher version number suits every scenario. A more scientific understanding is this: architecture determines the computation path, parameter scale determines capacity and cost, data and alignment determine usability, and the inference system determines deployment efficiency. The architecture and parameter scale of modern LLMs should be treated as one integrated engineering problem. Model selection should combine task evaluation, memory estimation, and throughput benchmarking — only then can you avoid being misled by any single metric.
