InfoBatch: Lossless Training Speed Up by Unbiased Dynamic Data Pruning

Ziheng Qin, Kai Wang, Zangwei Zheng, Jianyang Gu, Xiangyu Peng, Zhaopan Xu, Daquan Zhou, Lei Shang, Baigui Sun, Xuansong Xie, Yang You

TL;DR

InfoBatch is a plug-and-play, architecture-agnostic framework that accelerates deep learning training by 20% to 40% with zero loss in performance. It achieves this by dynamically pruning well-learned (low-loss) samples during training and rescaling the gradients of the remaining samples to ensure the optimization process remains completely unbiased.

What Problem Does This Paper Address?

Training state-of-the-art deep learning models on massive datasets is incredibly resource-intensive. Data pruning attempts to solve this by removing less informative samples from the training set. However, existing approaches suffer from two major flaws:

  1. Static Pruning requires expensive pre-training trials to compute importance scores for each sample, which can sometimes take longer than the actual training run itself.
  2. Dynamic Pruning updates scores on the fly but typically relies on "hard pruning" (completely dropping low-loss samples). This introduces a severe gradient expectation bias, steering the model away from the optimal convergence path and degrading final accuracy. Furthermore, sorting the entire dataset by score every epoch introduces a non-negligible $O(N \log N)$ computational bottleneck.

InfoBatch introduces an unbiased, $O(1)$ complexity dynamic pruning method to overcome these limitations.

Figure 1: Visualization of difference between InfoBatch and EL2N (Paul et al., 2021)(a static pruning method). InfoBatch achieves lossless acceleration performance, while EL2N encoun- ters a performance drop of 7.2%. Experiments are conducted with ResNet-18 under the same pruning ratio of 50% on the CIFAR- 100 dataset. The semi-transparent triangles represent the variance range of gradient estimation.

Methods

InfoBatch replaces deterministic data dropping with a probabilistic framework consisting of three core components:

  • Soft Pruning: Instead of completely discarding well-learned samples, InfoBatch calculates the mean loss ($\bar{\mathcal{H}}_t$) of the dataset at each epoch. It then randomly prunes a predefined fraction ($r$) of samples whose losses fall below this average.
  • Expectation Rescaling: To counteract the gradient bias caused by missing data, the gradients of the remaining low-loss samples are scaled up by $1/(1-r)$. This mathematical adjustment ensures that the expected gradient direction matches exactly what it would be if the model trained on the full dataset.
  • Annealing: Pruning is stopped during the final fraction of training ($\delta \cdot C$ epochs). Training on the full dataset at the end reduces convergence variance and stabilizes final performance.

Crucially, because InfoBatch only checks whether a sample's loss is above or below the mean rather than sorting the entire dataset, its selection overhead is reduced to a negligible $O(1)$ per sample.

Figure 2: Illustration of the proposed InfoBatch framework. InfoBatch mainly consists of two operations, named soft pruning and expectation rescaling. ¯Ht denotes the adaptive thresholds of scores of samples. Soft pruning randomly prunes some samples from D1 with relatively small scores. For remaining samples from D1, expectation rescaling scales up the losses to keep the approximately same gradient expectation as the original dataset.

Datasets

The authors evaluated InfoBatch across a wide variety of standard benchmarks spanning multiple tasks:

  • Image Classification: CIFAR-10, CIFAR-100, and ImageNet-1K.
  • Semantic Segmentation: ADE20K.
  • Generative Modeling: FFHQ (for Latent Diffusion).
  • Instruction Fine-Tuning: Alpaca dataset (for LLaMA-7B).

Key Insights and Ideas

  • Randomness Beats Determinism in Pruning: Completely cutting off the low-loss tail of a data distribution fundamentally alters the optimization landscape. Introducing a probabilistic "soft prune" combined with gradient rescaling preserves the true gradient expectation while still yielding significant computational savings.
  • Sorting is a Hidden Bottleneck: Previous dynamic pruning methods required sorting the entire dataset by score every epoch. InfoBatch demonstrates that a simple threshold comparison against the mean loss achieves identical performance with a fraction of the compute cost, making dynamic pruning practical for million-scale datasets.
  • Data Efficiency Over Iteration Reduction: InfoBatch doesn't just reduce iterations; it selectively retains high-loss ("hard") samples, leading to higher sample efficiency than simply training on the full dataset for fewer epochs.

Key Results

  • Lossless Speedup: InfoBatch losslessly saves 40% of the overall training cost on CIFAR-10/100, ImageNet-1K, and ADE20K. For example, on ImageNet-1K with a ResNet-50, it achieves 76.5% accuracy (matching the 76.4% full-dataset baseline) while slashing total node hours from 140 to 84.
  • Broad Task Generality: Beyond standard classification, InfoBatch saves 24.8% cost on MAE pre-training, 27% cost on Latent Diffusion model pre-training, and 20% cost on LLaMA instruction fine-tuning.
  • Negligible Overhead: On ImageNet-1K, InfoBatch's selection process takes a mere 10 seconds across 90 epochs of training, compared to the hours of overhead required by static pruning methods like EL2N.

Limitations and Future Work

The current implementation of InfoBatch relies on multi-epoch training schemes to track and update sample losses continuously. As a result, it cannot be applied out-of-the-box to ultra-large foundation models (such as GPT-3 or ViT-22B) that are typically trained for only a single epoch to avoid memorization. The authors note that adapting InfoBatch to single-epoch training regimes is a primary direction for future work.

Summary updated

Abstract

Data pruning aims to obtain lossless performances with less overall cost. A common approach is to filter out samples that make less contribution to the training. This could lead to gradient expectation bias compared to the original data. To solve this problem, we propose \textbf{InfoBatch}, a novel framework aiming to achieve lossless training acceleration by unbiased dynamic data pruning. Specifically, InfoBatch randomly prunes a portion of less informative samples based on the loss distribution and rescales the gradients of the remaining samples to approximate the original gradient. As a plug-and-play and architecture-agnostic framework, InfoBatch consistently obtains lossless training results on classification, semantic segmentation, vision pertaining, and instruction fine-tuning tasks. On CIFAR10/100, ImageNet-1K, and ADE20K, InfoBatch losslessly saves 40\% overall cost. For pertaining MAE and diffusion model, InfoBatch can respectively save 24.8\% and 27\% cost. For LLaMA instruction fine-tuning, InfoBatch is also able to save 20\% cost and is compatible with coreset selection methods. The code is publicly available at \href{https://github.com/henryqin1997/InfoBatch}{github.com/NUS-HPC-AI-Lab/InfoBatch}.
BibTeX
@inproceedings{qin2024infobatch,
  author = {Ziheng Qin and Kai Wang and Zangwei Zheng and Jianyang Gu and Xiangyu Peng and Zhaopan Xu and Daquan Zhou and Lei Shang and Baigui Sun and Xuansong Xie and Yang You},
  title = {{InfoBatch: Lossless Training Speed Up by Unbiased Dynamic Data Pruning}},
  booktitle = {International Conference on Learning Representations},
  year = {2024},
  url = {https://openreview.net/forum?id=C61sk5LsK6},
}
Figure