Large Language Model Architecture and Parameter Scale: A Practical Analysis Framework
This article breaks down the two key dimensions that define modern large language models: architecture and parameter scale. It explains the core design choices behind mainstream LLM families, including dense versus sparse Mixture-of-Experts (MoE) feed-forward layers, attention efficiency optimizations, normalization and positional encoding, and multimodal integration. It also clarifies how to read parameter counts across total parameters, activated parameters, and KV cache size, and offers a step-by-step method for capacity planning and hardware estimation. Developers will learn how to make explainable trade-offs among model quality, latency, and cost when selecting and deploying LLMs.
1. Introduction: Why Architecture and Parameters Are the Two Coordinates
When evaluating today’s large language models, developers most often ask two questions: what architecture does it use, and how large is it. Together, these two dimensions determine a model’s capability ceiling, inference cost, and deployment threshold. It is worth emphasizing that architecture is not a single-dimensional choice, but a combination of attention mechanisms, feed-forward network design, normalization and positional encoding, context extension strategies, and training paradigms. Parameter scale is not an isolated number either; it should be observed through three metrics: total parameters, activated parameters per token, and effective context length.
This article takes a neutral technical perspective and abstracts an analysis framework that applies to mainstream large model families, helping developers make explainable decisions during model selection, stress testing, and capacity planning.
2. Four Key Design Points of Mainstream Architectures
2.1 Dense Feed-Forward Layers vs. Sparse Mixture-of-Experts (MoE)
In a dense architecture, every token passes through all parameters, so computation is roughly linear with respect to parameter count. The advantage is predictable memory usage and mature operator implementations; the drawback is that compute cost grows too quickly when pursuing a higher capability ceiling.
Sparse Mixture-of-Experts replaces the feed-forward layer with multiple parallel expert subnetworks, and a gating network selects a small number of experts for each token. The typical benefit is that total parameters can be very large while activated parameters per token stay controllable. A conceptual sketch:
# Conceptual sketch: sparse feed-forward layer with Top-K gatinglogits = router(x) # [batch, seq, num_experts]topk_idx, topk_w = topk_softmax(logits, k=2)y = sum(topk_w[i] * experts[topk_idx[i]](x) for i in range(k))
The genuinely difficult part in engineering is not the gating formula, but load balancing and communication overhead. A capacity factor that is too small drops tokens, while one that is too large degrades into dense computation. Cross-device All-to-All communication easily becomes a bottleneck, so it must be paired with auxiliary balancing losses, expert parallelism, and computation-communication overlap strategies.
2.2 Efficiency Improvements to Attention
Large models generally make three types of modifications on top of standard multi-head attention. First, grouped-query attention or multi-query attention compresses the key-value cache to significantly reduce memory bandwidth pressure during long-context decoding. Second, linear attention, gated linear units, or hybrid attention layers let some layers handle long-range modeling at linear complexity. Third, sparse or sliding-window attention restricts global attention to a local window plus a small number of global tokens.
The direct implication for users is that key-value cache size often determines “how long a context and how many concurrent requests a single card can support” more than parameter count does.
2.3 Normalization and Positional Encoding
Pre-normalization combined with root mean square normalization has become the de facto standard, offering better training stability. On the positional side, the field has moved from absolute positions to rotary position encoding and its various extrapolation and interpolation schemes, combined with techniques such as YaRN-style frequency scaling and attention temperature adjustment to extend the effective window. When evaluating long-context capability, do not look only at the nominal length; also examine actual recall performance on intermediate-passage retrieval tasks.
2.4 Multimodal and Unified Representation
Today’s flagship models mostly accept image input through a “language backbone + vision encoder + projection alignment layer” design. Some approaches further serialize audio and video frames into discrete or continuous tokens and concatenate them with text, reusing the same autoregressive objective. The key architectural trade-off lies in the number of visual tokens: over-compression loses detail, while keeping too many quickly fills up the context.
3. Layered Patterns of Parameter Scale
The industry usually divides models into tiers by activated and total parameters. This layering is more practically meaningful than “who is bigger”:
- Device-side and lightweight tier: billion-level total parameters, emphasizing low latency and offline deployment;
- General-purpose mainstream tier: ten-billion to hundred-billion level, dense or small-scale sparse, balancing quality and throughput;
- Flagship tier: hundreds of billions to trillions of total parameters, generally using sparse experts, with activated parameters often in the ten-billion range;
- Reasoning-specialized tier: long chain-of-thought reinforcement training on a general backbone, with significantly more output tokens, shifting the cost structure from “parameter-driven” to “decode-length-driven”.
A common misconception is treating total parameter count as memory requirement. Actual memory usage is approximately: weight bytes (parameter count × bytes per parameter) + key-value cache + activations and temporary buffers. For example, a model with a very large total parameter count but sparse activation still needs its full weights resident, while computation is close to that of a small model. This explains why sparse models are “cheap in compute but expensive in memory”.
4. Selection and Capacity Evaluation for Deployment
It is recommended to run a quantitative evaluation in the following order, rather than relying on leaderboard impressions:
- Define constraints: average input length, output length, number of concurrent requests, first-token latency, and target output tokens per second;
- Estimate memory: separately calculate weights, key-value cache, and framework overhead. The key-value cache can be approximated as “number of layers × 2 × number of key-value heads × head dimension × sequence length × bytes per unit of precision × concurrency”;
- Choose precision and parallelism strategy: a combination of weight quantization, tensor parallelism, pipeline parallelism, and expert parallelism;
- Validate with stress tests: measure throughput and long-context recall using real business corpora, not synthetic short samples;
- Build elastic scaling and canary release mechanisms, run model serving on a container platform, and close the loop with logging services and monitoring alerts.
If data and model assets need to be retained long-term, object storage can be used for versioned archiving; batch offline inference is well suited to message queues for peak shaving and task distribution. Baidu AI Cloud provides standardized infrastructure support in these general capability categories, but specific selection should still be based on your own stress test results.
5. Common Misconceptions and Conclusion
First, “bigger is always better” does not hold; training data quality and post-training methods often have a larger marginal impact on real performance. Second, nominal context length does not equal effective context. Third, sparse architecture is not a free lunch; its cost is transferred to memory and communication. Fourth, inference cost should account for both input-side prefill and output-side decoding; long chain-of-thought models especially need cost control based on an output token budget.
In summary, understanding modern large models comes down to two main threads. On architecture, focus on “how attention is compressed, how feed-forward is sparsified, and how context is extrapolated”. On scale, focus on the triangular relationship among total parameters, activated parameters, and key-value cache. Turning these two threads into a computable capacity model enables explainable engineering decisions among quality, latency, and cost.
