QuRating: Selecting High-Quality Data for Training Language Models

Alexander Wettig, Aatmik Gupta, Saumya Malik, Danqi Chen

TL;DR

Princeton researchers have introduced QuRating, a method that uses large language models (LLMs) to rank pre-training data based on human-centric qualities like "educational value" and "writing style." By training on a 30-billion-token subset selected via QuRating, they produced a 1.3B-parameter model that performs as well as a baseline trained on 50% more data.

What Problem Does This Paper Address?

As we approach the "data wall" in AI development, the focus is shifting from simply gathering more data to selecting better data. Currently, most data selection relies on "blunt instrument" heuristics: rule-based filters (e.g., removing text with too many repetitions) or domain-based classifiers (e.g., selecting text that "looks like Wikipedia").

These methods fail to capture abstract, qualitative traits that humans intuitively recognize, such as how well a piece of text is written or its utility for teaching a concept. The authors argue that by capturing these latent qualities, we can train more capable models using significantly less compute and data.

Methods

The QuRating framework is designed to capture human intuitions about data quality and apply them at scale. It consists of four main stages:

QuRating Pipeline Overview
  1. Pairwise Judgments: Instead of asking an LLM to assign an absolute score (which is often inconsistent), the researchers prompted GPT-3.5-turbo to compare two text snippets and decide which was "better" according to a specific criterion.
  2. The QuRater Model: To avoid the massive cost of querying GPT-3.5 for an entire 260-billion-token corpus, they trained a smaller "proxy" model. They fine-tuned a Sheared-LLaMA-1.3B model on 250,000 of these pairwise judgments to learn to predict scalar quality ratings.
  3. Criteria Selection: They investigated four distinct qualities:
  4. Writing Style: Polished and beautiful prose.
  5. Facts & Trivia: Density of long-tail factual knowledge.
  6. Educational Value: Clear explanations and step-by-step reasoning.
  7. Required Expertise: The level of knowledge needed to understand the text.
  8. Balanced Sampling: Rather than just taking the "top-k" highest-rated documents (which reduces data diversity), they used the quality ratings as logits in a softmax distribution. By adjusting a temperature parameter ($\tau$), they could trade off between selecting the highest-quality data and maintaining a diverse distribution.

Datasets

  • SlimPajama: The source corpus (260B tokens), which is a deduplicated version of RedPajama.
  • QuRatedPajama: The authors' newly released version of the corpus, annotated with quality ratings across the four criteria.
  • Evaluation Suite: The models were tested on 10 diverse in-context learning (ICL) tasks (including MMLU, ARC, and SciQA) and instruction-following capabilities using the AlpacaFarm framework.

Key Insights and Ideas

  • Educational Value is the "Secret Sauce": Of the four criteria, "educational value" was the most effective for improving downstream task performance. It likely selects for the kind of structured reasoning that helps LLMs generalize.
  • The "Top-K" Trap: Selecting only the highest-rated documents actually hurt the model's perplexity. The researchers found that a sampling temperature of $\tau=2.0$ was the "sweet spot," providing a boost in quality while keeping the data distribution broad enough for the model to learn the structure of language.
  • Perplexity is a Poor Proxy: Interestingly, selecting data based on "Writing Style" led to the best (lowest) validation perplexity, but it did not translate into better performance on reasoning or knowledge tasks. This suggests that being able to predict the next token easily doesn't necessarily make a model "smarter."
  • Expertise Curriculum: The authors found that the order of data matters. Training on a curriculum that moves from "low expertise" (easy) to "high expertise" (hard) data improved performance even when the total dataset remained the same.

Key Results

  • Efficiency Gains: A 1.3B model trained on 30B tokens selected for educational value performed similarly to a model trained on 45B tokens of uniform data—a 50% increase in data efficiency.
  • Performance Boost: QuRating (at $\tau=2.0$) improved in-context learning performance across all 10 tasks by an average of 1.8% compared to uniform sampling.
  • Instruction Following: In head-to-head battles judged by GPT-4, the "educational value" model achieved a 57.3% win rate over the model trained on uniform data.
Instruction Following Win Rates

Limitations and Future Work

  • LLM Bias: The researchers noted that GPT-3.5-turbo exhibited a bias toward English text, even when explicitly told to ignore language. This suggests that the "teacher" model's own biases are distilled into the QuRater.
  • Scale: The experiments were conducted at a relatively small scale (1.3B parameters). It remains to be seen if these qualitative signals provide the same marginal gains for "frontier" models (70B+ parameters).
  • Social Implications: Data selection is not neutral. The authors observed that QuRating tends to amplify "professional" roles (like researchers) while suppressing "informal" roles (like "mommy bloggers" or "youtubers"), which could impact the representational fairness of the resulting models.

Summary updated

BibTeX
@inproceedings{wettig2024qurating,
  author = {Alexander Wettig and Aatmik Gupta and Saumya Malik and Danqi Chen},
  title = {{QuRating: Selecting High-Quality Data for Training Language Models}},
  booktitle = {International Conference on Machine Learning},
  year = {2024},
  url = {https://openreview.net/forum?id=GLGYYqPwjy},
}
Figure