Peeling the Onion: Hierarchical Reduction of Data Redundancy for Efficient Vision Transformer Training

Zhenglun Kong, Haoyu Ma, Geng Yuan, Mengshu Sun, Yanyue Xie, Peiyan Dong, Xin Meng, Xuan Shen, Hao Tang, Minghai Qin, Tianlong Chen, Xiaolong Ma, Xiaohui Xie, Zhangyang Wang, Yanzhi Wang

Introduction

Vision Transformers (ViTs) have set new benchmarks in computer vision, yet their training remains computationally intensive and data-hungry. While model compression for inference is well-studied, the training phase often remains a bottleneck. This research identifies data redundancy as a primary culprit. Redundancy exists at multiple scales: within the dataset (easy vs. hard images), within an image (background vs. foreground patches), and within the model's internal mechanisms (dense vs. sparse attention connections).

The Tri-Level E-ViT Framework

The authors propose Tri-Level E-ViT, a hierarchical framework designed to "peel the onion" of redundancy during training from scratch. Unlike previous methods that rely on pre-trained teachers, this approach introduces sparsity at three distinct levels:

  1. Example-Level Sparsity: An "Online Example Filtering" mechanism tracks "forgetting events." Images that the model consistently classifies correctly are deemed redundant and periodically replaced with previously discarded samples, focusing training on "hard" examples.
  2. Token-Level Sparsity: The model utilizes the self-attention map of the [CLS] token to identify and prune uninformative image patches (tokens) in an end-to-end manner.
  3. Attention-Level Sparsity: A Token & Attention selector (TA-selector) identifies and prunes weak connections within the attention matrix, mitigating the quadratic complexity of self-attention.
Overview of the Tri-Level E-ViT framework showing example, token, and attention level sparsity.

Experimental Results

The framework was evaluated on ImageNet-1K and ImageNet-V2 across various architectures, including DeiT, Swin Transformer, and LV-ViT.

Performance and Efficiency Trade-offs

Tri-Level E-ViT demonstrates a superior Pareto front compared to existing state-of-the-art methods. Notably, the reduction of redundant data often leads to improved accuracy, suggesting that uninformative data can act as noise during optimization.

  • DeiT-T: Achieved a 35.6% reduction in training time with a negligible 0.3% accuracy drop. A more conservative configuration yielded a 15.2% speedup alongside a 0.4% accuracy increase.
  • Swin-T: Reduced training time by 13.1% with no loss in accuracy.
  • Hardware Deployment: Real-world testing on an Xilinx ZCU102 FPGA showed up to 31% reduction in inference latency.
Comparison of ImageNet Top-1 Accuracy vs. Training Time for Tri-Level E-ViT and other baselines.

Conclusion and Future Directions

Tri-Level E-ViT proves that hierarchical data pruning is a viable path toward efficient ViT training. Future work includes automating the selection of "keep ratios" for pruning, scaling the approach to web-scale datasets like JFT-300M, and integrating these data-centric techniques with weight-level pruning for even greater efficiency.

Summary updated

BibTeX
@inproceedings{kong2023peeling,
  author = {Zhenglun Kong and Haoyu Ma and Geng Yuan and Mengshu Sun and Yanyue Xie and Peiyan Dong and Xin Meng and Xuan Shen and Hao Tang and Minghai Qin and Tianlong Chen and Xiaolong Ma and Xiaohui Xie and Zhangyang Wang and Yanzhi Wang},
  title = {{Peeling the Onion: Hierarchical Reduction of Data Redundancy for Efficient Vision Transformer Training}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2023},
  doi = {10.1609/aaai.v37i7.26008},
}
Figure