Abstract
High-quality data is crucial for the pre-training performance of large language models. Unfortunately, existing quality filtering methods rely on a known high-quality dataset as reference, which can introduce potential bias and compromise diversity. In this paper, we propose ScalingFilter, a novel approach that evaluates text quality based on the perplexity difference between two language models trained on the same data, thereby eliminating the influence of the reference dataset in the filtering process. A theoretical analysis shows that ScalingFilter is equivalent to an inverse utilization of scaling laws. Through training models with 1.3B parameters on the same data source processed by various quality filters, we find ScalingFilter can improve zero-shot performance of pre-trained models in downstream tasks. To assess the bias introduced by quality filtering, we introduce semantic diversity, a metric of utilizing text embedding models for semantic representations. Extensive experiments reveal that semantic diversity is a reliable indicator of dataset diversity, and ScalingFilter achieves an optimal balance between downstream performance and semantic diversity.
Introduction
The performance of Large Language Models (LLMs) is fundamentally constrained by the quality of their training data. As the field moves toward increasingly massive datasets, the "garbage in, garbage out" principle becomes a critical bottleneck. Traditionally, researchers have relied on two main strategies for data filtering: reference-dependent filtering and perplexity gating.
Reference-dependent methods use a classifier trained on "gold standard" datasets like Wikipedia or academic books to select similar web text. While effective, this approach introduces a significant "style bias," potentially excluding diverse, non-academic content that could be valuable for general-purpose reasoning. Conversely, perplexity gating is reference-free, keeping text that a pre-trained model finds easy to predict. However, this often favors repetitive or overly simplistic content that offers little learning value.
The ScalingFilter Methodology
ScalingFilter introduces a reference-free alternative that identifies high-quality data based on its "learnability." The core innovation is the Quality Factor ($d$), defined as the ratio of perplexities between a small and a large language model trained on the same data:
$$d = \frac{PPL_{small}}{PPL_{large}}$$
The intuition is that high-quality data contains complex logical structures that a larger model can "understand" significantly better than a smaller one. In contrast, low-quality noise or repetitive gibberish is either equally easy or equally difficult for both models, resulting in a smaller gap.
Theoretical Foundation: Inverse Scaling Laws
The authors demonstrate that this Quality Factor is an inverse application of the Chinchilla scaling laws. Scaling laws describe how model performance improves as a function of parameters and data size. ScalingFilter posits that high-quality data is characterized by a higher scaling exponent—meaning that increasing model size yields a greater reduction in loss compared to low-quality data.
By using the ratio of two models, the "inherent difficulty" of the text is effectively normalized. This allows the filter to identify high-quality content across varying levels of complexity, from simple narratives to dense technical papers, without the bias inherent in absolute perplexity scores.
Experimental Results and Semantic Diversity
To validate ScalingFilter, the authors processed 500 GB of CommonCrawl data and trained 1.3B parameter models from scratch. The results across various benchmarks (including Hellaswag, PIQA, and ARC) showed that ScalingFilter-selected data led to an average accuracy of 51.27%, outperforming both random selection (48.18%) and standard perplexity gating (50.15%).
Beyond raw performance, the study introduced a Semantic Diversity metric to quantify how much "semantic space" a dataset covers using text embeddings. ScalingFilter achieved a diversity score of 54.73, significantly higher than the 50.03 achieved by perplexity gating. This indicates that ScalingFilter preserves the breadth of knowledge found in raw web data while removing low-quality noise.
Conclusion
ScalingFilter offers a robust, reference-free framework for data curation that aligns with the fundamental scaling properties of language models. While it requires additional computation to score datasets using multiple models, the gains in model performance and the preservation of semantic diversity make it a compelling choice for pre-training high-quality LLMs. Future work will focus on optimizing the computational efficiency of the scoring process and addressing potential factual accuracy and social biases in the filtered data.
Summary updated