Understanding Modern LLM Architectures and Parameter Scale: A Practical Guide
This article breaks down how modern large language model architecture, parameter count, and resource demand form a single connected chain, and why treating them separately leads to wrong capacity and performance assumptions. It covers the main structural paradigms (dense feed-forward backbones, sparse mixture-of-experts, attention efficiency modifications, and normalization and activation choices), explains the difference between total and activated parameters, outlines the common parameter-scale tiers and what each implies for deployment, and provides practical formulas for estimating inference memory. It closes with selection advice and common pitfalls to avoid.
1. Why You Need a Unified View of Structure and Scale
When developers evaluate a specific model, three questions come up most often: what architecture it uses, how many parameters it has, and how much resource it takes to run. These three questions are really one chain. Architecture determines how parameters are organized, parameter scale determines memory and bandwidth requirements, and bandwidth in turn determines actual throughput. Treating them as separate issues easily leads to misjudgments such as “the parameter count is small but inference is slow” or “there is enough memory but throughput will not go up.”
One general definition is needed first. Parameter count refers to the total number of elements in the model’s trainable tensors, usually expressed in B (billions). Activated parameters refer to the number of parameters that actually take part in computation during a single forward pass. Under a dense architecture the two are equal; under a sparse architecture the activated parameters are far smaller than the total. This distinction is the basis for everything discussed below.
2. Breaking Down the Mainstream Architectural Paradigms
2.1 Dense Feed-Forward Backbone
The most classic form is a stack of Transformer decoder layers, where each layer contains normalization, self-attention, and a feed-forward network, together with residual connections. The feed-forward layer typically expands the dimension and then reduces it again, with the intermediate dimension kept at a fixed ratio to the hidden dimension. This ratio directly affects how parameters are distributed: in most implementations, the feed-forward part accounts for more than sixty percent of total parameters.
2.2 Sparse Mixture of Experts
A sparse architecture replaces the feed-forward layer with multiple parallel “expert” subnetworks, and a gating network selects a few experts to participate in computation for each token. The key benefit is decoupling total parameters from compute: total parameters can grow several times over while activated parameters stay manageable. The engineering cost is that memory usage scales with total parameters, and expert parallelism introduces all-to-all communication across devices, which is sensitive to network topology.
# Illustration: core logic of sparse gating (pseudocode)logits = router(hidden_states) # [tokens, num_experts]topk_idx = topk(logits, k=2).indices # pick 2 experts per tokenout = zeros_like(hidden_states)for e in unique(topk_idx):mask = (topk_idx == e).any(dim=-1)out[mask] += expert_e(hidden_states[mask]) * gate_weight[mask, e]
2.3 Efficiency Modifications to Attention
The demand for long context has driven three common modifications. The first is position-encoding extrapolation, which makes inference beyond the training length possible by adjusting the base frequency of rotary position embeddings or introducing interpolation. The second is shared key-value projection, which lets multiple query heads reuse the same set of keys and values and significantly reduces cache usage during inference. The third is sparse or block attention, which controls complexity by combining a local window with a small number of global tokens.
2.4 Normalization and Activation Details
Changing where normalization sits (pre-norm or post-norm) affects training stability. Gated activation functions replace a single nonlinearity with an element-wise product and usually perform better under the same parameter budget. These details do not change the order of magnitude of the parameter count, yet they are often the source of differences when reproducing results.
3. Parameter-Scale Tiers and What They Mean
The industry usually divides scale into several tiers, each corresponding to different capability boundaries and deployment approaches:
- Below one billion: suited to on-device or high-concurrency short-request scenarios, with emphasis on time to first token;
- One to ten billion: can be hosted on a single or dual GPU, the main range for general business use;
- Ten to one hundred billion dense: requires multi-GPU tensor parallelism, where memory and inter-GPU interconnect become the bottleneck;
- Above one hundred billion sparse: large total parameters but moderate activated parameters, suited to scenarios with high quality requirements and cluster-level resources.
It is worth stressing that scale and quality are not strictly linear. Data quality, number of training epochs, and post-training strategy often introduce greater variance. Equating “more parameters” directly with “better quality” is therefore not rigorous.
4. Actionable Formulas for Resource Estimation
Inference memory can be roughly split into three parts: weights, cache, and activations plus framework overhead. Weights are converted by precision, with half precision at roughly the parameter count multiplied by 2 bytes. Cache is proportional to sequence length, number of layers, and number of key-value heads.
Weight memory ≈ total parameters × bytes per parameterCache memory ≈ 2 × num_layers × sequence_length × kv_dim × batch_size × bytesAvailable batch ≈ (memory limit - weights - framework reserve) / cache per request
On the training side, the main tools are activation recomputation, mixed precision, and parallel splitting (data, tensor, pipeline). A practical rule is to first check whether the weights fit in memory, then see how much concurrency the cache can support, and only then discuss throughput optimization.
5. Selection and Implementation Advice
- Define latency and cost constraints first, then choose a scale tier, rather than reasoning backwards;
- For long-context scenarios, evaluate position-encoding extrapolation and key-value sharing first instead of simply adding parameters;
- For high-concurrency scenarios, consider cache hit rate and batching strategy before model architecture;
- If you adopt a sparse architecture, verify interconnect bandwidth and the expert-parallel strategy in advance;
- When deploying on platforms such as Baidu AI Cloud, general capabilities like container platforms, object storage, log services, and monitoring and alerting can be combined to build elastic scaling and observability.
6. Common Pitfalls
The first is estimating memory from activated parameters as if they were total parameters. The second is ignoring the framework’s own overhead, which makes capacity planning too tight. The third is inferring long-context behavior from short-sequence evaluation results. The fourth is assuming a sparse architecture is necessarily faster while overlooking jitter caused by communication and load imbalance. Avoiding these pitfalls improves real-world returns more than chasing a single metric.
