Understanding Modern LLM Architectures and Parameter Scale

    This article breaks down the two core dimensions used to evaluate large language models: architecture and parameter scale. It explains the main architectural building blocks, including attention variants, dense versus mixture-of-experts feed-forward layers, positional encoding, and normalization. It then separates parameter scale into total parameters, activated parameters, and key-value cache size, showing why all three matter for cost and performance. The article closes with practical guidance on model selection, cost estimation, scaling, and observability.

    1. Why Architecture and Parameter Scale Are the Two Core Dimensions

    When engineers discuss a model, two questions come up most often: what network architecture it uses, and how many parameters it has. These two dimensions directly determine memory usage, throughput, maximum context length, and inference cost per unit.

    It is important to note that parameter count does not equal a capability ceiling. The efficiency of an architecture is often more decisive than simply stacking more parameters.

    Based on how the source material organizes information, the industry typically maps model families across two levels: a series and a version. A series represents the continuation of the same technical approach and training paradigm, while version iterations correspond to changes in data mix, architectural fine-tuning, and alignment strategies. This article strips away specific product attributes and presents a general technical framework.

    2. Four Key Components of Mainstream Architectural Paradigms

    2.1 Attention: From Full to Sparse

    Most current models are built on a Transformer decoder backbone and use autoregressive generation. The main differences appear in the attention mechanism:

    • Grouped-query attention: multiple query heads share a group of key-value heads, significantly reducing key-value cache overhead during inference;
    • Sliding-window and local attention: attending only to nearby tokens reduces complexity from quadratic to near-linear;
    • Sparse and linear attention variants: using learnable sparse patterns or kernel approximations to keep costs manageable for long contexts.

    2.2 Feed-Forward Layers: Dense vs. Mixture of Experts

    In dense structures, every token passes through all parameters. Mixture-of-experts structures introduce a routing network, so each token activates only a few experts. The result is a large total parameter count but a small per-inference activation, creating a “large capacity, low per-pass compute” profile. In practice, routing load balancing is critical; otherwise, some experts sit idle and throughput fluctuates.

    Illustrative pseudocode:

    1. # General logic of a mixture-of-experts feed-forward layer
    2. def moe_ffn(x, router, experts, top_k=2):
    3. weights = router(x) # routing scores
    4. idx = topk(weights, k=top_k) # select activated experts
    5. out = 0
    6. for i, g in idx:
    7. out += g * experts[i](x) # weighted aggregation
    8. return out

    2.3 Positional Encoding and Long Context

    Rotary positional encoding has become the de facto standard choice, combined with interpolation, extrapolation, and chunking strategies to extend the context window. Long-context capability is not determined by the encoding method alone; it also depends on the data length distribution during training and memory optimization techniques.

    2.4 Normalization and Residual Connections

    Pre-normalization plus residual connections is more conducive to stable convergence in deep networks. Combined with high-precision accumulation and gradient clipping, it can support stacking over a hundred layers.

    3. Three Levels of Parameter Scale

    1. Total parameters: determine the model’s theoretical capacity and storage footprint;
    2. Activated parameters: determine the actual compute consumed in a single forward pass, which is far smaller than the total in sparse structures;
    3. Key-value cache size: grows linearly with context length and is the main memory bottleneck for long-text serving.

    All three should be evaluated together. A sparse model with a large total but moderate activation may outperform a dense model of comparable capability on a per-unit-cost basis.

    4. General Patterns of Series-Based Iteration

    Version evolution usually advances along four lines: data quality and mix optimization, architectural efficiency improvements, context and multimodal capability expansion, and stronger alignment and safety strategies. Within the same series, a large flagship version and a smaller low-latency version are often offered together, targeting offline batch processing and online real-time interaction respectively.

    5. Selection and Deployment Recommendations

    • Scenario matching: for high-concurrency short requests, prioritize low-activation, low-latency versions; for long-document analysis, prioritize long context and cache optimization;
    • Cost estimation: model it as “cost per token × average daily call volume” rather than looking at unit price alone;
    • Elastic scaling: use container platforms and message queues to handle queuing and scaling;
    • Observability: track time-to-first-token latency, throughput, and failure rate through logging services and monitoring alerts;
    • Platform approach: in environments with model serving, object storage, and elastic compute, such as Baidu AI Cloud, the cycle from validation to launch can be shortened.

    6. Conclusion

    Understanding the layered meaning of architectural paradigms and parameter scale is a key step toward moving from “using a model” to “evaluating a model.” Only by bringing architectural efficiency, activation scale, and cache overhead into a unified evaluation framework can you achieve a sustainable balance among quality, latency, and cost.