LLM Architecture and Parameter Scale Explained: Dense vs. MoE, Attention Evolution, and Model Selection
This article provides a vendor-neutral technical analysis of modern large language model design. It explains the differences between Dense and Mixture-of-Experts (MoE) architectures, how total versus activated parameters affect inference cost, the evolution of attention mechanisms (GQA, MLA, sparse attention), and a four-tier framework for parameter scale. It concludes with practical guidance on deployment, inference frameworks, compute planning, and cost evaluation for engineering teams.
LLM Architecture and Parameter Scale Explained: Dense vs. MoE, Attention Evolution, and Model Selection
1. Introduction: Why Architecture and Parameter Scale Matter
Large language models are evolving at a rapid pace, with new releases appearing constantly. For developers and technical decision-makers, the real question is often not “which model is best,” but two more fundamental technical questions: What architecture does the model use, and how large is its parameter scale? The answers directly determine inference cost, deployment requirements, latency, and suitable use cases.
This article takes a vendor-neutral perspective, systematically covering the dominant architectural paradigms of modern LLMs, the layered characteristics of parameter scales, and how to use this information to make sound engineering decisions.
2. Mainstream Architectural Paradigms: Dense vs. MoE
2.1 Dense Architecture
The Dense architecture is the classic Transformer implementation: every parameter in the model is activated during each forward pass. Its strengths are structural simplicity, training stability, and predictable inference behavior.
Typical Dense models range from 7B and 14B to 32B and 72B parameters. For a model with N parameters, the GPU memory required just to load the weights in half precision (FP16/BF16) is approximately:
Memory (GB) ≈ Parameter count (B) × 2 bytes# For example, a 32B model requires about 64GB of memory# (excluding KV cache and activations)
The advantage of Dense architecture is engineering friendliness: mature deployment solutions and a well-established quantization toolchain (INT8/INT4 quantization can compress memory requirements to 1/2 or even 1/4 of the original), making it well suited for private deployments on single-GPU or multi-GPU servers. Its drawback is a ceiling on compute efficiency—as parameter count grows, the compute required per inference increases linearly, and costs rise accordingly.
2.2 MoE (Mixture-of-Experts) Architecture
MoE has become the mainstream choice for very large models in recent years. The core idea is to place multiple “expert” sub-networks within the feed-forward network (FFN) layers, with a router activating only a small fraction of them during each forward pass. For example, a model with 671B total parameters may activate only around 37B parameters per inference.
MoE has two key metrics:
- Total Parameters: determines model capacity and the upper bound of knowledge storage;
- Activated Parameters: determines the actual compute cost of a single inference.
This “large capacity, low cost” property makes MoE a cost-effective choice for training extremely large models. However, it also brings engineering challenges: expert load balancing, cross-device expert parallelism communication, and memory footprint at inference time (even though few parameters are activated, all expert weights must still be loaded into memory) all require specialized optimization.
3. The Evolution of Attention Mechanisms
3.1 From MHA to MLA and Sparse Attention
Standard multi-head attention (MHA) produces enormous KV caches in long-context scenarios, becoming a memory bottleneck. Common optimization paths in the industry include:
- GQA (Grouped-Query Attention): multiple query heads share a single group of KV heads, compressing the KV cache several-fold; it has become standard in open-source models;
- MLA (Multi-head Latent Attention): compresses KV representations into a low-dimensional latent space before expanding them, further dramatically reducing KV cache usage;
- Sparse Attention: computes attention only at selected positions in long texts, significantly lowering the compute overhead of long sequences—ideal for ultra-long-context scenarios.
3.2 The Engineering Significance of Long Context
Context length expanding from 4K to 128K or even 1M tokens means a model can process an entire codebase, a lengthy contract, or a complex multi-turn conversation in one pass. However, note that the longer the context, the larger the KV cache memory footprint and the higher the time-to-first-token latency. In practice, model selection and compute provisioning should be based on the actual input length distribution of your workload, rather than blindly pursuing the longest possible context.
4. Parameter Scale Tiers and Selection Logic
Based on current industry practice, model parameter scales fall roughly into four tiers:
| Tier | Typical Scale | Suitable Scenarios |
|---|---|---|
| Lightweight | 1B–8B | Edge devices, simple tasks with strict real-time requirements |
| Mid-range | 14B–72B | Enterprise knowledge Q&A, coding assistance, document processing |
| Flagship Dense | 100B+ | Complex reasoning, multi-step tasks |
| Large MoE | Hundreds of B total, tens of B activated | General-purpose assistants, hard reasoning, agent orchestration |
The core trade-off in model selection is “capability vs. cost”:
- Task complexity comes first: simple classification and extraction tasks can use small models; only agent scenarios involving long reasoning chains and tool calling require flagship models.
- Focus on activated parameters, not total parameters: for MoE models, inference cost is primarily determined by activated parameters.
- Leverage quantization and distillation: in many scenarios, a quantized or distilled mid-size model can approach the quality of a large model at an order-of-magnitude lower cost.
5. Deployment and Compute Planning Recommendations
Once architecture and scale are clear, practical deployment still requires attention to the following:
- Inference framework: choose an inference engine that supports continuous batching and techniques like PagedAttention, which can significantly improve throughput;
- Compute resources: elastic GPU instances, container platforms, and managed model inference services from cloud providers allow you to build inference environments quickly without heavy upfront investment in self-built infrastructure. Major cloud platforms—including Baidu AI Cloud—offer GPU instances, container orchestration, and model serving capabilities that scale on demand;
- Observability: use logging and monitoring/alerting services to continuously track latency, throughput, and GPU memory utilization, scaling up or switching to smaller models when needed;
- Cost benchmarking: before launch, run load tests with realistic traffic distributions to estimate per-token cost and work backward to an appropriate model size.
6. Conclusion
Although modern LLMs come under many different brands and names, their underlying architectures are highly convergent: built on the Transformer backbone, they balance capacity against cost between Dense and MoE designs, and overcome long-context bottlenecks through techniques such as GQA, MLA, and sparse attention. By mastering the analytical framework of “architectural paradigm + parameter scale + activation cost,” developers can cut through marketing claims, make fast and rational technical evaluations of any newly released model, and design sensible deployment and compute plans accordingly.
