NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Text Quality-Based Pruning for Efficient Training of Language Models

Vasu Sharma, Karthik Padthe, Newsha Ardalani, Kushal Tirumala, Russell Howes, Hu Xu, Po-Yao Huang, Daniel Li Chen, Armen Aghajanyan, Gargi Ghosh, Luke Zettlemoyer · DOI

TL;DR

This paper introduces a novel, model-agnostic method to numerically score the quality of text in large, unlabeled datasets. By pruning low-quality text based on these scores, they demonstrate significant improvements in language model training efficiency, achieving comparable or better performance with less data and faster training times.

What Problem Does This Paper Address?

Training large language models (LLMs) is incredibly computationally expensive, requiring massive datasets and significant processing power. This process is further complicated by the fact that these large datasets are often uncurated and can contain "noisy" or harmful content, which LLMs can inadvertently learn. While previous work has explored text quality assessment, existing automated methods are often model-dependent, defeating the purpose of efficient training, or rely on subjective human evaluations that don't scale. This paper tackles the challenge of efficiently training LLMs by developing a scalable, model-agnostic way to identify and remove low-quality text from training data.

Methods

The core of this paper is a two-step methodology for computing text quality:

  1. Weight Calculation: The authors leverage 14 heuristic-based filters that capture various linguistic characteristics of text. These filters assess aspects like text complexity (e.g., parse tree depth), word repetition, syntax, and the presence of special characters. For each filter, they create a subset of the dataset and measure the validation perplexity of a pre-trained LM on this subset compared to the original, unfiltered dataset. A formulation is then used to assign a weight to each filter based on how much it influences perplexity. Filters that significantly reduce perplexity are given higher weights.
  2. Quality Scoring: Each document is broken down into lines, and the heuristic filters are applied to each line, generating an indicator matrix. Using the weights calculated in the previous step, a quality score is computed for each line. These line scores are then aggregated into a document-level score, weighted by the token count of each line. This results in a numerical "quality score" for each text instance.

Once these scores are computed, the paper employs quality-guided data pruning. This involves selecting a desired fraction of the dataset (e.g., top 20%, 40%, 60%, 80%) based on the computed quality scores, effectively removing low-quality samples. The pruned dataset is then used for subsequent LM training.

Datasets

The experiments were conducted on English-only versions of the following datasets:

  • Wikipedia: A large dataset derived from Wikipedia dumps, containing 4.67 billion tokens before pruning.
  • OpenWebText: An open-source version of the WebText dataset used for GPT-2 training, built from Reddit posts. The base version contains 9.03 billion tokens.

The models were evaluated on 14 downstream NLP tasks, including ARC Challenge, ARC Easy, HellaSwag, OpenBookQA, PIQA, StoryCloze, Winograd, Winogrande, and tasks from SuperGLUE.

Key Insights and Ideas

  • Model-Agnostic Quality is Key: The most significant insight is the development of a text quality metric that doesn't rely on a specific LM. This allows the quality scores to be computed once and used for training any LM, making the process truly efficient.
  • Heuristics Can Capture Quality: By combining a diverse set of linguistic heuristics, the authors show that it's possible to quantitatively approximate text quality without human annotation. The weights assigned to these heuristics reveal which linguistic features are most indicative of high-quality text for LM training.
  • Pruning is More Than Just Removing "Bad" Text: The results suggest that removing a certain percentage of the lowest-quality text can actually improve model performance, not just speed up training. This implies that the "noisy" data might be actively detrimental to learning.
  • Optimal Pruning Levels Exist: The study found that there's an optimal pruning level for maximizing performance. Pruning too little doesn't yield significant benefits, while pruning too much can lead to performance degradation, suggesting that the data being pruned beyond a certain threshold might actually be valuable.

Key Results

  • Efficiency Gains:
    • On the OpenWebText dataset, models trained with 40% less data were 42% faster.
  • On the Wikipedia dataset, models trained with 20% less data were 21% faster.
  • Performance Improvements:
    • An average absolute accuracy improvement of 0.9% was observed across 14 downstream tasks when training on pruned OpenWebText data.
  • An average absolute accuracy improvement of 0.8% was observed across 14 downstream tasks when training on pruned Wikipedia data.
  • Perplexity Trends: Perplexity generally increased as more data was pruned, but this increase was gradual up to a certain threshold (20% for Wikipedia, 40% for OpenWebText) before accelerating, indicating that beyond these points, higher quality data was being removed.

Limitations and Future Work

  • Generalizability to Larger Models: The current study focused on smaller to medium-sized LMs. The authors suggest future work should validate the approach on much larger models (hundreds of billions of parameters) to understand its scalability.
  • Scalability to Larger Datasets: While experiments were on large datasets, future research could explore even larger datasets (e.g., the Pile dataset) to fully assess the approach's practicality.
  • Evaluation Metrics: The evaluation primarily used perplexity and accuracy on downstream tasks. Future work should explore other metrics like robustness, fairness, and interpretability to understand the broader impact of pruning.
  • Ethical Considerations: While the method helps mitigate harmful content, the authors acknowledge that ethical considerations like bias and fairness in LM training remain significant challenges, requiring further research.

Summary updated

BibTeX
@misc{sharma2024text,
  author = {Vasu Sharma and Karthik Padthe and Newsha Ardalani and Kushal Tirumala and Russell Howes and Hu Xu and Po-Yao Huang and Daniel Li Chen and Armen Aghajanyan and Gargi Ghosh and Luke Zettlemoyer},
  title = {{Text Quality-Based Pruning for Efficient Training of Language Models}},
  year = {2024},
  eprint = {2405.01582},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2405.01582},
}
Figure