Anatomy of Modern LLMs: Architectures and Parameter Scales

    In recent years, large language models have undergone rapid iterations, with their architectural designs and parameter scales showing a blend of divergence and convergence. Moving beyond specific products, this article explores the structural forms, parameter distribution patterns, and underlying engineering trade-offs of mainstream LLMs from a general technical perspective.

    Anatomy of Modern LLMs: Architectures and Parameter Scales

    In recent years, large language models (LLMs) have entered a period of rapid iteration. The choices in architectural design and parameter scale across different models present a landscape where divergence and convergence coexist. Setting aside specific products, this article examines the structural forms, parameter distribution patterns, and the underlying engineering trade-offs of mainstream LLMs from a general technical perspective.

    1. The Architectural Foundation: Decoder-Only and Transformer

    Nearly all mainstream LLMs today adopt the Decoder-Only Transformer architecture. This structure generates text token by token in an autoregressive manner, utilizing causal attention masks to ensure consistency between training and inference. It has become the de facto standard for three primary reasons:

    1. High Scalability: As parameters, data, and compute scale synchronously, the performance of Decoder-Only structures improves in alignment with Scaling Laws, offering a clear and predictable trajectory.
    2. Engineering Maturity: Training frameworks, inference engines, and quantization toolchains are deeply optimized around this structure, forming a comprehensive ecosystem.
    3. Unified Task Paradigm: All tasks (Q&A, translation, coding, reasoning) can be transformed into a “continuation” or “next-token prediction” problem, eliminating the need for task-specific heads.

    At the component level, modern models universally adopt several features that have become standard:

    • Pre-Norm and RMSNorm: Mitigates training instability in deep networks while reducing computational overhead.
    • Rotary Position Embedding (RoPE) and its extensions: Supports long-context extrapolation, allowing models to process sequences far exceeding training lengths during inference.
    • SwiGLU activation functions: Offers better expressiveness at the same parameter count compared to traditional ReLU or GELU.

    2. Evolution of Attention Mechanisms: From MHA to MLA and Sparse Attention

    The attention mechanism is the computational bottleneck of the Transformer and the main battleground for architectural innovation in recent years. The primary evolutionary paths include:

    1. Grouped-Query Attention (GQA): Shares the same set of key-value heads across multiple query heads. It reduces the KV Cache memory footprint during inference severalfold with almost no loss in effectiveness, making it the mainstream choice for deployment-friendly models.

    2. Multi-head Latent Attention (MLA) and similar schemes: Compresses keys and values into a latent space via low-rank projection. This further drastically compresses the KV Cache, which is particularly crucial for ultra-long context scenarios.

    3. Sparse and Linear Attention Exploration: Includes concepts like sliding window attention and Lightning Attention. The goal is to reduce attention complexity from O(n²) to nearly O(n) to support million-token contexts.

    It is worth noting that the choice of attention structure is fundamentally a trade-off among effectiveness, memory, and throughput. Models with different target applications will make different compromises.

    3. Dense vs. MoE: Two Narratives of Parameter Scale

    When discussing “how large the parameter scale is,” one must first distinguish between two architectures; otherwise, the numbers are meaningless.

    Dense Models: Activate all parameters during every forward pass. Common tiers are as follows:

    Scale Tier Parameter Range Typical Positioning
    Small 1B–4B Edge devices, embedded scenarios
    Medium 7B–14B Single-GPU deployment, suitable for enterprise privatization
    Large 32B–72B Requires multiple GPUs, stronger general capabilities
    Extra Large 100B+ Rarely adopts the dense route nowadays

    Mixture of Experts (MoE): Contains dozens to hundreds of “expert” sub-networks per layer. Each token is routed to only a few of them (e.g., Top-2 or Top-8), typically accompanied by an always-active shared expert to guarantee general capabilities.

    The key concept in MoE is the separation of total parameters and activated parameters. For example, an MoE model with 600B+ total parameters might only activate about 30B–40B parameters per inference. Its inference cost is comparable to a dense model with the same number of activated parameters, but its knowledge capacity is far greater. This is the core motivation for flagship models shifting to MoE: trading sparsity for “high capacity at low cost.”

    The trade-offs of MoE are equally apparent:

    • All expert parameters must reside in memory; deployment memory requirements are calculated based on total parameters.
    • Routing load balancing and inter-expert communication introduce additional training complexity.
    • Fine-tuning and quantization are more engineering-intensive than with dense models.

    4. Key Understandings of Parameter Scale

    1. Parameter count does not equate to a capability ceiling. The scale and quality of training data, training compute, and post-training (SFT/RL) strategies are increasingly influential. A 7B model fully trained on 20 trillion tokens can significantly outperform a 30B model with insufficient data on most tasks.

    2. Three numbers must be evaluated together: “total parameters / activated parameters / training tokens.” To judge the true positioning of an MoE model, activated parameters determine inference cost, while the ratio of training tokens to activated parameters determines knowledge density.

    3. Inference cost and memory cost are two separate ledgers. For dense models, they are consistent; for MoE models, inference FLOPs are low but memory requirements are high. Deployment planning should be calculated separately: memory is estimated by total parameters × precision bytes (e.g., a 671B model under BF16 requires about 1.3TB of memory), while compute is estimated based on activated parameters and context length.

    5. Model Selection Advice for Developers

    • Private deployment with limited budget: Prioritize 7B–14B dense models. A single GPU can handle the load, and the engineering pipeline is the simplest.
    • Pursuing effectiveness with multi-GPU resources: 32B–70B dense models or small-to-medium MoEs offer a high cost-to-performance ratio.
    • High-concurrency online services: Pay attention to KV Cache size and attention structure. GQA/MLA designs can significantly reduce per-request costs.
    • Cloud API calls: Directly use model inference services provided by major cloud vendors. Billing per token avoids the fixed costs of building your own cluster. Validate business outcomes via APIs first before deciding whether to self-deploy.

    6. Conclusion

    The architecture of modern LLMs is converging towards a “Decoder-Only backbone + efficient attention + sparse capacity expansion” paradigm. The competition in parameter scale has also shifted from “stacking total volume” to a multi-dimensional balance of “total parameters, activated parameters, data volume, and training efficiency.” Understanding these structural patterns is more important than memorizing specific numbers—because numbers refresh every few months, whereas the trade-off logic behind the architectures remains relatively stable, serving as the truly reliable basis for technical selection.