LLM Architecture Evolution: Scaling Laws and the Practice of MoE Sparsification

    This article explains why scaling up a large language model is not an automatic win, and how Mixture-of-Experts (MoE) sparsification changes the cost equation. It covers the precondition that makes scaling laws hold (high-quality data), the concrete data engineering steps behind it (deduplication, quality tiering, mixture and curriculum design, traceability), and the practice of running small-scale proxy sweeps before committing to one large run. It then walks through fine-grained experts and shared experts, the load-balancing constraints they require, and the training-versus-inference cost differences that determine real throughput. A final checklist helps teams evaluate data, scaling behavior, structure, stability, cost, and reproducibility.

    1. The Starting Point: Why “Scaling Up” Needs to Be Re-Argued

    The first generation of LLM engineering practice usually had to answer three questions: how large should the model be, how much data should it use, and where should compute be invested. Early community work treated scaling laws as an almost automatically valid conclusion, assuming that scaling parameters, data, and compute together would yield smooth improvements. In real training, however, this behavior is far more complex than the slogan suggests: under the same compute budget, adding more data may buy only marginal gains, while blindly enlarging parameters can easily cause overfitting and unstable training on limited data.

    A more reliable engineering statement is therefore this: scaling laws are valid, but their validity depends on a precondition — data quality must be high enough. When a corpus contains a large amount of duplicated, templated, noisy, or low-information-density text, the model spends its capacity memorizing redundant patterns, and the gains from scale are significantly diluted. In other words, scaling is not a linear function of “more data is better,” but a function of effective information volume.

    This judgment directly changes how compute is allocated. Given adequate data quality, investing the same compute in enlarging the model usually pays off better than continuing to expand low-quality corpora; when data quality is substandard, any increase in scale simply amplifies noise. The question thus moves upstream, from “how many accelerators should we buy” to “how do we define and measure data quality.”

    2. Data Quality: The Undervalued First-Order Engineering Problem

    High-quality data is not an adjective in engineering; it is a set of executable, measurable processes.

    • Deduplication and near-deduplication: exact duplicates can be removed with hashing, while near-duplicates require paragraph-level similarity clustering and filtering to keep the same template from recurring across the corpus.
    • Quality tiering: combine rules (length, symbol ratio, language-identification confidence) with model-based scoring (perplexity, classifier confidence) to grade documents, then sample by tier during training rather than treating all documents equally.
    • Mixture and curriculum: the proportions of code, math, encyclopedic, and conversational sources significantly affect the capability distribution; leaning toward general and structured text early in training and gradually raising the share of high-quality reasoning samples later usually helps stability.
    • Traceability and reproducibility: the source, cleaning rules, and sampling weights of every data batch must be archived, otherwise the conclusions of scaling experiments cannot be attributed.

    The illustrative tiering and sampling logic can be written as the following pseudocode; the point is configurability and reproducibility, not a specific implementation:

    1. # Corpus tiering and weighted sampling (illustrative)
    2. def build_mixture(docs, quality_fn, weights):
    3. buckets = {"high": [], "mid": [], "low": []}
    4. for d in docs:
    5. q = quality_fn(d) # fusion of rule-based and model-based scoring
    6. buckets["high" if q > 0.8 else "mid" if q > 0.5 else "low"].append(d)
    7. # keep only a small share of the low tier for robustness, so it does not dominate gradients
    8. return weighted_sampler(buckets, weights={"high": 0.7, "mid": 0.25, "low": 0.05})

    3. Set Direction at Small Scale, Then Commit at Large Scale

    Launching large-scale training before the direction is clear is the most expensive way to trial-and-error. A more engineering-driven path is “small-scale sweep + law extrapolation + a single large-scale run”:

    1. Use a set of reduced-scale proxy models to sweep hyperparameters such as learning rate, batch size, width-to-depth ratio, and initialization scale under a limited compute budget;
    2. Observe loss curves and gradient statistics to identify stable ranges rather than chasing a single optimum point;
    3. Extrapolate to the target scale using the scaling relationship, leaving a safety margin;
    4. Freeze the configuration in the formal run to reduce the incomparability caused by mid-run parameter changes.

    The benefit is not only saved compute, but more importantly comparability across experiments. If every experiment changes both the data mixture and the hyperparameters at once, conclusions cannot be attributed, and scaling laws degrade into after-the-fact narrative.

    4. Sparsification: Trading Conditional Computation for Capacity

    In a dense architecture, every token passes through all parameters, so capacity and compute are tightly coupled. The Mixture-of-Experts architecture replaces the feed-forward layers of a Transformer with several expert networks and selects only a few experts per token, so total parameter count rises while per-token compute stays roughly unchanged. This is conditional computation: capacity is allocated on demand rather than consumed constantly.

    Conventional sparse designs typically use a small number of large experts with Top-K routing. The problem is that expert granularity is too coarse: a single expert is forced to hold multiple kinds of knowledge at once, limiting specialization; different experts also tend to learn highly overlapping common knowledge, creating parameter redundancy and lowering training efficiency.

    5. Fine-Grained Experts and Shared Experts: Two Key Modifications

    The first modification is splitting experts. Dividing each expert into more, smaller sub-experts while increasing the number of experts selected by routing keeps total activated parameters roughly unchanged, but greatly enlarges the combination space and raises the “resolution” of routing, making genuine functional differentiation among experts easier.

    The second modification is introducing shared experts. General cross-domain knowledge is extracted into a small number of always-active shared experts that every token passes through; the remaining fine-grained experts only need to learn differentiated knowledge and no longer have to carry common patterns redundantly. This directly compresses redundancy and makes routing decisions focus on differences.

    The structure can be abstracted conceptually as:

    1. input token
    2. |- shared experts (always active, carrying common knowledge)
    3. └- routing network -- Top-K -- subset of fine-grained experts (differentiated knowledge)
    4. output = shared output + weighted aggregation of expert outputs

    The engineering constraint to stress is that fine-graining amplifies the risk of load imbalance. The more experts there are, the higher the probability that popular experts are over-selected; without constraints, training degrades into a few experts dominating. Common practices include an auxiliary load-balancing loss, adding noise to routing scores to encourage exploration, and setting expert capacity limits that drop or cache overflow tokens. These mechanisms all affect final quality and are steps that must be designed explicitly, not optional extras.

    6. From Training to Inference: The Cost Account Must Be Recomputed

    On the training side, the benefit of a sparse architecture shows up as compute savings from fewer activated parameters, but memory usage does not fall proportionally: all expert parameters must still reside in memory, and distributed training adds the communication overhead of expert parallelism. The inference side is more complex: per-token compute drops, but routing adds scheduling and memory-access costs, and in batching, different requests hit different experts, which easily causes load skew and lower utilization.

    Evaluating a sparse design therefore requires more than parameter count and activation ratio. At minimum, observe per-token activated parameters, peak memory, cross-device communication volume, the distribution of expert hits within a batch, and end-to-end throughput and tail latency. Engineering practice usually needs capacity planning, request aggregation, and caching strategies to turn theoretical sparsity gains into actual throughput.

    7. Deployment Checklist

    • Data: are exact and near deduplication, quality tiering, source archiving, and mixture experiments complete;
    • Laws: has hyperparameter sweeping been done on small-scale proxy models, with an extrapolatable scaling relationship;
    • Structure: are expert granularity, the number of shared experts, and the Top-K value backed by ablation experiments;
    • Stability: are there a load-balancing loss, routing noise, capacity limits, and overflow handling;
    • Cost: are memory, communication, throughput, and tail latency evaluated together rather than activation parameters alone;
    • Reproducibility: are configuration, data versions, and random seeds fixed, and can experimental conclusions be attributed.

    8. Conclusion

    The evolution of LLM architecture is essentially turning “scale” from coarse stacking into fine-grained scheduling: first use high-quality data to make scaling laws genuinely hold, then use conditional computation to place capacity where it is needed. The former sets the ceiling; the latter sets cost-effectiveness. Combining the two is what delivers capability, stability, and cost control at the same time under a limited compute budget. If a team lacks its own clusters and tuning experience, it can also rely on foundational capabilities such as the general container platform, object storage, logging, and monitoring and alerting offered by Baidu AI Cloud, and first solidify the two foundations of data governance and experiment reproducibility.