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

Large Language Model-guided Document Selection

Xiang Kong, Tom Gunter, Ruoming PangarXiv 2024 · DOI

Introduction

The prevailing paradigm in Large Language Model (LLM) development suggests that increasing data and compute leads to better performance. However, this "Scaling Law" faces diminishing returns, especially when training on noisy web-crawl data like CommonCrawl. Raw web data is often cluttered with boilerplate text and low-quality content, which dilutes the training signal. While high-quality datasets like Wikipedia are preferred, manually filtering billions of documents is infeasible. Researchers at Apple have introduced LM-guided Document Selection (LMDS), a scalable pipeline that leverages high-capacity LLMs to identify and select high-quality training data, significantly improving efficiency and performance.

Methodology: The LMDS Pipeline

The LMDS approach addresses the cost of high-quality filtering by using a two-stage distillation process.

The LMDS pipeline: High-capacity LLM labeling followed by small-model refinement.
  1. $LM_{large}$-Labelling: A high-capacity model (Llama-2-70B-chat) acts as a zero-shot grader. It evaluates a small sample of documents (approx. 2 million) based on whether they are "educational and engaging" for a college-level audience.
  2. $LM_{small}$-Refinement: The quality labels from the 70B model are used to train a much smaller, efficient classifier (ranging from 85M to 1B parameters). This distilled grader then scores the entire massive corpus (e.g., 878 billion tokens from RedPajama-CC), allowing for high-quality filtering at a fraction of the original computational cost.

Key Results and Performance

The LMDS method demonstrates that data quality can substitute for data quantity. By pruning 75% of the original dataset, the researchers achieved superior results with 30% less compute.

Performance comparison of LMDS vs. Baseline across CoreEN and MMLU benchmarks at the 7B parameter scale.

As shown in the benchmarks above, the 7B model trained on LMDS-filtered data consistently outperforms the baseline trained on the full RedPajama-CC dataset. Notably, on the MMLU benchmark, the LMDS-trained model achieved a +5.53 point increase. The results indicate that the "textbook" quality signal identified by the 70B model is effectively distilled into the smaller classifier, which then successfully identifies the most valuable tokens for pre-training.

Key Insights

  • Aggressive Pruning Works: The study found that keeping only the top 25% of documents (a 75% pruning rate) was optimal. Pruning more than this (e.g., keeping only 20%) led to a loss of diversity that harmed performance.
  • Model Scale for Labeling: The "critical eye" required for quality labeling appears to be an emergent property of larger models. While a 7B model labeled almost everything as "high quality," the 70B model was much more selective and effective.
  • Compute Efficiency: LMDS allows models to reach baseline performance levels using significantly fewer training tokens and FLOPs, effectively shifting the scaling curve.

Conclusion

LM-guided Document Selection provides a powerful framework for improving LLM pre-training. By using a "teacher" model to define quality and a "student" classifier to scale that definition, researchers can create cleaner, more effective datasets. This method not only improves benchmark performance but also offers a path toward more sustainable and compute-efficient AI development. Future work may involve applying this technique to even noisier, completely unfiltered web crawls to further demonstrate its potential.

Summary updated

BibTeX
@misc{kong2024large,
  author = {Xiang Kong and Tom Gunter and Ruoming Pang},
  title = {{Large Language Model-guided Document Selection}},
  year = {2024},
  eprint = {2406.04638},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2406.04638},
}
Figure