Large Language Model Architectures and Parameter Scale Explained
This article breaks down the two foundational factors that shape large language model behavior and deployment cost: network architecture and parameter scale. It clarifies the difference between total and activated parameters, outlines five shared components of modern LLM designs, maps four parameter tiers to their typical use cases, and summarizes common patterns in model series evolution. Readers will also find practical guidance on estimating inference memory, selecting model tiers, and handling quantization, batching, and rollout in production.
1. Why Architecture and Parameter Scale Come First
When evaluating any modern large language model, benchmark scores are not what truly determine its behavior boundaries and deployment cost. Two underlying facts matter more: the network topology (how operators and data flow are organized) and the parameter scale (total weight count and the amount actually activated per forward pass). The former dictates how training and inference are parallelized and sharded, the shape of memory consumption, and the upper limit of long-context capability. The latter determines knowledge capacity, the range in which emergent abilities appear, and the compute cost per token.
One widely confused concept needs clarification first: total parameter count is not the same as activated parameter count. In a dense architecture, the two are equal. In a Mixture-of-Experts (MoE) architecture, the total parameter count can reach hundreds of billions or even trillions, yet each token is routed to only a few experts, so activated parameters typically account for just a single-digit percentage of the total. This explains a common puzzle: why some “trillion-scale” models cost less to run inference on than certain “hundred-billion-scale” dense models.
2. Five Shared Components of Current Mainstream Architectures
Implementation details vary across vendors, but this generation of models has converged structurally. The design can be abstracted into five layers:
- A decoder-only autoregressive backbone. N Transformer blocks are stacked, each consisting of “normalization → attention → residual → normalization → feed-forward network → residual.” Compared with encoder-decoder designs, decoder-only is friendlier to unified training objectives and KV cache reuse during inference.
- The feed-forward form. A dense FFN uses a two-layer MLP with a gated activation (such as a SwiGLU-style gating structure). A sparse FFN replicates a single FFN into multiple “experts,” with a gating network performing Top-K routing, commonly configured from Top-1 to Top-8.
- Efficiency-oriented attention redesign. To reduce the memory and bandwidth pressure of long sequences, the industry commonly adopts multi-head key-value sharing (fewer KV heads), low-rank latent attention (projecting KV into a lower-dimensional latent space and then restoring it), and sparse or sliding-window attention.
- Extrapolation-oriented positional encoding. Rotary positional encoding and its variants—frequency scaling and temperature adjustment—have become mainstream, aiming to preserve usable extrapolation beyond the training context length.
- Training numerical precision and parallelism. BF16/FP16 mixed precision serves as the backbone, with some matrix multiplications using lower-precision accumulation. Across parallelism dimensions, tensor parallelism, pipeline parallelism, sequence/context parallelism, and expert parallelism are typically combined.
Illustrative MoE forward logic (pseudocode, expressing semantics only):
def moe_layer(x, experts, gate, top_k=2):# x: [tokens, hidden]logits = gate(x) # [tokens, num_experts]idx, w = topk_softmax(logits, top_k) # sparse routingy = zeros_like(x)for e_id in unique(idx):mask = (idx == e_id).any(-1)y[mask] += w[mask, e_id] * experts[e_id](x[mask])return y
3. Four Parameter Tiers and Their Use Cases
- Small tier (roughly 1B–8B): Runs on-device or on a single card. Suited to classification, extraction, rewriting, and fixed-template generation, with the lowest latency.
- Mid tier (roughly 10B–40B): Runs on multiple cards in a single machine. The cost-effective range for general dialogue and coding assistance, with low fine-tuning cost.
- Large tier (roughly 100B–400B, mostly MoE): The workhorse for complex reasoning, long-document understanding, and multi-tool coordination.
- Very large tier (500B+, almost all sparse architectures): Frontier capability exploration. Activated parameters remain in the tens of billions, but memory consumption and parallelism complexity rise sharply.
A practical estimation method: inference memory ≈ parameter count × bytes per parameter + KV cache. For a 10-billion-parameter model in BF16, the weights take about 20 GB. The KV cache is approximately 2 × num_layers × num_kv_heads × head_dim × sequence_length × batch_size × bytes, and in long-context scenarios this term often exceeds the weights themselves.
4. Common Patterns in Series-Based Evolution
The source material lists many “series—version—lightweight variant” hierarchies. Behind them lies a highly consistent set of productization patterns across the industry, which can be summarized in four points:
- Mainline version iteration: Minor structural tuning plus data-mix and scale expansion, with capability gains showing up in reasoning depth and instruction-following stability.
- Point-release optimization: Mostly engineering improvements to the training recipe, context length, and tool-call reliability, with little structural change.
- Flash / lightweight branches: Fewer layers or experts and lower activated parameters, trading acceptable quality loss for lower latency and cost.
- Max / Pro branches: Larger activated parameters and inference budgets, targeting high-difficulty tasks.
For selection, a three-axis decision based on “task difficulty × concurrency × cost ceiling” is recommended rather than simply chasing parameter scale. A unified gateway layer can also route across tiers, sending simple requests to lightweight branches.
5. Engineering Implementation Essentials
On cloud platforms such as Baidu AI Cloud, these capabilities are typically offered as general-purpose categories: a container platform hosts inference services and elastic scaling, object storage holds models and datasets, a message queue smooths request spikes, and logging plus monitoring and alerting handle quality and latency observability. In practice, three points deserve attention. First, the precision–cost tradeoff introduced by quantization and distillation must be validated by regression testing on a business evaluation set. Second, batching and KV cache reuse strategies have a decisive impact on throughput. Third, canary releases and shadow-traffic comparison help avoid quality regressions when switching versions.
