LLM Architecture Evolution and Mixture-of-Experts: A Practical Technical Analysis

    Large language model capability is not determined by parameter count alone. This article explains how dense models, scaling laws, mixture-of-experts, and attention-cache optimizations allocate compute, organize knowledge, and shape training and serving cost, and it outlines a practical framework for research, architecture selection, and deployment.

    Understanding large language models means looking beyond parameter scale and not treating any single structural change as an automatic gain in capability. The practical questions are how limited compute should be allocated, how a model organizes knowledge, which parameters participate in inference, and what actually drives training and deployment cost.

    This article follows a general technical path across dense models, scaling laws, mixture-of-experts, and attention optimization. The goal is an analysis framework that applies to model research, technology selection, and engineering deployment.

    1. Start with the full picture: capability is not a function of one parameter

    A large language model typically includes token embeddings, stacked attention and feed-forward modules, and an output prediction layer. Text is tokenized into a sequence, the model predicts the next token from context, and training continuously updates the parameters.

    Several factors jointly determine the final result:

    • Data determines which knowledge and language patterns the model can encounter.
    • Architecture determines how information flows and how parameters are specialized.
    • The training objective and optimization strategy determine how the model learns from data.
    • Post-training determines how the model follows instructions, expresses answers, and meets application constraints.
    • The inference system determines whether those capabilities can be delivered at acceptable latency and cost.

    Architecture discussions should therefore separate learning capacity from serving efficiency. A design may sharply reduce computation per token while increasing cross-device communication. A caching scheme may reduce inference memory without improving answer quality on every task. Any evaluation must be tied to a specific workload.

    2. Dense models: the baseline for parameters, data, and compute

    The defining trait of a dense model is that each token generally passes through the same major parameters in every layer. The computation path is relatively fixed, and training and deployment behavior are easier to predict, which makes dense models a useful starting point for understanding more complex architectures.

    2.1 Parameter scale affects capacity and cost

    More parameters can increase a model’s potential to represent complex patterns, but they do not guarantee a return. If training data is insufficient, low quality, or the training run is unstable, a larger model may never use its capacity well.

    More parameters usually also mean:

    • Higher weight-storage requirements
    • Larger gradients and optimizer state during training
    • Heavier forward and backward computation
    • More complex device partitioning or stronger hardware at deployment

    “Larger” therefore means higher resource demand first, and only then a potential capability gain.

    Scaling laws describe empirical relationships among parameter count, training data volume, compute budget, and model loss. Within a range, adding parameters, data, or training compute usually reduces prediction loss, but the factors must be balanced.

    For dense models with similar structure, a rough relation is useful for thinking about training budget:

    Training compute ≈ constant × parameter count × number of training tokens

    This relation is only suitable for order-of-magnitude analysis. Context length, the attention implementation, activation recomputation, and hardware utilization all change actual consumption.

    Under a fixed budget, it is not safe to assume that “always scale the model” or “always add data” is correct. A sounder approach is to run small experiments, fit how loss changes for the current data and architecture, and then choose the combination of parameters and training tokens.

    If long-term serving cost also matters, the optimum can shift further. A smaller model trained on more data may not minimize training compute, but it can reduce the cumulative inference cost of a large volume of online requests.

    2.3 Data quality cannot be replaced by data volume

    High-quality data generally needs relevance, accuracy, diversity, and learnability. Large amounts of repeated content, formatting noise, incorrect answers, or material of unclear origin can reduce the return on training.

    Data governance should cover:

    • Removal of duplicate and near-duplicate content
    • Filtering of low-quality text
    • Control of domain and language distribution
    • Handling of privacy and sensitive information
    • Checks for evaluation-data leakage
    • Records of data sources, versions, and processing rules

    Overly aggressive quality filtering can also hurt long-tail coverage. The aim is not to keep only one kind of “standard text,” but to balance reliability and diversity.

    3. Mixture-of-experts: partially decoupling capacity from per-token compute

    Mixture-of-experts is a form of conditional computation. It typically replaces part of the feed-forward network with multiple expert networks and uses a router so that each token activates only a limited number of experts.

    A standard feed-forward network can be thought of as “every token uses the same processing module.” Mixture-of-experts is closer to “different processing modules are invoked according to input features.”

    3.1 Total parameters and active parameters are different metrics

    Total parameter count is every parameter in the model. It affects weight storage, loading, and the scale of distributed deployment.

    Active parameter count is the parameter scale actually used while processing one token. It is more closely tied to per-token compute cost. It is not an exact measure of computation, because different modules compute in different ways.

    If the model has E routed experts, each with about P parameters, each token selects K experts, and other modules that always participate have about B parameters, then roughly:

    Total parameters ≈ B + E × P

    Active parameters per token ≈ B + K × P

    This simplification shows that when K is much smaller than E, the model can have large total capacity without using every expert for every token.

    It does not mean the system only needs to store active parameters. Experts not selected by the current token still exist and usually must remain resident on some devices, or be loaded through an additional mechanism.

    3.2 Routing decides how experts collaborate

    The router uses a token’s hidden state to score experts, then selects a subset to run. Outputs from those experts are usually combined by the corresponding weights to form the layer result.

    Routing quality affects two things.

    First, expressive quality. If inputs are persistently sent to unsuitable experts, the model cannot form an effective division of labor.

    Second, execution efficiency. If most tokens concentrate on a few experts, those experts become hotspots while other devices sit idle, lowering overall throughput.

    Routing is not a minor module that can be ignored. It is central to both training and deploying a mixture-of-experts model.

    4. Fine-grained experts and shared experts: two ways to reduce redundancy

    4.1 Fine-grained experts increase combinatorial flexibility

    Under a similar expert-parameter budget, a design can use a few large experts or many smaller ones.

    Splitting experts more finely, and moderately increasing how many experts each token selects, provides richer combinations. The model does not have to place many abilities inside one large expert; several smaller experts can handle a token together.

    “Smaller experts are more specialized” is a design goal, not an automatic fact. The actual division of labor depends on data distribution, the routing strategy, and training. An expert should not be labeled a “math expert” or a “legal expert” without analysis.

    Finer granularity also has costs. More experts can make routing, dispatch, and scheduling more complex. If an individual expert receives too few tokens, matrix efficiency on the device can fall.

    4.2 Shared experts carry common patterns

    If every expert is dynamically routed, each one may have to relearn high-frequency language regularities and shared patterns, which creates redundancy.

    A shared expert provides a fixed computation path: a token passes through dynamically selected experts and also through the shared expert. The intent is to separate common patterns from conditional processing.

    A shared expert is not an explicit knowledge base, and it does not guarantee that “all common knowledge goes into the shared expert.” What it learns is still determined by the training objective and the overall optimization process.

    Because the shared expert always participates, it adds a fixed cost. If it is too large, sparse-computation gains shrink; if it is too small, it may not do the intended work. The ratio needs to be set by experiment.

    5. Load balancing and communication: the engineering difficulty of mixture-of-experts

    Mixture-of-experts reduces some computation but can introduce substantial communication. When experts live on different devices, tokens must be sent to the matching experts, and results must return and be combined.

    One expert-layer execution typically includes:

    1. Computing the routing decision
    2. Grouping tokens by target expert
    3. Sending inputs across devices
    4. Running the expert networks
    5. Returning and merging outputs

    End-to-end speed is therefore not determined by arithmetic volume alone. Network bandwidth, device topology, batch size, and load balance all matter.

    Training usually needs to avoid routing collapse onto a few experts. An auxiliary balancing objective is a common method, but an overly strong balance constraint can also interfere with the main task. Capacity management, scheduling rules, or routing adjustments can also ease hotspots, and each option has tradeoffs.

    Evaluation should record expert load distribution, communication time, device idle ratio, and abnormal token handling, not only the theoretical active-parameter count.

    6. Attention cache: a major cost of long-context deployment

    Mixture-of-experts mainly optimizes feed-forward computation. Long-context generation still faces the attention cache.

    In autoregressive inference, systems usually cache the keys and values of past tokens so that generating a new token does not recompute every historical representation.

    Under common implementations, cache footprint scales roughly as:

    Cache footprint ∝ number of layers × cached sequence length × key-value representation size × number of concurrent sequences × bytes per element

    A longer context or more concurrency can therefore consume memory quickly even when the weight size stays the same.

    6.1 Several ways to shrink the cache

    Common ideas include sharing keys and values across multiple query heads, storing the cache at lower precision, and keeping history in a compressed representation.

    One low-dimensional latent approach does not cache every expanded key and value directly. It caches a smaller representation and uses it with projection transforms during attention.

    Whether these methods run efficiently depends on the concrete structure and implementation. How positions are represented, whether projections can be fused, and whether extra reconstruction compute is required all affect the final gain.

    6.2 Cache optimization is not a capability upgrade

    A smaller cache usually helps raise sustainable concurrency or lower resource demand. It does not by itself mean the model understands long text more accurately.

    Long-context ability still has to be tested on tasks, for example:

    • Whether distant information can be found accurately
    • Whether relevant evidence can be distinguished from distractors
    • Whether consistency holds across passages
    • Whether citations and supporting evidence can be checked

    “The model can accept long text” and “the model can reliably use long text” are different questions.

    7. How developers build a reliable model evaluation process

    7.1 Define the business goal before reading architecture metrics

    Selection should start from the task. Question answering cares about factual reliability and evidence consistency. Code tasks care about logical correctness and executability. Batch text processing may care more about throughput and cost per completed task.

    At minimum, specify input length, output length, concurrency, latency targets, error tolerance, and data-security requirements.

    7.2 Measure prompt processing and token generation separately

    Inference usually has a prompt-processing stage and a token-by-token generation stage. The first processes the whole prompt; the second keeps generating new tokens on an existing cache. Their resource bottlenecks can differ.

    It is useful to record separately:

    • Time to the first output token
    • Average speed of later tokens
    • Overall throughput at different concurrency levels
    • Peak memory and cache growth
    • Differences among long-input/short-output and short-input/long-output cases
    • Tail latency near resource limits

    Good average throughput does not mean a stable interactive experience. A small number of requests that wait too long can still hurt service quality.

    7.3 Validate quality and cost on real samples

    Evaluation samples should cover real tasks and stay as separate as possible from training data and tuning samples. Beyond average scores, analyze failure types such as factual errors, missed instructions, unstable formatting, lost evidence in long text, and failed reasoning on complex problems.

    Cost should also be measured per successfully completed task, not only per generated token. If a design needs repeated retries or substantial manual correction, an apparent inference advantage can disappear.

    8. Conclusion: read architecture evolution through its bottlenecks

    The evolution of large language models can be read as a series of bottleneck optimizations:

    Scaling laws help set the mix of parameters, data, and compute. Data governance makes the training budget more effective. Mixture-of-experts expands capacity while limiting per-token computation. Fine-grained and shared experts try to improve specialization and reduce redundancy. Attention-cache optimization eases memory pressure in long-context serving. Distributed scheduling decides whether theoretical gains become real speed.

    These techniques are related, but they do not substitute for one another. Sparse computation does not mean low storage demand. Cache compression does not mean stronger reasoning. More total parameters do not mean a better business result.

    For developers and enterprise users, the reliable method is to break architecture into questions that can be checked: whether the data is trustworthy, how parameters are activated, how the cache grows, where communication happens, why latency fluctuates, and whether the model can complete real tasks consistently. Understanding those questions is what turns conceptual comparison into a deployable technical decision.