Large Language Model Architecture and Parameter Scale: A Technical Guide
This article breaks down the two core dimensions for understanding modern large language models: architecture and parameter scale. It explains dense and sparse MoE structures, attention and positional encoding optimizations, typical parameter tiers and their deployment implications, a practical evaluation workflow with a rough VRAM estimation snippet, common misconceptions, and key points for deploying LLMs on general-purpose cloud infrastructure.
1. Why Architecture and Parameter Scale Are the Two Core Dimensions
When people discuss modern large language models, two questions come up most often: which computational modules are stacked inside the model, and how large those modules are in total. The former determines the model’s capability boundary and inference characteristics; the latter directly affects training cost, memory footprint, and throughput. It is worth stressing that parameter scale does not mean “bigger is always better.” What really determines cost efficiency is the combination of four quantities: total parameters, activated parameters per token, context length, and attention complexity.
Based on public technical material and conventions in published papers, mainstream model architectures can be abstracted into the following layers:
Input tokens-> Embedding layer-> N x Transformer Block|-- Normalization (Pre-Norm / RMSNorm family)|-- Attention sublayer (MHA / MQA / GQA / MLA, etc.)+-- Feed-forward sublayer (dense FFN or sparse MoE routing)-> Output normalization-> LM Head linear projection -> vocabulary probability distribution
Once you understand this main path, the differences between vendor “model families” are essentially substitutions and tuning on top of the same skeleton.
2. A Breakdown of Mainstream Architectural Paradigms
2.1 Dense Architecture
In a dense model, every token passes through all feed-forward parameters, so compute is roughly linear in parameter count. The advantages are stable training, simple inference implementation, and predictable memory usage. The drawback is that once parameter count reaches the hundreds of billions, per-token compute becomes too expensive and inference cost rises noticeably. Dense architectures are common in small and mid-sized models and in device-side or edge deployment scenarios.
2.2 Sparse Mixture-of-Experts (MoE)
A sparse architecture splits the feed-forward layer into multiple “experts,” and a routing network selects a few experts to participate in computation for each token. Three metrics matter most:
- Total parameters: determine the upper bound of the model’s knowledge capacity;
- Activated parameters: determine the actual compute cost per token;
- Expert granularity and routing strategy: determine load balancing and training stability.
As a result, a model with hundreds of billions of total parameters but only a few billion activated parameters may have an inference cost close to that of a dense model with a few billion parameters, while memory and memory bandwidth requirements are still determined by the total parameter count. This is where many teams most easily go wrong during selection.
2.3 The Evolution of Attention Mechanisms
The attention sublayer is the main source of long-context cost. Common optimization paths in the industry include:
- Grouped-query attention (GQA) / multi-query attention (MQA): compress the key-value cache and reduce memory usage;
- Multi-stage compression and low-rank projection approaches: compress the cache representation while preserving quality;
- Sparse / sliding-window / local-global hybrid attention: move complexity from quadratic toward linear;
- Linear attention and state-space hybrid architectures: offer throughput advantages on very long sequences.
2.4 Positional Encoding and Long Context
Rotary position embedding and its various interpolation and extrapolation extension schemes are the current de facto standard. Long-context capability is not simply a matter of “enlarging the window”; it is the result of three things working together: positional encoding extrapolation, the length distribution of training data, and the attention implementation.
3. Common Parameter Scale Tiers and Their Engineering Implications
By common industry convention, models can be roughly divided into four tiers:
| Tier | Parameter magnitude | Typical deployment form | Main constraint |
|---|---|---|---|
| Lightweight | Below a few billion up to ~10B | Device-side, single machine single GPU | Capability ceiling, memory |
| Mid-range | ~10B to ~100B | Single machine, multiple GPUs | Memory and bandwidth |
| High-end | ~100B to ~1T (mostly sparse) | Multi-machine, multi-GPU clusters | Communication, routing balance |
| Very large | Above ~1T (mostly sparse) | Large-scale clusters | Training stability, cost |
One caveat: vendors iterate on the naming of a given “family” quickly, and model name suffixes (such as Flash, Pro, Max, Lite) usually indicate different parameter tiers or inference optimization tiers within the same generation of architecture, rather than a fundamental architectural difference. During selection, return to the four verifiable metrics: total parameters, activated parameters, context length, and inference throughput.
4. How to Run a Rigorous Selection Evaluation
The recommended order is:
- Clarify the task type: short-output tasks such as extraction, classification, and summarization are not sensitive to parameter scale; complex reasoning, code generation, and long-document understanding require larger capacity.
- Estimate memory requirements: memory ≈ parameters x bytes per parameter of precision + key-value cache + activations and framework overhead. For sparse models, estimate memory based on total parameters.
- Load-test throughput and time to first token: look at the joint curve across input length, output length, and concurrency, not a single data point.
- Assess real context utilization: use tests such as “retrieval from a middle paragraph of a long document” to verify effective context, rather than relying only on the nominal window.
- Consider fine-tuning and alignment cost: the resource difference between full-parameter fine-tuning and parameter-efficient fine-tuning (such as low-rank adaptation methods) can be one to two orders of magnitude.
An illustrative rough memory calculation:
def rough_vram_gb(params_b, dtype_bytes=2, kv_cache_gb=0, overhead=1.2):weights = params_b * 1e9 * dtype_bytes / (1024 ** 3)return round((weights + kv_cache_gb) * overhead, 1)print(rough_vram_gb(70, 2, kv_cache_gb=8)) # Rough VRAM estimate for a dense model
5. Practical Notes on Deploying LLMs on General-Purpose Cloud Platforms
Enterprise adoption usually does not require building a training cluster from scratch, but rather reusing a combination of general-purpose cloud capabilities:
- A container platform hosts inference services, with elastic scaling to handle traffic peaks;
- Object storage holds model weights and training corpora;
- A message queue smooths request spikes and decouples asynchronous tasks;
- Logging services and monitoring/alerting track latency, error rates, and memory levels;
- Load balancing and a gateway layer handle multi-model routing and canary releases.
General-purpose product categories offered by Baidu AI Cloud in these scenarios (containers, storage, queues, logging, monitoring, and so on) can serve as the infrastructure foundation, leaving enterprises to focus on model selection and business orchestration itself.
6. Common Misconceptions
- Misconception 1: treating “total parameters” as “compute consumption.” For sparse models, you must look at activated parameters.
- Misconception 2: assuming a larger context window is always better. Effective context and cost must be measured.
- Misconception 3: ignoring the key-value cache. Under long context and high concurrency, the cache is often the memory bottleneck.
- Misconception 4: looking only at published benchmark leaderboards. Business distributions and evaluation distributions differ greatly, so always build a small validation set of your own.
7. Conclusion
The main thread of architectural evolution in modern large language models is “expanding effective capacity under controllable compute”: dense architectures ensure stability, sparse architectures trade for a balance of capacity and cost, and improvements to attention and positional encoding address long-context overhead. Mastering the analytical framework of “architectural paradigm + four key metrics + empirical validation” has more long-term value than memorizing any specific model generation.
