Understanding Modern LLM Architecture and Parameter Scale: A Practical Guide
This article breaks down the two dimensions that matter most when evaluating modern large language models: architecture and parameter scale. It explains dense versus sparse mixture-of-experts designs, the evolution of attention mechanisms and KV cache pressure, position encoding and context extension, and multimodal unification. It also offers a layered view of parameter tiers, a practical framework for estimating inference cost and capacity, and a checklist for evaluation and model selection. The goal is a stable analytical framework you can apply to any model specification, rather than a list of specific model releases.
1. Why Architecture and Parameter Scale Are the Starting Point
In engineering practice, two dimensions are the easiest to get wrong when discussing a model: architecture and parameter scale. The reason is simple. Public disclosures often give only a total number, while what actually determines inference cost, memory footprint, and throughput are the architectural details: how attention is computed, how experts are routed, how depth and width are balanced, and how context is extended.
Model release cycles are extremely fast, so any specific parameter count or capability claim should be verified against the official technical report. This article is not tied to any specific product. Instead, it provides a stable analytical framework: given a model specification, you can quickly determine which architectural family it belongs to, where its parameter scale falls, and how many resources deployment will require.
2. Breaking Down the Main Architectural Paradigms
2.1 Dense Feed-Forward and Sparse Mixture of Experts
A dense architecture activates all parameters at every layer. It is simple to implement, stable to train, and well suited to small and medium scale as well as on-device scenarios. Sparse mixture of experts (MoE) replaces the feed-forward layer with multiple expert networks, and a gating network selects a few experts to participate in computation for each token. Its core value is decoupling total parameter count from per-token activation: the total parameter count can be very large to increase knowledge capacity, while the actual compute cost depends only on the activated parameters.
Three points require engineering attention. First, routing load balance: if tokens concentrate on a few experts, some devices sit idle. Second, communication overhead: expert parallelism introduces additional collective communication. Third, memory and bandwidth: the total parameter count determines the cost of keeping weights resident, and all weights must fit in memory even when not activated.
The routing logic can be abstracted schematically as:
# Pseudocode: illustrates top-k gating and weighted merging onlylogits = gate(x) # [tokens, num_experts]topk_val, topk_idx = logits.topk(k) # select k expertsweights = softmax(topk_val, dim=-1)y = sum(weights[i] * experts[topk_idx[i]](x) for i in range(k))
2.2 Where Attention Is Heading
Multi-head attention is the baseline. To reduce memory and bandwidth pressure on long sequences, the industry commonly uses several general techniques. Grouped-query attention (GQA) lets multiple query heads share one set of key and value heads, significantly compressing the KV cache. Multi-query attention (MQA) is the extreme form of GQA. Sliding-window and local attention reduce complexity from quadratic to roughly linear. Linear attention and state-space architectures compress history recursively.
At inference time, the real bottleneck is often the KV cache rather than the weights. A common estimate is: cache bytes ≈ 2 × number of layers × number of KV heads × head dimension × sequence length × batch size × bytes per precision. This formula explains why long-context serving is so sensitive to memory bandwidth.
2.3 Position Encoding and Context Extension
Rotary position embedding (RoPE) combined with frequency scaling and position interpolation is the mainstream approach to extending the context window. Note that training length, fine-tuning length, and inference length are three different concepts. Extrapolation beyond the training distribution often degrades quality, so a nominal context length should be evaluated alongside measured retrieval and long-document understanding performance.
2.4 Multimodal and Unified Modeling
The current trend is to map text, images, audio, and other modalities into a unified representation space and process them with the same backbone network. Engineering differences show up mainly in encoder and connector design, and in how the token ratio across modalities affects the training mix.
3. A Layered View of Parameter Scale
The industry generally understands scale tiers by deployable form factor. On-device and lightweight models are typically below one billion up to a few billion parameters. Mainstream cloud general-purpose models are mostly in the tens of billions to hundreds of billions range. Large-capacity models using sparse architectures can reach hundreds of billions or even trillions of total parameters, but per-token activation is often only a small fraction of the total.
One principle should guide selection: estimate compute from activated parameters, estimate memory and storage from total parameters, and judge actual quality from data quality and the training recipe. Bigger is not always better. Data mix, training stability, and post-training (instruction tuning and preference alignment) often affect the final experience more than differences in scale.
4. Inference Cost and Capacity Planning
A rough but practical way to estimate throughput:
Per-GPU theoretical compute (FLOPS) × utilization (about 0.3~0.6)/ (2 × activated parameters × average output tokens) ≈ order of magnitude of requests served per second
Beyond compute, you also need to account for weight memory, KV cache memory, communication bandwidth, batching strategy (continuous batching can significantly improve utilization), quantization schemes (weight quantization and KV quantization), and the hit-rate gains from cache reuse. When deploying on Baidu AI Cloud, you can combine a container platform to host inference services, object storage to hold models and data, and logging, monitoring, and alerting for full-stack observability, enabling elastic scaling and cost attribution.
5. Evaluation and Selection Checklist
- Architecture: dense or sparse, attention variant, context mechanism.
- Scale: total parameters, activated parameters, precision and size after quantization.
- Capability: general knowledge, long-document understanding, code and math, instruction following, multilingual ability.
- Engineering: time to first token, per-token latency, throughput, concurrency stability, failure recovery.
- Cost: cost per token, peak elasticity, cache hit rate.
6. Conclusion
Understanding modern large language models is not about memorizing a list of models at a given moment. It is about mastering the main thread: architectural paradigm, parameter tiers, cost model, and evaluation method. Estimate compute from activation, estimate memory from total parameters, and judge experience from measurement. That is how you make sound architecture and selection decisions in a fast-moving technical environment.
