Modern LLM Architectures, Parameter Scales, and How to Choose the Right Model

    A practical guide to modern large language model architectures and parameter scaling. This article explains decoder-only designs, attention and MoE trade-offs, the difference between total and active parameters, cost estimation formulas, and a framework for evaluating model variants by quality, latency, and cost.

    1. Architecture Overview: Decoder-Only Remains the Dominant Backbone

    The mainstream architecture of modern large language models is still the decoder-only, autoregressive design. The basic pipeline can be summarized as follows: text is first converted into a sequence of vectors through tokenization and embedding layers, position information is added, and the sequence passes through multiple stacked transformer blocks. Each block typically contains a self-attention sublayer and a feed-forward network (FFN) sublayer, with residual connections and normalization to keep training stable. Finally, an output projection produces a probability distribution over the next token. Training usually maximizes the likelihood of the next token given the preceding context; at inference time, generation proceeds token by token in an autoregressive manner.

    From an engineering perspective, architectural differences rarely lie in “whether a decoder is used” but rather in the trade-offs among several key components:

    1. Attention mechanisms: Options include multi-head attention (MHA), grouped-query attention (GQA), multi-query attention (MQA), and low-rank compressed attention. The core trade-off is between expressiveness, KV cache memory, and inference throughput. GQA lets multiple query heads share key-value heads, significantly reducing cache pressure during long-context inference. MQA compresses the cache further but may sacrifice some expressiveness, while low-rank compression schemes attempt more aggressive compression along the cache dimension.
    2. Feed-forward networks: Dense FFNs are simple to implement with low communication overhead. Mixture-of-Experts (MoE) FFNs use routing mechanisms so each token activates only a subset of experts, controlling per-token compute despite a large total parameter count. The key challenges for MoE are routing load balancing, expert-parallel communication, training stability, and the memory footprint of expert weights at inference time.
    3. Normalization and activation: Pre-normalization, RMSNorm, and gated linear units (GLU) have become common practice. Pre-norm helps stabilize training in deep networks, RMSNorm is computationally simpler, and gated activations improve the expressive efficiency of the FFN.
    4. Positional encoding and context extension: Rotary position embeddings (RoPE) are widely adopted for their relative position modeling and extrapolation capabilities. Long-context capability usually also requires combining position interpolation, attention sparsification, chunked computation, and retrieval augmentation, rather than simply expanding the positional encoding range.
    5. Multimodal and tool-calling extensions: Adding a vision encoder, projection layers, structured output heads, or tool-calling protocol adapters on top of the language backbone is a common extension path. Such extensions require attention to modality alignment, sequence length inflation, and inference scheduling complexity.

    Therefore, when answering “what architecture do modern LLMs use,” it is not enough to say “a stack of decoder layers.” A more accurate statement is: a decoder-only skeleton, combined with engineering choices in attention, FFN, normalization, positional encoding, and extension modules, to match targets for capability, context, latency, and cost.

    2. Parameter Scale: Total Parameters, Active Parameters, and Effective Capacity

    Parameter scale is an important dimension for understanding model cost and capability, but you should not look only at “total parameters.” For dense models, every token’s forward pass typically uses all parameters. For MoE models, total parameters may be very large, but each token activates only a subset of experts, so per-token compute is closer to the “active parameters.” This creates three distinct metrics that must be separated:

    • Total parameters: Determine weight storage size, the upper bound of model capacity, and memory pressure in distributed deployment.
    • Active parameters: Determine the bulk of per-token inference compute, throughput, and latency.
    • Effective capacity: Also influenced by training token count, data quality, number of experts, routing strategy, context length, and alignment training. It cannot be linearly derived from parameter count alone.

    In general terms, modern LLMs span dense models from hundreds of millions through billions, tens of billions, and hundreds of billions of parameters, plus sparse MoE models with hundreds of billions or even trillions of total parameters. Active parameters may range from a few billion to tens of billions. These figures should only serve as abstract scale tiers, not correspond to any specific product.

    Training and inference costs can be estimated with simplified formulas:

    • Approximate total training compute: C_train ≈ 6 × N_total × D, where N_total is the total parameters involved in training and D is the number of training tokens.
    • Approximate per-token inference compute: C_infer ≈ 2 × N_active, where N_active is the active parameters per token.
    • Approximate memory: M ≈ P × b + KV_cache + activations and fragmentation, where P is the parameter count and b is bytes per parameter. The KV cache can be approximated as 2 × L × B × S × H_kv × D_head × b_cache, corresponding to layers, batch size, sequence length, number of KV heads, head dimension, and cache bytes per element.

    Here is a framework-agnostic pseudocode example for roughly estimating weight and KV cache memory:

    1. function estimate_memory(total_params, bytes_per_param, layers, batch,
    2. seq_len, kv_heads, head_dim, kv_bytes):
    3. weights = total_params * bytes_per_param
    4. kv_cache = 2 * layers * batch * seq_len * kv_heads * head_dim * kv_bytes
    5. return weights + kv_cache

    For example, suppose a model has 100B total parameters and 10B active parameters, stored in 2-byte weights. Weight memory would be about 200GB, but its per-token compute is closer to the 10B active parameters. With long contexts and large-batch inference added on top, the KV cache can become a significant memory item. Quantization can reduce weight and cache bytes, but it introduces precision loss and should be evaluated against the task’s error tolerance.

    3. Joint Trade-offs Between Architecture and Parameter Scale

    Architecture choice and parameter scale are not independent decisions. Larger total parameters usually bring greater capacity but also more memory, communication, and deployment complexity. Higher active parameters usually boost per-token compute but reduce throughput. MoE can keep active parameters controlled while total parameters grow, but places higher demands on routing balance and expert parallelism. In practice, you should evaluate the following dimensions together:

    1. Latency and throughput: Interactive scenarios care more about time-to-first-token and per-request generation speed; batch offline scenarios care more about throughput and cost per token. GQA and MoE can both shift the latency curve.
    2. Context length: Long contexts amplify KV cache memory and attention compute. Assess whether cache compression, paged management, sparse attention, and retrieval augmentation match your task.
    3. Deployment topology: Single-node multi-GPU, multi-node clusters, and lightweight edge deployment impose different requirements on total parameters and quantization strategy. Sparse models also require consideration of expert weight distribution and communication topology.
    4. Training stability: Deep models, MoE, and large-scale distributed training are more sensitive to normalization placement, initialization, routing load balancing, and gradient scaling. Validate early through small-scale ablations and monitoring metrics.
    5. Capability-cost balance: More parameters do not guarantee task gains. Data quality, training token count, instruction alignment, retrieval augmentation, and tool-calling capability are often as important as parameter scale.

    4. The General Logic of Multi-Version Model Matrices

    Mature model families typically ship as a multi-version matrix rather than a single model for everything. Common tiering logic includes: a base version emphasizing general capability and cost balance; an enhanced version improving complex task performance through larger parameters, more training, or stronger alignment; a lightweight version reducing latency and cost via smaller active parameters, quantization, distillation, pruning, or cache optimization; a long-context version supporting long documents through positional encoding extension, attention optimization, and retrieval augmentation; and a high-throughput version optimizing scheduling and batching for bulk inference.

    Version evolution should not be understood as a simple “version number bump.” Developers should focus on these evaluation items:

    • Task quality: Accuracy, robustness, hallucination rate, and structured output compliance on your target business evaluation sets.
    • Performance metrics: Time-to-first-token, generation speed, throughput, P99 latency, and memory usage under long contexts.
    • Cost metrics: Cost per token, batching efficiency, cache hit rate, and quality loss after quantization.
    • Engineering capabilities: Context length, tool calling, structured output, multimodal input, safety filtering, and logging/monitoring.
    • Operability: Canary releases, version rollback, rate limiting and degradation, monitoring alerts, and capacity planning.

    5. Practical Selection and Evaluation for Developers

    When making a selection, define the task boundaries first, then build a three-dimensional evaluation across “quality—cost—latency.” Work from small to large: screen candidate architectures with a small evaluation set, verify throughput and latency with real traffic replay, and finally observe production metrics through a canary rollout. For long-context tasks, separately test cache memory and latency curves at different sequence lengths. For MoE models, watch expert load balancing and communication overhead across different batch sizes. For lightweight versions, verify that task degradation after quantization and distillation is acceptable.

    On the engineering side, batching, continuous batching, cache reuse, prefix caching, quantization, retrieval augmentation, and distillation are all common techniques. The key point: parameter scale is only the starting point. Architectural efficiency, data quality, inference scheduling, and the evaluation system together determine real-world usability. Only by aligning architecture, parameter metrics, and business KPIs can you build a reproducible, operable LLM selection strategy.