Modern LLM Architectures and Parameter Scales: Structure, Sparse Experts, Context, and Deployment
This article explains how modern large language models are organized as model families built on a shared architecture, and how to evaluate parameter scale beyond a single number. It covers decoder-only Transformer structure, dense versus sparse mixture-of-experts organization, total versus active parameters, long-context memory costs, training and alignment factors, model-family selection, and deployment considerations.
Modern large language models are rarely developed as a single model for every use case. More often, they form a model matrix built on a general architecture and differentiated by parameter organization and inference form. The source material lists model variants by product series, which suits a product catalog but makes technical commonalities harder to see. This article abstracts the topic into six dimensions: structure, parameters, context, training alignment, series-based selection, and deployment evaluation. It discusses the general structure and parameter-scale issues of modern large language models.
1. General Architecture Skeleton: Decoder-Only Self-Attention Remains Dominant
Most mainstream large language models today use a decoder-only Transformer-style structure, meaning they stack decoder blocks for autoregressive modeling. Core components include a vocabulary and embedding layer, a number of decoder blocks, and an output mapping layer. Each decoder block usually consists of an attention sublayer and a feed-forward network sublayer, together with residual connections and normalization. The attention sublayer handles information exchange between tokens, while the feed-forward sublayer transforms features token by token. Common engineering choices include RMSNorm, RoPE positional encoding, SwiGLU-style activations, and grouped-query attention.
Among structural variants, the most important difference is not whether a model is a Transformer, but how the feed-forward layer is organized. A dense model uses one feed-forward network per layer, and all parameters participate in computation for every token. A sparse mixture-of-experts model places multiple expert networks within a layer and uses routing to activate only a small number of experts for each token. This leads to two parameter measures: total parameters and active parameters. Total parameters determine weight storage and deployment capacity, while active parameters affect per-token computation. Understanding this distinction is a prerequisite for understanding what “parameter scale” means.
2. Parameter Scale: Total Parameters, Active Parameters, and Effective Capacity
Parameter scale cannot be captured by one number alone. From an engineering perspective, at least three measures should be distinguished: total parameter count, per-token active parameter count, and effective capacity. Total parameters are roughly the sum of the embedding layer, attention parameters in each layer, feed-forward or expert parameters, and the output layer. Active parameters are the parameter scale that actually participates in computation during a single forward pass. For dense models, the two are basically the same. For sparse models, total parameters can be much larger than active parameters.
A simplified formula helps explain dense model scale: parameter count grows roughly with the number of layers, hidden dimension, and feed-forward intermediate dimension; attention parameters are related to hidden dimension, number of heads, and number of key-value heads. For sparse models, shared experts, routing parameters, and top-k experts must be counted separately in total parameters, while active parameters count only the selected experts. In practical selection, total parameters affect the lower bound of VRAM, and active parameters affect the upper bound of compute and latency. The two cannot substitute for each other.
| Form | Primary goal | Common parameter organization | Main constraints | Suitable tasks |
|---|---|---|---|---|
| Lightweight | Low latency and low cost | Smaller dense models or sparse models with small active parameters | VRAM and throughput first | Classification, extraction, short-text QA |
| Balanced | Balance quality and cost | Medium total parameters with moderate sparsity | Generality and concurrency | Knowledge QA, summarization, coding assistance |
| Flagship | Complex reasoning and long context | Large total parameters with sparse activation | VRAM, bandwidth, scheduling complexity | Multi-step reasoning, complex analysis |
| Speed-optimized | High-concurrency online serving | Small active parameters, quantization, and batching | Time to first token and throughput | Real-time interaction, routing and dispatch |
It is important to emphasize that parameter scale is not a linear function of capability. Data quality, number of training tokens, alignment strategy, context length, and tool-calling ability all affect final performance. A model with more total parameters may not outperform a smaller but better-trained model if its active parameter count is too small or its routing is unstable. Therefore, “how large is the parameter scale” should be answered in four parts: how large are the total parameters, how large are the active parameters, how is sparsity organized, and what context and tasks will be served.
3. Attention and Context: The Cost Structure Behind Long Context
Modern models commonly support longer context, but long context is not a free capability. Standard attention increases compute and memory pressure as sequence length grows. In engineering practice, grouped-query attention, multi-query attention, low-rank key-value compression, sliding-window attention, and block attention are often used to reduce key-value cache overhead. The key-value cache is an important component of inference memory. Especially in high-concurrency and long-context scenarios, the cache may exceed weight memory.
The following pseudocode can be used to estimate the lower bound of inference memory:
spec = {layers: L,hidden: d,kv_heads: H_kv,head_dim: D_h,total_params: P_total,bytes_per_param: B}weight_bytes = P_total * Bkv_per_token = 2 * L * H_kv * D_h * Bkv_cache_bytes = kv_per_token * seq_len * batchinfer_memory ≈ weight_bytes + kv_cache_bytes + activation_buffer
The coefficient 2 represents two caches: keys and values. As shown, reducing the number of key-value heads, lowering cache precision, shortening context, or limiting batch size directly affects serviceable concurrency. When selecting for long context, evaluate both “whether it fits” and “whether it can serve stably with low latency,” rather than looking only at the maximum context claim.
4. Training and Alignment: Engineering Variables Beyond Scale
Parameter scale is only part of the training result. The pretraining stage focuses on data scale, data mix, deduplication, and quality filtering. Training parallelism usually involves combinations of data parallelism, tensor parallelism, pipeline parallelism, and expert parallelism. Sparse models also need to handle expert load balancing, routing stability, and communication overhead. The post-training stage typically includes supervised fine-tuning, preference optimization, reasoning enhancement, tool calling, and safety alignment. For enterprise applications, the quality of post-training data and evaluation sets often determines usability more than simply increasing parameters.
The reason series-based models include flagship, balanced, lightweight, and speed-optimized forms at the same time is that different businesses have different requirements for latency, throughput, context, cost, and compliance. The flagship version pursues the upper bound on complex tasks, the balanced version pursues general cost-effectiveness, the lightweight version suits edge or high-concurrency scenarios, and the speed-optimized version emphasizes time to first token and throughput. Generational evolution usually centers on structural refinements, attention efficiency, sparse routing, context extension, alignment strategy, and inference cost, rather than parameter inflation alone.
5. Selection and Deployment: From Evaluation to General Cloud Capability Composition
Selection should be based on a task evaluation set covering accuracy, robustness, long context, tool calling, security and compliance, and cost metrics. Deployment can use quantization, batching, key-value cache management, request routing, and tiered fallback. For high-concurrency online services, a small model can handle intent recognition and routing, while a large model handles complex requests. Offline tasks can use batching and asynchronous queues. In cloud deployments, container platforms can host inference services, object storage can manage model weights and evaluation sets, logging and monitoring can observe latency, error rates, and resource utilization, and message queues can decouple offline evaluation from online inference. These are general cloud product categories, and specific specifications should be selected based on actual stress testing.
In summary, modern large language model structure should be understood as “general skeleton + sparse organization + attention optimization + training alignment,” and parameter scale should be evaluated as “total parameters + active parameters + context cost.” Only by placing structure, scale, evaluation, and deployment on the same technical map can the appropriate model form be selected for a specific business.
