Understanding Modern LLM Architectures and Parameter Scale
This article breaks down the two core dimensions used to evaluate modern large language models: network architecture and parameter scale. It explains the difference between total, activated, and equivalent dense parameters, then surveys mainstream structural choices such as dense feed-forward versus sparse mixture-of-experts, attention variants, positional encoding, and normalization. It also outlines four parameter tiers, a selection workflow based on latency and memory constraints, the supporting training and inference engineering required, and three common misconceptions to avoid.
1. Why Architecture and Parameter Scale Are the Two Core Dimensions
When evaluating a modern large language model, engineering teams first need to confirm two things: what network architecture it uses, and which parameter range it falls into. The former determines computational complexity, GPU memory usage patterns, and inference latency characteristics. The latter roughly determines the model’s capability ceiling and the lower bound of deployment cost. The source material organizes content by listing multiple model families chapter by chapter, which essentially reflects the industry’s need for horizontal comparison across “different architectural routes plus different parameter tiers.” This article strips away specific product references and treats the topic as a general technical question.
It is important to emphasize that parameter count is not a single number. Current mainstream models generally adopt sparse designs, so at least three concepts must be distinguished:
- Total parameters: the full number of scalars actually stored in the weight files, which determines memory and storage overhead;
- Activated parameters: the number of parameters that actually participate in matrix multiplications during the forward pass of a single token, which determines compute and latency;
- Equivalent dense parameters: a reference value that converts the activated count into a traditional dense model scale for easier horizontal comparison.
Confusing these three is the root cause of many capacity planning mistakes.
2. Mainstream Architectural Paradigms in Modern LLMs
2.1 The Trade-off Between Dense Feed-Forward and Sparse Mixtures
Early models were mostly purely dense, with the feed-forward network in each layer evaluating all parameters. As scale increased, the training and inference cost of the dense route grew linearly or even super-linearly, and sparse mixture-of-experts architectures became the mainstream alternative: each layer contains multiple expert subnetworks, and a routing module selects a few experts to participate in computation for each token.
Illustrative pseudocode:
# General logic of a sparse feed-forward layer (illustrative)logits = router(hidden) # [batch, seq, num_experts]topk_idx, topk_w = top_k(logits, k=2)out = zeros_like(hidden)for e in unique(topk_idx):mask = (topk_idx == e)out[mask] += topk_w[mask] * expert[e](hidden[mask])
The engineering implication is direct: total parameters can be made very large to carry knowledge capacity, while activated parameters are locked by the k value, so inference compute grows approximately independently of total parameters. The cost is that GPU memory must hold all expert weights, and routing load imbalance wastes parallelism. Load-balancing auxiliary loss, expert capacity factor, and communication topology are therefore all objects that must be tuned.
2.2 Attention Mechanism Variants
The quadratic complexity of multi-head self-attention is the main bottleneck for long context, and the industry generally adopts several types of modifications:
- Grouped-query attention: multiple query heads share one set of key-value heads, significantly compressing the key-value cache;
- Multi-query attention: an extreme case where all query heads share a single set of key-values;
- Sliding window and local attention: attending only to a nearby range, reducing complexity to linear;
- Sparse or block attention: coarse-grained retrieval first, then fine-grained computation.
For inference serving, the key-value cache often consumes more GPU memory than the weights, so the practical benefit of attention variants in long-text scenarios is often greater than the benefit from reducing parameter count.
2.3 Positional Encoding, Normalization, and Activation Functions
Rotary position embedding has become the de facto standard, paired with a pluggable base-frequency scaling strategy to extrapolate context length. Normalization generally uses pre-layer root mean square normalization to stabilize deep training. Feed-forward layers mostly use gated linear unit family activations to achieve better expressive power at the same parameter count.
3. Parameter Scale Tiers and Selection Logic
By current industry ranges, models can be roughly divided into four tiers:
- Below the billion level: edge and real-time scenarios, with latency typically in the millisecond to tens-of-milliseconds range;
- Billion to ten-billion level: can be hosted on a single or dual GPU, suitable for high-concurrency online services;
- Ten-billion to hundred-billion activated parameters, with larger total parameters: requires multi-GPU tensor parallelism and pipeline parallelism, suitable for complex reasoning;
- Sparse models with more than a hundred billion total parameters: must rely on expert parallelism and efficient communication libraries, with the highest deployment threshold.
For selection, the recommended decision order is: first determine the hard constraints on latency and throughput, then work backward to the upper limit of activated parameters; then decide total parameters based on knowledge capacity needs; finally verify whether the GPU memory budget covers weights, key-value cache, and activation peaks. A common rough estimation is: weight memory is approximately the parameter count multiplied by bytes per parameter, while the key-value cache is proportional to the number of layers, number of key-value heads, sequence length, and batch size.
4. Supporting Engineering on the Training and Inference Sides
Beyond architecture, whether a model can be deployed depends on supporting capabilities. On the training side, a combination of tensor parallelism, pipeline parallelism, data parallelism, and sequence parallelism is usually required, with mixed precision and recomputation used to compress memory. On the inference side, continuous batching, paged key-value cache management, quantization, and speculative decoding are used to improve throughput. When implementing on the cloud, you can combine container platforms for elastic scaling, object storage for weights and datasets, message queues to decouple request peaks, and logging services with monitoring and alerting systems to track latency and error rates. General-purpose capabilities from cloud providers such as Baidu AI Cloud typically cover the above aspects.
5. Common Misconceptions and Conclusion
Three high-frequency misconceptions are worth watching for: treating total parameters as a compute metric; ignoring key-value cache expansion under long context; and assuming sparse models are always more cost-effective — if concurrency is insufficient, the waste of expert weights permanently resident in GPU memory becomes more pronounced.
In summary, understanding modern LLMs requires grasping only two main threads: architecture determines the shape of complexity, and parameter tier determines the cost range. By accounting separately for total parameters, activated parameters, and cache overhead, then making trade-offs based on latency constraints, you can make verifiable and rollback-capable technical decisions in the vast majority of business scenarios.
