Where Do Differences in Large Language Model Capabilities Come From? Sparse Architectures and Inference Design Explained

    Model capability, cost, and stability are shaped by more than parameter count. This article examines how architecture, training choices, Mixture-of-Experts sparsity, and inference-time computation affect LLM performance, along with the engineering trade-offs involved in routing and distributed execution.

    1. Why Model Comparisons Cannot Rely on Intuition Alone

    Many discussions reduce model comparisons to questions such as “Which model is smarter?” or “Which one is cheaper?” These judgments can be useful as a starting point, but they are not sufficient for engineering decisions. The same model may perform consistently in code generation while producing less reliable results when summarizing long documents.

    To understand why models differ, several technical dimensions must be separated:

    • Model architecture
    • Training data and training recipe
    • The computation budget used during inference
    • Server-side engineering and deployment configuration

    2. Architectures Are Converging, So Differences Often Come from Hyperparameters and Training

    Most mainstream large language models released over the past two years are based on the Transformer decoder architecture. They commonly use mature components such as rotary positional embeddings, RMSNorm, and SwiGLU-style activation functions. In the attention layer, variants of multi-head attention—such as grouped-query attention and latent key-value compression—are increasingly used to reduce memory consumption during inference.

    As a result, differences between models often come from the following factors:

    • The combination of hyperparameters, including the number of layers, hidden dimensions, and attention heads
    • The number of experts and the routing strategy used in a Mixture-of-Experts architecture
    • The scale, quality, and composition of pretraining data
    • The data and reward design used during post-training, including instruction tuning, preference optimization, and reinforcement learning

    When evaluating model strength, it is important to clarify whether the comparison concerns architecture, parameter scale, or final performance on a specific task. These factors are related, but none can substitute for the others.

    3. Mixture-of-Experts: Total Parameters vs. Active Parameters

    A Mixture-of-Experts (MoE) architecture divides the feed-forward network into multiple expert sub-networks. Each token is processed by only a small number of experts selected by a routing mechanism.

    This creates two parameter concepts that must be distinguished:

    • Total parameters: These determine the model’s knowledge capacity and affect weight storage and memory usage.
    • Active parameters: These determine the amount of forward computation performed for each token and therefore affect the compute cost of a single inference pass.

    If a model has a very large total parameter count but activates only a small portion of its parameters for each token, its inference workload can be close to that of a dense model with a comparable active parameter count, while its knowledge capacity can be closer to that of a much larger model. This is the most direct benefit of sparsity.

    Increasing the number of experts while keeping the number of activated experts per token unchanged is a common way to increase sparsity. A large body of experimental work suggests that, within an appropriate range, higher sparsity can reduce training loss at a similar computational cost. However, the benefits gradually diminish and introduce several engineering challenges:

    1. Uneven routing: Some experts may become overloaded while others remain underused. Load-balancing losses or capacity constraints are needed to control this issue.
    2. Communication overhead: During distributed training, experts may be placed on different devices. Tokens must then be dispatched across devices, making network bandwidth a potential bottleneck.
    3. Training stability: Routing decisions are not directly differentiable, so additional techniques are required to ensure convergence.

    The following simplified top-k routing example illustrates the computation flow:

    1. import torch
    2. import torch.nn.functional as F
    3. def moe_forward(x, gate, experts, top_k=2):
    4. # x: [tokens, hidden]
    5. logits = gate(x) # [tokens, num_experts]
    6. weights, idx = torch.topk(logits, top_k, dim=-1)
    7. weights = F.softmax(weights, dim=-1) # Normalize over the selected experts
    8. out = torch.zeros_like(x)
    9. for k in range(top_k):
    10. for e, expert in enumerate(experts):
    11. mask = idx[:, k] == e
    12. if mask.any():
    13. out[mask] += weights[mask, k:k+1] * expert(x[mask])
    14. return out

    This code omits load-balancing losses and capacity constraints. It only demonstrates the three basic steps: scoring, selection, and weighted aggregation.