Understanding Large Language Model Architectures and Parameter Scale
This article breaks down the two core dimensions for evaluating large language models: architecture and parameter scale. It covers mainstream design patterns from dense feed-forward and self-attention backbones to sparse Mixture-of-Experts, along with efficiency improvements in attention mechanisms and positional encoding. It also outlines common parameter tiers and their engineering implications, explains why activated parameters and context length drive inference cost, and provides a configuration-reading example plus practical guidance on memory estimation, parallelism, and evaluation-first selection.
1. Introduction: Why Architecture and Parameter Scale Are the Two Core Dimensions
When building intelligent applications, developers rarely ask “which model is the strongest.” The more common questions are: What is the internal structure? How large is the parameter count? What engineering consequences do these design choices bring? Architecture determines how a model captures long-range dependencies and allocates compute, while parameter scale directly affects memory footprint, inference throughput, and training cost. Understanding both dimensions is what allows you to make sound trade-offs among quality, latency, and cost.
It is worth noting that vendors rarely disclose their exact model naming or internal implementation details. This article does not target any specific product. Instead, it abstracts the publicly verifiable, general technical paradigms in use today to help readers build a transferable framework for evaluation.
2. Mainstream Architecture Paradigms: From Dense to Sparse
2.1 Dense Feed-Forward and Self-Attention Backbone
The vast majority of modern LLMs are still built on a stack of Transformer decoder layers. Each layer consists of a normalization step, a self-attention sub-layer, and a feed-forward sub-layer, using residual connections and pre-normalization to improve training stability at depth. The feed-forward layer typically uses a gated activation structure and accounts for the largest share of the parameter count.
2.2 Mixture of Experts (Sparsification)
To decouple total parameter count from per-token compute, the industry widely adopts a Mixture-of-Experts (MoE) structure. Each layer contains multiple expert networks and a routing network, and each token activates only a small subset of experts. The typical benefit is that total parameters can reach the hundreds of billions, while activated parameters are usually only one-tenth to one-third of the total. This significantly reduces the compute required for inference, at the cost of increased memory usage and greater complexity in routing load balancing.
2.3 Efficiency Evolution of the Attention Mechanism
Demand for long context has driven changes to attention. Common directions include grouped-query attention (reducing the number of key-value heads to compress the cache), multi-query attention, sliding-window and local-global hybrid attention, as well as linear attention and state-space hybrid structures. On the engineering side, this must be paired with key-value cache quantization and paged cache management to control memory growth over long sequences.
2.4 Positional Encoding and Context Extension
Rotary positional encoding and its frequency-scaling variants are the mainstream choice. Combined with post-training context window extension, they can increase the usable length without retraining the backbone.
3. Common Parameter Scale Tiers and Their Engineering Implications
- Lightweight: roughly 1B to 10B parameters, where activated and total parameters are close, suitable for on-device or high-concurrency, low-latency scenarios.
- Mid-size: roughly 10B to a few tens of billions of parameters, mostly dense, balancing quality and deployment cost.
- Large sparse: hundreds of billions of total parameters with tens of billions activated, suitable for complex reasoning and long-context tasks.
- Ultra-large dense: trillion-scale parameters are rare and extremely costly to train, typically undertaken only by teams with complete compute infrastructure.
Key takeaway: what truly determines the cost of a single inference is activated parameters plus context length, not the total parameter count. When selecting a model, check total parameters, activated parameters, number of layers, hidden dimension, number of attention heads, and the context limit together.
4. An Illustrative Configuration-Reading Example
# Illustrates how to read key architectural fields from a generic configdef summarize(cfg: dict) -> dict:return {"layers": cfg.get("num_hidden_layers"),"hidden": cfg.get("hidden_size"),"heads": cfg.get("num_attention_heads"),"kv_heads": cfg.get("num_key_value_heads"),"experts": cfg.get("num_experts", 1),"activated_experts": cfg.get("experts_per_token", 1),"ctx": cfg.get("max_position_embeddings"),}
5. Practical Guidance for Deployment and Selection
- Memory estimation: weight memory is roughly the parameter count multiplied by bytes per parameter (2 bytes for half precision), plus key-value cache and activation overhead.
- Parallelism strategy: dense models commonly use tensor parallelism and pipeline parallelism; sparse models rely more on expert parallelism, where cross-device communication overhead must be watched.
- Cloud deployment: inference services can run on a container platform, model weights can be stored in object storage, and latency, throughput, and error rates can be observed through logging and monitoring with alerting to enable elastic scaling.
- Evaluation first: run a small-scale comparative evaluation on real business data before deciding whether to scale up, avoiding blind pursuit of parameter stacking.
6. Conclusion
The main thread of modern LLM architecture evolution is expanding effective capacity under controllable compute. Parameter scale is only the surface; sparsification, attention efficiency, and context management are what matter for engineering deployment. With this framework in hand, developers can quickly complete the selection, load-testing, and launch loop in environments with complete cloud infrastructure, such as Baidu AI Cloud.
