DsDm: Model-Aware Dataset Selection with Datamodels

Logan Engstrom, Axel Feldmann, Aleksander Madry · DOI

Introduction

The prevailing wisdom in training Large Language Models (LLMs) has long been "more data is better," provided that data is of high "quality." Traditionally, quality is defined by human-centric heuristics—filtering for text that resembles Wikipedia or curated books while discarding "low-quality" web scrapes. However, this approach ignores a fundamental reality: human intuition about data quality does not always align with what a model needs to learn effectively.

DsDm (Dataset Selection with Datamodels) introduces a paradigm shift. Instead of relying on static filters, it treats dataset selection as a model-aware optimization problem. By identifying which specific training examples actually minimize loss on target tasks, DsDm achieves a 2x compute multiplier, allowing models to reach the performance of much larger counterparts trained on significantly more data.

The Problem with "Quality"

Standard data curation methods often use similarity-based filtering. For instance, methods like DSIR or classifier-based filters select data that "looks like" a target distribution. While intuitive, these methods frequently fail to outperform random selection. The core issue is the "similarity trap": by over-optimizing for cleanliness and similarity to a narrow target, these filters can sacrifice the diversity necessary for broad generalization.

Methodology: Datamodels for Selection

DsDm frames dataset selection formally: given a massive candidate pool (like C4), which subset minimizes the model's loss on a set of target tasks? To solve this without the impossible cost of training on every subset, the authors utilize linear datamodels.

Linear Datamodels and TRAK

The method assumes that the impact of a training point on a model's prediction is additive. Using the TRAK estimator—a computationally efficient approach based on influence functions—DsDm calculates a "weight" for every example in the candidate pool. Unlike similarity filters that look at text, DsDm looks at gradients. It measures how well a candidate point's gradient aligns with the gradients required to perform well on specific target tasks like SQuAD (reading comprehension) or CS-Algorithms (symbolic reasoning).

DsDm consistently outperforms baselines across specific target tasks, often exceeding the performance of random selection even with a small fraction of data.

Proxy Modeling

To ensure the method is practical, the authors calculate these weights using small "proxy" models (125M parameters). Remarkably, the data selected by these small models remains highly effective when training much larger models (up to 1.8B parameters), demonstrating strong generalization across model scales.

Results: The 2x Compute Multiplier

The most striking result of DsDm is its efficiency. A 1.3B parameter model trained on a subset of data selected by DsDm matches the performance of a model trained with twice the total compute on random data.

DsDm achieves a 2x compute efficiency multiplier, outperforming standard baselines like DSIR, Classifier, and SeDeDup on 1.3B parameter models.

In head-to-head comparisons, DsDm consistently outperformed established baselines. On benchmarks like SQuAD and CS-Algorithms, traditional filters often failed to beat random selection entirely, whereas DsDm provided significant gains. Furthermore, selecting data for a broad mix of "proxy" tasks (e.g., SQuAD, Jeopardy, and LAMBADA) improved performance on completely unseen, held-out benchmarks, proving that the method doesn't just overfit to the selection criteria.

Conclusion

DsDm demonstrates that model-aware data selection is a powerful lever for scaling LLMs. By moving beyond human-defined "quality" and toward model-defined "utility," researchers can drastically reduce the compute required to achieve state-of-the-art performance. While there is an upfront cost to computing gradients for a dataset, this investment is quickly amortized by the massive savings in training compute and the resulting gains in model accuracy.

Summary updated

BibTeX
@inproceedings{engstrom2024dsdm,
  author = {Logan Engstrom and Axel Feldmann and Aleksander Madry},
  title = {{DsDm: Model-Aware Dataset Selection with Datamodels}},
  booktitle = {International Conference on Machine Learning},
  year = {2024},
  url = {https://openreview.net/forum?id=GC8HkKeH8s},
}
Figure