Hitting the Wall of Parameter Scaling: Data Quality and MoE Architecture Selection

    As parameter scaling yields diminishing returns in model performance, developers and enterprises must look beyond sheer model size. This article examines the critical bottlenecks in large language model training, focusing on data quality pipelines, routing and load balancing in Mixture of Experts (MoE) architectures, and large-scale engineering challenges. It provides a practical data cleaning script, MoE architecture evaluation metrics, and a comprehensive checklist to guide investment decisions between data curation, architecture tuning, and engineering stability.

    1. Why Model Scale and Capability No Longer Grow in Tandem

    In recent years, the industry has generally accepted an empirical rule: given sufficient data and training budgets, larger model parameters lead to stronger capabilities. This held true for a while. However, many teams have recently discovered that after doubling parameter scale, the marginal improvement in general capabilities has noticeably narrowed. Some models continue to advance on public leaderboards but perform mediocrely in real-world business scenarios.

    Parameter scale determines the upper limit of a model’s capacity to store knowledge, but its actual capability depends on three factors: whether the training data provides effective information, whether the model architecture applies compute to the right places, and whether the engineering system can stably execute training. If any of these becomes a weak link, the gains from parameter scaling will be partially offset.

    This conclusion has clear boundaries of application. It assumes that data volume is sufficient, the training process is stable, and evaluation metrics remain consistent across different models. If any of these three prerequisites fails, simply comparing parameter counts loses its reference value.

    For developers, using only parameter count to measure a model easily overestimates the return on investment. For enterprises, allocating the entire budget to scaling up while neglecting data and evaluation will likely incur costs in performance, cost-efficiency, and stability later. The following sections analyze these three aspects in detail.

    2. Data Quality: The Underestimated Primary Bottleneck

    2.1 Noise and Duplication Are Amplified by Scale

    Pre-training data typically comes from large-scale web crawling, code repositories, books, and user-generated content. The common issue with such data is uneven quality. Page templates are heavily duplicated, machine-generated low-quality text is rampant, and annotation errors, garbled characters, and low-information-density content are mixed in.

    The model’s training objective is to fit the data distribution. When effective information accounts for a low proportion of the data, the model must use its parameter capacity to memorize noise and repetitive patterns. The larger the parameters, the more space there is to memorize noise, but generalization capability does not necessarily improve. Therefore, in many scenarios, the benefits of data cleaning outweigh those of simply expanding training scale.

    2.2 Key Steps in the Data Cleaning Pipeline

    A reliable data pipeline typically includes the following steps:

    1. Format Normalization: Unify encoding, remove control characters, and standardize whitespace and punctuation.
    2. Length and Language Filtering: Remove texts that are too short and samples with low language identification confidence.
    3. Quality Scoring: Use rules or small classification models to evaluate readability, information density, and structural integrity.
    4. Deduplication: Divided into exact and near-deduplication. Exact deduplication is based on hash values, while near-deduplication often utilizes Locality-Sensitive Hashing (LSH) or n-gram similarity.
    5. Proportion Control: Adjust sampling weights by domain, language, and difficulty to prevent a single category of data from dominating.
    6. Evaluation Set Isolation: Compare hashes or n-grams of evaluation questions against the training corpus; if there is a match, remove it from the training data.

    2.3 A Runnable Cleaning Example

    The script below relies only on the Python standard library and requires Python 3.9 or above. It sequentially performs format normalization, length filtering, repetitive sentence ratio filtering, and exact deduplication, outputting results one by one via a generator. Thus, its memory footprint does not grow linearly with corpus size.

    1. import hashlib
    2. import re
    3. from collections.abc import Iterable, Iterator
    4. MIN_CHARS = 50
    5. MAX_REPEAT_RATIO = 0.3
    6. def normalize(text: str) -> str:
    7. text = text.replace("\u3000", " ")
    8. text = re.sub(r"[\x00-\x08\x0b\x0c\x0e-\x1f]", "", text)
    9. return re.sub(r"\s+", " ", text).strip()
    10. def repeat_ratio(text: str) -> float:
    11. # Calculate repetition ratio by sentences. Chinese has no spaces for tokenization, so use Chinese punctuation to split sentences.
    12. sentences = [s.strip() for s in re.split(r"[。!?]", text) if s.strip()]
    13. if not sentences:
    14. return 1.0
    15. return 1 - len(set(sentences)) / len(sentences)
    16. def content_hash(text: str) -> str:
    17. return hashlib.sha256(text.encode("utf-8")).hexdigest()
    18. def clean_corpus(docs: Iterable[dict]) -> Iterator[dict]:
    19. seen_hashes: set[str] = set()
    20. stats = {"total": 0, "short": 0, "repeat": 0, "duplicate": 0, "kept": 0}
    21. for doc in docs:
    22. stats["total"] += 1
    23. text = normalize(doc.get("text", ""))
    24. if len(text) < MIN_CHARS:
    25. stats["short"] += 1
    26. continue
    27. if repeat_ratio(text) > MAX_REPEAT_RATIO:
    28. stats["repeat"] += 1
    29. continue
    30. digest = content_hash(text)
    31. if digest in seen_hashes:
    32. stats["duplicate"] += 1
    33. continue
    34. seen_hashes.add(digest)
    35. stats["kept"] += 1
    36. yield {**doc, "text": text}
    37. # Output the count of each filter type after iteration to review whether the thresholds are reasonable
    38. print(stats)
    39. if __name__ == "__main__":
    40. base = "Large model training data needs cleaning to remove duplicate pages, garbled text, and low-information-density text, so parameters can be better used to learn effective knowledge."
    41. sample = [
    42. {"id": 1, "text": base},
    43. {"id": 2, "text": base}, # Exactly the same as item 1
    44. {"id": 3, "text": "Too short."}, # Less than 50 characters
    45. ]
    46. for item in clean_corpus(sample):
    47. print(item["id"])

    How to run: Save the code as clean_demo.py, then execute python clean_demo.py. The output is 1, followed by the statistics dictionary {'total': 3, 'short': 1, 'repeat': 0, 'duplicate': 1, 'kept': 1}. Item 2 is identical to item 1 and is deduplicated; item 3 is filtered out by length for being under 50 characters.

    There are three points to note when using this. First, thresholds need to be adjusted according to the actual data distribution; the 50 characters and 0.3 ratio above are just starting points. Second, run it on a copy of the original corpus and retain the unprocessed raw data for easy rollback. Third, repeat_ratio counts by sentences and cannot identify repeated phrases within long sentences, so it needs to be used in conjunction with n-gram detection.

    Exact deduplication does not require choosing a threshold; identical hashes are considered duplicates. Near-deduplication requires a threshold. A common approach is using MinHash to estimate Jaccard similarity, starting around 0.8, extracting a few hundred pairs of samples to manually check the false deletion rate, and then deciding whether to adjust it up or down.

    3. Routing and Load Balancing in MoE Architectures

    Mixture of Experts (MoE) models split the feedforward network into multiple experts, with each token activating only a few of them. The total parameter count of the model can be very large, while the number of parameters actually computed during each inference is small. This allows parameter scale and computation cost to be measured separately.

    3.1 Routing Strategy

    The router calculates the score of each expert for every token, usually selecting the top k experts with the highest scores, where k is often 1 or 2. The router’s output is normalized and used as the weighting coefficient for each expert’s output.

    When evaluating routing, three things need attention: how many experts are actually activated per token, whether activation is concentrated on a few experts, and whether routing is stable across data from different domains. If a certain type of task always falls on the same batch of experts, it means the router has not learned effective division of labor.

    3.2 Load Balancing

    Without constraints, the router tends to assign most tokens to a few popular experts. The popular experts are continuously overloaded, while the rest receive little training, wasting model capacity.

    There are two common approaches. One is adding an auxiliary loss to the loss function, encouraging the number of tokens received by each expert to approach the average. The other is adding a bias term to the routing scores, dynamically adjusted during training to balance the load. Both methods have hyperparameters to control the strength. Too much strength suppresses the router’s selection ability, while too little fails to prevent expert collapse.

    Monitoring metrics include the load proportion of each expert, the ratio of maximum load to average load, and the entropy of the load distribution. A continuously increasing ratio usually indicates expert collapse.

    3.3 Capacity Factor and Token Dropping

    To ensure regular parallel computation across devices, each expert usually sets a capacity limit. The limit is generally derived by multiplying the capacity factor by the average number of tokens each expert should process. Tokens exceeding the capacity are dropped or passed directly through only a residual connection.

    If the capacity factor is set too low, it causes token dropping, which harms performance. If set too high, it wastes VRAM and compute. During evaluation, the token dropping rate and VRAM usage should be reported simultaneously.

    3.4 Architecture Evaluation Points

    1. Align comparison objects: When comparing dense models with MoE models, use the same number of activated parameters or a similar single-inference compute cost, rather than just comparing total parameter counts.
    2. Calculate full costs: All experts in an MoE need to reside in VRAM. Inference VRAM usage may be much higher than that of a dense model corresponding to the activated parameter count.
    3. Visualize routing behavior: Log expert load, routing entropy, and dropping rate to observe their changes over training steps.
    4. Evaluate by domain: Overall scores may mask degradation in certain domains; split reports by task type.

    4. Ultra-Large-Scale Engineering

    Expert parallelism requires massive all-to-all communication. Bandwidth and latency between nodes will directly limit throughput, and the proportion of communication overhead in total time should be tracked separately.

    Training cycles are long, and hardware failures are inevitable. Checkpoint saving frequency requires trade-offs between storage costs and rollback loss after a failure. Recovery procedures must be drilled periodically; otherwise, it may be impossible to resume training within the expected time when a failure occurs.

    Loss spikes during training are a common issue. When spikes occur, you should be able to trace them back to specific data batches and routing states to determine whether the problem stems from data, learning rate, or routing imbalance.

    Reproducibility is also important. Fixing random seeds, logging data versions, and saving configuration files allow for comparisons between different experiments when anomalies occur.

    5. Selection Checklist

    Before committing to training or selecting a model, check the following items one by one.

    Data Side

    • Noise rate: Manual sampling check, recording the proportion of low-quality samples
    • Duplication rate: Exact and near-duplicates tracked separately
    • Language confidence: Proportion of samples below the threshold
    • Evaluation contamination: Overlap check between training corpus and evaluation set completed
    • Domain proportion: Clear record of sampling weights for each domain
    • Quality score threshold: Threshold calibrated using manually annotated samples

    Architecture Side

    • Activated parameter count and total parameter count recorded separately
    • Routing top-k settings and actual activations per token
    • Ratio of maximum to average expert load
    • Token dropping rate
    • VRAM usage and inference latency

    Engineering Side

    • Failure recovery time measured
    • Checkpoint strategy matches storage budget
    • Communication overhead proportion tracked
    • Random seeds, data versions, and configurations archived

    Metrics Calibration

    • All compared models use the same evaluation set and prompt template
    • Report scores with sample size and confidence intervals
    • Report split by domain

    6. Guidelines for Data and Parameter Investment

    Scenario Priority Investment Reason
    High data duplication and noise ratio Data cleaning and deduplication Scaling up amplifies noise memorization
    Clean data, but insufficient domain coverage Data supplementation and proportion adjustment Missing domain capabilities cannot be compensated by parameters alone
    Data quality meets standards, but evaluation scores stagnate Check architecture and routing Compute resources may not be applied to the right places
    Frequent training interruptions Engineering stability Interruptions drastically shorten effective training time