Modern LLM Architectures and Parameter Sizes Explained

    Explore the architecture patterns behind modern large language models, from decoder-only Transformers to dense and mixture-of-experts designs. Learn how total and active parameter counts, attention mechanisms, and inference optimizations affect memory requirements, deployment costs, and model selection.

    Modern LLM Architectures and Parameter Sizes Explained

    1. Why Architecture and Parameter Size Matter

    Large language models (LLMs) have advanced rapidly in recent years. Whether an application handles conversations, generates code, or analyzes documents, its capabilities depend heavily on the underlying model.

    For developers and enterprise technology teams, model selection, inference deployment, and cost estimation begin with two questions: How is the model structured, and how does its parameter count translate into resource requirements?

    Rather than benchmarking a particular model or vendor, this article examines the architectural patterns used across mainstream open and proprietary LLMs and explains the engineering considerations behind their parameter sizes.

    2. The Backbone: Decoder-Only Transformers

    2.1 From Encoder–Decoder to Decoder-Only

    Early pretrained language models generally followed one of three designs:

    • Encoder-only: Suited to language understanding tasks.
    • Encoder–decoder: Suited to sequence-to-sequence tasks.
    • Decoder-only: Suited to autoregressive text generation.

    As generative applications expanded and large-scale experiments validated the approach, decoder-only Transformers with causal self-attention became the dominant architecture for mainstream generative LLMs.

    The design offers several practical advantages:

    • Its training objective—next-token prediction—works naturally with large volumes of unlabeled text.
    • Its relatively simple structure supports greater depth and width, aligning with scaling-law approaches.
    • It supports incremental decoding with a key-value cache, or KV cache, using mature inference implementations.

    2.2 How the Core Components Have Evolved

    Within the decoder-only framework, several components have continued to evolve.

    1. Positional encoding: Many models have moved from absolute positional embeddings to rotary positional embeddings (RoPE). Position interpolation and frequency-scaling techniques help extend context windows from a few thousand tokens to hundreds of thousands, and in some models, a million or more.

    2. Attention mechanisms: Standard multi-head attention (MHA) can require substantial KV-cache memory during inference. Alternatives such as grouped-query attention (GQA) and multi-head latent attention (MLA) reduce cache requirements, lowering memory and bandwidth demands for long-context inference while aiming to preserve model quality.

    3. Normalization and feed-forward networks: Pre-normalization architectures using RMSNorm have become common alternatives to post-normalization designs using LayerNorm, supporting stable training in deep networks. Feed-forward layers also frequently use SwiGLU-style gated activations instead of conventional ReLU or GELU.

    A model configuration can be described through structural parameters such as these:

    1. hidden_size = 7168 # Hidden dimension
    2. num_layers = 61 # Number of Transformer layers
    3. num_attn_heads = 128 # Attention heads; GQA uses fewer KV heads
    4. ffn_intermediate = 18432 # Feed-forward intermediate dimension
    5. vocab_size = 128000+ # Vocabulary size
    6. context_length = 128K~1M # Context window

    3. Two Approaches to Scale: Dense Models and Mixture of Experts

    3.1 Dense Models

    In a dense model, the full network participates in each forward pass, rather than selecting a subset of expert networks. A rough parameter-count estimate is:

    1. Total parameters ≈ 12 × num_layers × hidden_size² + vocab × hidden_size

    This is an approximation; the exact count depends on the model’s attention and feed-forward configuration.

    Common dense-model sizes include 1B, 3B, 7B, 14B, 32B, and 70B parameters, where B means billion. Smaller models are better suited to on-device or single-machine deployment. Efficient inference with a 70B-class model often calls for multiple high-memory accelerators, typically combined with quantization.

    3.2 Mixture-of-Experts Models

    Mixture-of-experts (MoE) models replace selected feed-forward networks with multiple expert subnetworks. For each token, a router selects only a small subset of experts. A model might, for example, have 256 experts but activate only eight per token.

    This introduces a critical distinction:

    • Total parameters: All parameters in the model.
    • Active parameters: The parameters used to process an individual token.

    Flagship MoE designs can contain hundreds of billions or more than a trillion total parameters while activating only tens of billions per token. Publicly reported configurations include models with 671B total parameters and 37B active parameters, or approximately 1T total parameters and 32B active parameters.

    MoE has three major engineering implications:

    • Training efficiency: Sparse activation enables greater model capacity within a given compute budget.
    • Inference compute: Because only selected experts run for each token, inference FLOPs can be closer to those of a dense model with a comparable active parameter count than to a dense model with the same total parameter count.
    • Deployment complexity: The full set of weights still creates a substantial memory requirement, even though only a subset is active per token. Expert load balancing and routing stability also introduce training challenges.

    3.3 A Practical View of Model Sizes

    Public model releases broadly fall into the following categories. These ranges are useful reference points rather than fixed boundaries.

    Category Typical parameter scale Typical use
    Small on-device models 0.5B–4B Phones and edge devices
    Lightweight models 7B–14B Single-accelerator deployment and domain-specific fine-tuning
    Mid-sized to large dense models 30B–70B General-purpose applications and private enterprise deployment
    Flagship MoE models 300B–1T+ total; 20B–50B active High-end general-purpose capabilities
    High-speed or “Flash” variants Distilled or reduced versions of flagship models Low-latency, lower-cost inference

    4. Why Larger Models Can Still Run Faster

    A model with more total parameters can sometimes deliver faster inference than a smaller one. Three factors help explain this apparent contradiction:

    1. Sparse MoE activation: Total capacity increases without a proportional increase in per-token computation.
    2. Attention optimizations: GQA and MLA reduce KV-cache requirements and can ease memory-bandwidth bottlenecks during decoding.
    3. Inference engineering: Speculative decoding, multi-token prediction (MTP), quantization using formats such as INT8, FP8, or INT4, and continuous batching can improve inference efficiency and throughput.

    These techniques do not make parameter count irrelevant. They show why total parameters alone are insufficient for estimating deployment cost or speed.

    A meaningful assessment should also consider active parameters, KV-cache design, quantization support, and context length.

    5. Practical Guidance for Model Selection and Deployment

    5.1 Start With the Task, Then Choose the Size

    For customer support, summarization, and similar applications, a fine-tuned model in the 7B–32B range may be sufficient. Complex reasoning, programming, and mathematics tasks are stronger candidates for flagship models.

    The appropriate size depends on the capabilities the application actually needs, rather than the largest model available.

    5.2 Estimate Weight Memory First

    A useful starting point for model-weight memory is:

    • FP16: Approximately 2 GB per billion parameters.
    • INT8: Approximately 1 GB per billion parameters.
    • INT4: Approximately 0.5 GB per billion parameters.

    These estimates cover the weights, not the entire inference workload. Deployment planning must also reserve memory for the KV cache and concurrent requests.

    5.3 Consider Managed Inference Services

    Teams that do not want to build and operate inference clusters can use managed model services and cloud infrastructure. Combined with object storage, logging, monitoring, and alerting, these services can support a production workflow while allowing the team to focus on application logic.

    Service availability and supported deployment options should be checked in the provider’s official documentation.

    6. Conclusion

    Modern generative LLMs share a broadly convergent architectural foundation: the decoder-only Transformer, frequently combined with components such as RoPE, GQA or MLA, RMSNorm, and SwiGLU.

    At the same time, model scaling follows two distinct paths: relatively compact dense models and much larger, sparsely activated MoE models. Understanding total parameters versus active parameters is central to comparing their resource requirements and deployment economics.

    As architecture and inference engineering continue to evolve, model capability and deployment cost need not increase in lockstep. For practical model selection, parameter counts are a starting point—not a complete measure of performance, memory demand, or operating cost.