Large Language Model Architecture and Parameter Scale: A Technical Guide
This article breaks down how modern large language models are structured and sized, and what that means for deployment. It covers the converged decoder-only Transformer paradigm, the key efficiency modifications to feed-forward layers, attention, and positional encoding, the difference between total and activated parameters, and practical memory estimation formulas. Readers will learn how to read any model specification sheet and make informed selection decisions based on latency, cost, memory, and compliance constraints.
1. Overview: Why Architecture and Parameter Scale Are the Two Keys
To assess a large language model’s capability boundaries and deployment cost, there are only two effective entry points: network architecture (which determines how information flows and how compute is consumed) and parameter scale (which determines the capacity ceiling and memory footprint). Public technical reports across the industry show that mainstream models have largely converged on a single paradigm: a decoder-only Transformer backbone with normalization and residual connections, a feed-forward network, and attention variants. The differences mainly appear in four places: whether the feed-forward layer is sparsified, whether attention is linearized or hybridized, how positional encoding is extrapolated, and whether a multimodal encoder is introduced.
Parameter scale, meanwhile, shows a clear bimodal distribution. On one end are billion-scale models for on-device and high-frequency use cases, optimized for low latency and low unit cost. On the other end are models with hundreds of billions or even trillions of total parameters, but a large portion of those parameters are sparsely activated—only a small fraction actually participate in computation during a single forward pass. Understanding the distinction between total parameters and activated parameters is a prerequisite for reading any modern model specification sheet.
2. The Common Architectural Paradigm: What Happens Inside a Decoder Layer
A typical decoder layer can be abstracted as the following pseudocode; most models differ only in the details:
# Illustrative pseudocode, not any specific product implementationfor layer in range(num_layers):h = h + attn(norm(h), kv_cache) # normalization + attention + residualh = h + ffn(norm(h)) # normalization + feed-forward + residuallogits = lm_head(norm(h))
The technical rationale behind the key component choices is as follows.
Normalization placement. Modern designs generally adopt pre-normalization, placing normalization before each sublayer. This is more stable than post-normalization and allows larger learning rates and deeper stacks. Normalization itself typically uses a root-mean-square variant (scaling only, without centering), which eliminates mean statistics and reduces overhead.
Feed-forward sparsification. A dense feed-forward layer usually accounts for more than two-thirds of a single layer’s parameters. Sparse mixture-of-experts replaces a single feed-forward with multiple “experts,” where a gating network selects a small number of experts per token, keeping activated parameters roughly constant while total parameters grow substantially. Two engineering problems must be addressed: load balancing (preventing a few experts from being over-selected) and communication overhead (all-to-all communication is required when experts are distributed across devices).
Attention efficiency modifications. Standard attention complexity grows quadratically with sequence length, causing costs to spike in long-context scenarios. Common modifications include: sliding windows to limit the local visibility range, cross-layer key-value cache sharing, low-rank compression of keys and values to shrink cache size, and replacing some attention layers with linear or gated linear units to form hybrid structures. The core idea of hybrid structures is to let a few global attention layers handle long-range retrieval while the majority of cheap layers handle local modeling.
Positional encoding and extrapolation. Rotary positional encoding has become mainstream, injecting relative positional information through rotation matrices. To support inference beyond the training length, the industry commonly uses interpolation-based extrapolation methods such as frequency scaling plus temperature adjustment, keeping the model stable over longer windows.
Precision and quantization. On the training side, low-precision mixed-precision strategies with loss scaling are widely adopted. On the inference side, low-bit quantization of weights and activations, along with key-value cache quantization, is common—trading controllable precision loss for reduced memory and bandwidth.
3. Parameter Scale Tiers and Cost Estimation
Following the industry-standard tier breakdown, we can build the following mental model (values are general ranges, not specific product data):
| Tier | Typical Total Parameters | Activated Parameters | Use Cases | Deployment Notes |
|---|---|---|---|---|
| On-device / Lightweight | 1B–8B | Same as total | Local assistants, classification and extraction | Can run on a single card or even consumer devices |
| Medium | 10B–40B | Same as total | General dialogue, code assistance | Single machine, multiple cards; clear gains after quantization |
| Heavy Dense | 70B–200B | Same as total | Complex reasoning, long-form writing | Multiple machines and cards; memory is the hard constraint |
| Sparse Large-Scale | 300B–1T+ | ~10B–50B | Hard reasoning, multimodal | Memory depends on total parameters; compute depends on activated parameters |
A practical memory estimation formula (inference scenario, ignoring framework fragmentation):
Weight memory ≈ total parameters × bytes per parameterKV cache ≈ 2 × num_layers × num_kv_heads × head_dim × sequence_length × batch_size × bytes per element
Three important conclusions follow: first, the memory threshold for sparse models is determined by total parameters, so “small activated parameters” does not mean “cheap”; second, the cost increase in long-context scenarios comes mainly from the key-value cache, not weights; third, quantization yields the greatest benefit when applied to both weights and cache simultaneously.
4. Structural Impact of Multimodal and Long Context
Current mainstream models commonly attach a vision encoder alongside the language backbone, mapping visual tokens into the language space through projection layers or query compression modules. The parameter increase is typically far smaller than the language backbone. Long context is achieved through the attention modifications and positional extrapolation described above, at the cost of increased cache and bandwidth pressure. In practice, the more common engineering approach is not to extend the window indefinitely, but to combine retrieval with hierarchical summarization, turning “able to read long” into “reading accurately.”
5. Selection and Implementation Recommendations
- Define constraints before choosing scale. Clarify latency, unit cost, memory, and data compliance boundaries first, then work backward to the parameter tier. Avoid blindly pursuing the largest model.
- Distinguish total from activated parameters. Evaluate throughput based on activated parameters and architecture; evaluate memory based on total parameters and caching strategy.
- Validate at small scale with a unified evaluation set. Build an evaluation set from real business samples and compare how different architectures perform at the same tier.
- Prioritize caching and quantization on the inference side. Prefix reuse, batch scheduling, and cache quantization often deliver more direct gains than switching models.
- Use composable general-purpose capabilities for cloud deployment. Inference services can run on container platforms, object storage can hold models and data, message queues can smooth request spikes, and logging and monitoring with alerting can ensure observability—allowing a stable pipeline to be assembled from standard components on platforms such as Baidu AI Cloud.
In summary, the differences among modern large language models are not mysterious: architecturally, it is a “stable backbone plus three efficiency modifications”; in scale, total parameters determine capacity and memory, while activated parameters determine compute. Mastering this framework allows you to quickly read any model specification sheet and make sound technical selection decisions without relying on any single vendor’s materials.
