Understanding Modern LLM Architectures and Parameter Scale
This article breaks down the two core dimensions for evaluating large language models: architecture paradigm and parameter scale. It explains the difference between total and activated parameters, compares dense and sparse Mixture-of-Experts (MoE) designs, and reviews attention and positional encoding choices for long context. A scale-based selection table and practical engineering tradeoffs around quantization, caching, batching, and observability help readers match model size to deployment constraints.
1. Why Architecture and Parameter Scale Are the Two Core Dimensions
When engineers discuss a model, two questions come up most often: what architecture does it use, and how large is it. The architecture determines computational complexity, the shape of GPU memory usage, and how the model can be sharded for parallelism. The parameter count gives a rough expectation of the capability ceiling and sets a floor on deployment cost.
One important distinction: total parameters and activated parameters (those involved in a single forward pass) have separated in modern sparse architectures. Looking at the total only will badly misjudge inference cost.
A practical evaluation order:
- Identify the architecture paradigm (dense or sparse expert).
- Check the ratio of total parameters to activated parameters.
- Assess the long-context cost introduced by attention and positional encoding.
2. Mainstream Architecture Paradigms
2.1 Dense Feed-Forward
Every layer runs the feed-forward network over the full hidden dimension. This gives high parameter utilization, a simple implementation, and operator-friendly computation, making it the best value in the small-to-medium range. The drawback is that parameter growth is linearly coupled with compute, so scaling up means scaling cost.
2.2 Sparse Mixture-of-Experts (MoE)
The feed-forward layer is replaced by multiple parallel expert subnetworks, and a gating network selects a few experts per token. The value is “large total capacity, small per-pass compute.” Three engineering points matter most:
Routing: top-k selection + load balancing loss to avoid expert collapseParallelism: hybrid sharding with expert + tensor + data parallelismCommunication: All-to-All traffic grows with expert count and parallel degree
Sparse architectures scale capacity well, but they are more sensitive to network bandwidth and memory capacity, and may not beat dense designs on small clusters.
2.3 Evolution of Attention
Grouped-query attention (GQA) is widely adopted for balancing quality against memory bandwidth. More aggressive designs alternate sliding-window local attention with global attention, pushing long-sequence complexity from quadratic toward near-linear. The engineering gains show up mainly in peak memory and decode throughput for long-context scenarios.
2.4 Positional Encoding and Long Context
Rotary position encoding combined with frequency extrapolation or interpolation-style modifications is the mainstream approach for extending the context window. Note that nominal context length often differs from effective length, so evaluation should use long-range retrieval and multi-hop reasoning tasks.
3. Parameter Scale Tiers and Selection Guidance
| Scale | Typical Architecture | Use Cases | Deployment Notes |
|---|---|---|---|
| Below a billion | Dense | On-device, classification and extraction | Single GPU or on-device inference |
| Hundreds of millions to tens of billions | Dense | General chat, code assistance | Single GPU to multi-GPU tensor parallelism |
| Tens of billions to hundreds of billions | Sparse expert | Complex reasoning, unified multi-task | Multi-node multi-GPU, prioritize communication |
| Above hundreds of billions | Sparse expert | Frontier capability exploration | Cluster-level scheduling and fault tolerance |
For selection, decide based on the “effective compute budget” rather than parameter count: memory capacity determines whether the model fits, memory bandwidth determines decode speed, and inter-GPU interconnect determines parallel efficiency.
4. Engineering Tradeoffs Between Cost and Performance
- Quantization: low-bit weights significantly reduce memory usage, but accuracy regression must be evaluated with before/after comparisons on real business datasets.
- Cache reuse: prefix caching delivers high value for fixed system prompts and can cut repeated computation substantially.
- Batch scheduling: continuous batching improves throughput significantly, but timeouts and priorities are needed to avoid long-tail latency.
- Observability: using general-purpose logging and monitoring/alerting, collect time-to-first-token, per-token latency, memory watermark, and failure rate to close the capacity planning loop.
If you run inference services on general capabilities such as the container platform and object storage from Baidu AI Cloud, you can manage model weights, images, and logs in tiers, with elastic scaling for traffic peaks.
5. Common Pitfalls
- Treating total parameters as the cost metric while ignoring activated parameters and cache overhead.
- Looking only at nominal context length without validating effective length.
- Forcing a very large sparse model onto a small cluster, where communication cost eats the gains.
- Overlooking the impact of the tokenizer and vocabulary size on memory and throughput.
6. Conclusion
Understanding modern LLMs means evaluating the architecture paradigm, total and activated parameters, and the attention and positional encoding scheme on the same cost table. Dense architectures win on implementation simplicity, sparse experts win on capacity scaling, and long-context capability depends on how attention and encoding work together. Anchoring on a business evaluation set and constraining by memory, bandwidth, and interconnect is how you pick a model scale and deployment shape that actually fit.
