Abstract
The performance of Large Language Models (LLMs) is fundamentally constrained by the quality of their pre-training data. Traditional data selection methods prioritize linguistic fluency and low perplexity, often inadvertently discarding dense, informative content that is critical for knowledge-intensive tasks. We present the High-Knowledge Scorer (HKS), a computationally efficient, gradient-free framework designed to identify and select "knowledge-dense" data. By utilizing a pool of 5 million knowledge elements across diverse domains, HKS evaluates documents based on knowledge density and coverage. Our experiments demonstrate that HKS-selected data leads to a 2.37 percentage point improvement over random selection in 1.1B parameter models and scales effectively to larger architectures like Llama-3-8B, particularly in reasoning and domain-specific benchmarks.
1. Introduction
The "garbage in, garbage out" principle remains the dominant paradigm in LLM development. As the volume of available web-crawled data grows, the challenge shifts from data acquisition to data curation. Current state-of-the-art filters typically rely on fluency (grammatical correctness) or perplexity (how predictable the text is to a reference model).
However, these metrics suffer from a significant limitation: a text can be perfectly fluent yet informationally vacuous. Conversely, highly specialized scientific literature or technical reports may exhibit high perplexity due to their dense terminology, leading traditional filters to discard them. This results in "knowledge scarcity," where models are trained on vast amounts of conversational or repetitive data but lack the factual depth required for complex reasoning. HKS addresses this by mathematically defining and extracting knowledgeable data from massive, heterogeneous datasets.
2. Methodology
2.1 The Knowledge Element Pool
To quantify knowledge, we move away from complex semantic triplets (subject-verb-object) in favor of "knowledge elements"—n-gram nouns associated with specific concepts, theories, or facts. We constructed a reference pool of 5 million elements categorized into five primary domains: Science, Society, Culture, Art, and Life, sourced from Wikipedia and academic corpora.
2.2 Scoring Metrics
HKS evaluates a document $x$ using two primary metrics:
- Knowledge Density ($d$): The ratio of knowledge elements to the total number of tokens. This metric identifies documents that are rich in factual content relative to their length.
- Knowledge Coverage ($c$): The count of unique knowledge elements within the text. This metric identifies documents that span a wide breadth of topics.
2.3 The Scoring Function
Empirical analysis suggests that density and coverage are largely independent. To find the "sweet spot" between deep-dives and broad summaries, we employ the following scoring function:
$$score(x) = d(x) \cdot \ln(c(x) + 1)$$
This function allows for efficient, CPU-based ranking using string-matching algorithms (such as Aho-Corasick), making it viable for petabyte-scale data processing without the need for expensive GPU inference.
3. Experimental Setup
We evaluated HKS using a 20B token bilingual dataset (English and Chinese) extracted from The Pile and Wudao. Performance was measured across 16 sub-tasks, including knowledge-intensive benchmarks (MMLU, CMMLU, C-Eval, ARC-C) and general reasoning tasks (BBH, BoolQ, RTE). To test scalability, we performed continual pre-training on Llama-3-8B using 100B tokens of HKS-selected data.
4. Results and Discussion
4.1 Performance Gains
The 1.1B model trained with HKS outperformed random selection by an average of 2.37 percentage points across all benchmarks. Notably, HKS surpassed established baselines such as DSIR (Importance Resampling) and PPL-based selection, particularly in knowledge-heavy domains. When applied to Llama-3-8B, the method yielded improvements of 3.8 pp on CMMLU and 2.7 pp on C-Eval compared to random baselines.
4.2 Fluency vs. Knowledge
Our analysis revealed a very low correlation between HKS scores and traditional Perplexity (PPL). This confirms that current "high-quality" filters likely discard some of the most informative data because it does not conform to standard conversational patterns. By decoupling knowledge from fluency, HKS preserves the informational core of the training set.
4.3 Impact on Reasoning
An unexpected finding was that selecting for high-knowledge data significantly improved performance on reasoning tasks like Big-Bench Hard (BBH). This suggests that a richer factual foundation provides the necessary "raw material" for a model to develop better logical and deductive capabilities.
4.4 Domain-Specific Optimization
HKS allows for "domain-aware" selection. By restricting the scorer to the "Science" element pool, we observed a performance boost of up to 2.49 pp in scientific tasks compared to random baselines, demonstrating the framework's utility for specialized model tuning.
5. Conclusion
The High-Knowledge Scorer offers a scalable and effective solution to the problem of knowledge scarcity in LLM training. By prioritizing information density and diversity over mere linguistic smoothness, HKS enables models to achieve higher performance with less data. Future work will focus on expanding the knowledge element pool to include emerging topics and refining the filtering of the reference pool to ensure the highest quality of knowledge extraction.
Summary updated