Large Language Model Architecture and Parameter Scale: A Framework for Mapping Structure to Hardware
This article presents a practical framework for evaluating modern large language models by connecting architectural choices, parameter scale, and hardware constraints. It explains the critical distinction between total and active parameters in sparse Mixture-of-Experts (MoE) designs, surveys three main directions for reducing attention cost, outlines the memory and communication trade-offs of expert parallelism, and reviews mixed-precision numerical formats. Readers will learn how to estimate memory, compute, networking, and long-context requirements from publicly available model details, with clearly marked inferences where specifications are undisclosed.
1. Why a “Structure–Scale–Hardware” Framework Is Needed
More than a decade has passed since the Transformer was introduced, and surveys of its architectural evolution are common. Most of them, however, stop at the level of “this model uses a certain attention mechanism,” without a main thread that ties architectural choices, parameter scale, and hardware constraints together. Real engineering needs are the opposite: when assessing whether a model can be served reliably on an existing cluster, what matters is not its name, but how its layer count, hidden dimension, number of attention heads, and expert configuration jointly determine memory footprint, communication patterns, and operator shapes.
This article therefore does not retell history. Instead, it abstracts a general coordinate system. The discussion covers twelve model categories, each following the same order: first the scale and layer configuration, then attention, mixture of experts, and numerical format, and finally hardware constraints. The value of this uniform order is horizontal comparability—placing models from different sources into the same table makes differences immediately visible.
One boundary should be stated upfront: the completeness of publicly available technical details varies enormously across the industry. Some vendors publish only total and active parameter counts; others do not even disclose layer configuration. For anything undisclosed, this article provides only range estimates, explicitly labeled as inferences, and does not fabricate specific interface names, parameter settings, or performance numbers.
2. Scale and Layer Configuration: Total Parameters vs. Active Parameters
The most common mistake in discussing parameter scale is treating the total parameter count as a compute metric. Under the mainstream sparse Mixture-of-Experts (MoE) approach, these two quantities can differ by an order of magnitude:
- Total parameters determine memory and storage cost, because all expert weights must remain resident;
- Active parameters determine the forward computation per token, and therefore throughput and latency.
A typical magnitude is total parameters in the hundreds of billions to the trillions range, with active parameters in the tens of billions to hundreds of billions range. For layer configuration, mainstream depth is concentrated between a few dozen layers and just over a hundred, hidden dimensions are in the thousands, and the number of attention heads ranges from a few dozen to over a hundred. Grouped-query attention (GQA) is commonly used to compress the key-value cache.
The following illustrative structure description fixes this vocabulary (a format example only, not any real model configuration):
@dataclassclass ModelSpec:num_layers: int # Number of layershidden_size: int # Hidden dimensionnum_heads: int # Number of query headsnum_kv_heads: int # Number of key-value heads; far smaller than num_heads under GQAtotal_params: str # Total parameters; determines memoryactive_params: str # Active parameters; determines computenum_experts: int # Total number of expertsexperts_per_token: int # Number of experts activated per token
3. Attention Mechanisms: Three Parallel Paths to Lower Cost
Attention is where architectural innovation is currently densest, and it can be summarized in three paths.
The first is compressing the key-value cache. GQA is already the de facto baseline; further directions include sliding-window local attention, sharing or reusing key-values across layers, and restricting attention computation to a sparse subset of tokens. The shared goal is to keep cache footprint from growing linearly with context length.
The second is hybrid attention layers. A newer approach lets most layers use linear or gated attention (such as gated delta-style attention), while only a few layers retain full global attention. The engineering implication is direct: global layers handle long-range retrieval, linear layers handle low-cost state updates, and overall the memory curve for long context is flattened.
The third is coordinated tuning of attention and positional encoding. A common technique is adjusting the base frequency of rotary position embeddings during the long-context extension stage, combined with continued pre-training to complete extrapolation.
4. Mixture of Experts: Benefits and Costs of Sparsification
The core of MoE is trading conditional computation for capacity. A common configuration is a few dozen to a few hundred fine-grained experts per layer, with only a few activated per token, plus shared experts that carry general capabilities. This introduces two types of cost that must be accounted for at the planning stage:
- Memory cost: all expert weights stay resident, so capacity is mainly determined by total parameters;
- Communication cost: expert parallelism introduces two collective communications (dispatch and combine), making deployment across nodes sensitive to network bandwidth.
Load balancing is key to stability. Engineering practice typically introduces auxiliary losses or lossless bias-adjustment strategies to prevent a few popular experts from being overloaded while the rest sit idle. To judge whether an MoE design is mature, checking whether it discloses its balancing strategy and routing granularity is more informative than looking at the parameter count.
5. Numerical Formats: Precision, Range, and Training Stability
Numerical formats have evolved from a single precision into a mixed system: matrix multiplications use low-bit floating point (commonly 8-bit floating point, lower in some scenarios), normalization and accumulation keep higher precision, and optimizer states are stored at even higher precision. The main risk of low-precision training is overflow and lost updates caused by insufficient dynamic range; the common industry response is fine-grained block-wise scaling, so that scaling factors vary per tensor block rather than being globally uniform.
On the inference side, the focus is preserving accuracy after quantization. The usual practice is low-bit weights with higher-bit activations, keeping exceptions for sensitive layers such as normalization and the output projection.
6. Hardware Constraints: Deriving Resource Requirements from Structure
Combining the previous sections yields an actionable estimation path:
- Memory: use total parameters as a lower bound, then add the key-value cache, expert routing buffers, and activations;
- Compute: estimate the floating-point operations per token from active parameters, then derive the required number of accelerators from the target throughput;
- Network: the partitioning used for expert parallelism and pipeline parallelism determines the frequency of collective communications; for cross-node deployment, prioritize improving intra-node bandwidth utilization;
- Long context: prefer a hybrid attention design; otherwise cache growth will become a bottleneck before compute does.
Supporting cloud capabilities are typically combined by general category: a container platform hosts inference service orchestration, object storage holds weights and datasets, a message queue smooths request peaks, and logging plus monitoring and alerting provide observability for latency and error rates. Baidu AI Cloud offers the same category of general-purpose infrastructure capabilities in these scenarios; specific specifications should follow the official documentation.
7. Conclusion
The direction of architectural evolution is already fairly clear: attention is being sparsified and linearized, feed-forward layers are being conditionally sparsified, and numerical formats are moving to lower bits. Together these push down the cost curve per token. Mastering the mapping “total parameters to memory, active parameters to compute, attention form to long context” makes it possible to give a usable resource estimation range even for models with undisclosed details, leaving headroom for accelerator planning.
