D2 Pruning: Message Passing for Balancing Diversity and Difficulty in Data Pruning

Adyasha Maharana, Prateek Yadav, Mohit Bansal · DOI

TL;DR

This paper introduces D2 PRUNING, a novel graph-based message-passing algorithm for data pruning (coreset selection). By jointly considering data diversity and sample difficulty, D2 PRUNING significantly outperforms existing methods, especially at lower pruning rates, leading to more effective and efficient training of deep learning models.

What Problem Does This Paper Address?

Training massive deep learning models requires enormous datasets, and while larger datasets generally lead to better performance, the quality of data is paramount. Data pruning, or coreset selection, aims to create smaller, high-quality subsets of data that preserve the performance of models trained on the full dataset. Existing methods often focus on either data diversity (ensuring a wide range of samples) or sample difficulty (prioritizing challenging examples). However, these two aspects are complementary: diversity ensures coverage of different data regions, while difficulty focuses on informative samples. Simply optimizing for one can lead to imbalanced coresets (e.g., too many easy samples if only diversity is considered). This paper addresses the challenge of effectively balancing both data diversity and sample difficulty in a unified framework for coreset selection.

Methods

The core of D2 PRUNING is a novel message-passing algorithm applied to a graph representation of the dataset. The process involves three main steps:

  1. Graph Initialization: The dataset is represented as an undirected graph where each data sample is a node. Node features are initialized with sample difficulty scores (derived from model training dynamics, e.g., forgetting score). Edges connect samples to their k-nearest neighbors in an embedding space, with edge weights inversely proportional to the distance, capturing proximity.
  2. Forward Message Passing: Information about difficulty scores and proximity is propagated through the graph. Each node receives messages from its neighbors, weighted by edge strength and the neighbor's difficulty score. This step updates each node's difficulty score to incorporate the "difficulty landscape" of its neighborhood, effectively balancing local difficulty with global diversity.
  3. Data Selection & Reverse Message Passing: Samples are ranked based on their updated difficulty scores. The highest-ranked sample is selected for the coreset. To ensure diversity and avoid sampling from the same dense regions, a "reverse message passing" step is employed. This down-weights the selected sample's neighbors, with the degree of down-weighting inversely proportional to their distance from the selected sample. This process iteratively builds a coreset that balances samples from both dense (easy) and sparse (difficult) regions.

Datasets

The paper evaluates D2 PRUNING on a variety of datasets:

  • Vision Datasets: CIFAR10, CIFAR100, and ImageNet-1K.
  • NLP Datasets: A subset of ImDB reviews for sentiment analysis and the Adversarial NLI (ANLI) dataset for natural language inference. The authors note they are the first to systematically evaluate coreset selection methods on NLP datasets.
  • Unsupervised Filtering: DataComp (a large, unfiltered corpus of images and text).

Key Insights and Ideas

  • Complementarity of Diversity and Difficulty: The paper strongly demonstrates that both data diversity and sample difficulty are crucial and complementary factors for effective coreset selection. Neither alone is sufficient for optimal performance.
  • Graph-based Message Passing as a Unifying Framework: Representing the dataset as a graph and using message passing elegantly combines spatial (diversity) and feature-based (difficulty) information. This approach allows for a nuanced understanding of sample importance within the broader dataset context.
  • Balancing Easy and Difficult Samples: D2 PRUNING successfully selects a coreset that includes both easy samples from dense regions (important for coverage) and difficult samples from sparse regions (important for learning). This balance is key to its superior performance.
  • Adaptability to Different Scenarios: The method shows promise not only for supervised learning but also for self-supervised and unsupervised data selection, highlighting its versatility.
  • Hyperparameter Sensitivity: The choice of hyperparameters (k for neighbors, γr for reverse message passing) allows for fine-tuning the coreset to be more skewed towards difficult samples (lower pruning rates) or more balanced (higher pruning rates), offering flexibility.

Key Results

  • State-of-the-Art Performance: D2 PRUNING consistently outperforms existing coreset selection methods across vision and NLP datasets, particularly at low-to-medium pruning rates (up to 70%). For instance, it achieves significant gains on ImageNet-1K and ImDB reviews.
  • NLP Performance: The method shows strong results on NLP tasks, demonstrating its effectiveness beyond vision benchmarks.
  • Multimodal Datasets: Filtering large multimodal datasets with D2 PRUNING leads to increased diversity and improved generalization of pretrained models.
  • Self-Supervised Learning: D2 PRUNING shows competitive results in self-supervised coreset selection, sometimes matching supervised methods at lower pruning rates.
  • Qualitative Analysis: Visualizations show that D2 PRUNING avoids selecting perceptual duplicates and selects a more balanced distribution of samples compared to other methods.

Limitations and Future Work

  • Reliance on Pretrained Models: Similar to many coreset selection methods, D2 PRUNING relies on a model that has been pretrained or finetuned on the full dataset to extract embeddings and difficulty scores. This means it cannot be used to create datasets from scratch without prior model training, limiting its application in reducing annotation costs for entirely new datasets.
  • Potential for Bias: By leveraging pretrained models, the method risks inheriting biases present in those models.
  • Future Directions: The authors suggest that the message-passing framework opens possibilities for exploring different message schemes and incorporating factors beyond diversity and difficulty. They also highlight the potential for D2 PRUNING in self-supervised and unsupervised data selection for creating challenging and effective datasets in a cost-effective manner.

Summary updated

BibTeX
@misc{maharana2023d,
  author = {Adyasha Maharana and Prateek Yadav and Mohit Bansal},
  title = {{D2 Pruning: Message Passing for Balancing Diversity and Difficulty in Data Pruning}},
  year = {2023},
  eprint = {2310.07931},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2310.07931},
}
Figure