Abstract
Transformer architectures dominate modern NLP but often demand heavy computational resources and intricate hyperparameter tuning. To mitigate these challenges, we propose a novel framework, BoostTransformer, that augments transformers with boosting principles through subgrid token selection and importance-weighted sampling. Our method incorporates a least square boosting objective directly into the transformer pipeline, enabling more efficient training and improved performance. Across multiple fine-grained text classification benchmarks, BoostTransformer demonstrates both faster convergence and higher accuracy, surpassing standard transformers while minimizing architectural search overhead.
1. Introduction
Transformer-based models like BERT and RoBERTa are the current gold standard for Natural Language Processing (NLP). However, their deployment comes with a significant "tax" in the form of massive computational requirements and the need for exhaustive hyperparameter tuning. While Neural Architecture Search (NAS) can automate design, it is often prohibitively expensive for many researchers.
Standard training paradigms often treat all data points and all tokens within a sequence as equally important throughout the entire process. This can lead to prolonged training times and early overfitting. This paper introduces BoostTransformer, a framework that marries the theoretical strengths of Gradient Boosting Machines (GBM) with the expressive power of Transformers to make training more efficient and robust.
2. Methodology
The researchers propose a family of three algorithms designed to optimize Transformer training:
2.1 BoostTransformer (Baseline)
This baseline treats the Transformer as a "weak learner" in a boosting ensemble. It utilizes a least-squares objective to fit residuals and incorporates feature subsampling—inspired by Random Forests—to ensure diversity among the ensemble members.
2.2 Subsequence BoostTransformer
To optimize computational efficiency, this variant uses attention distributions from previous iterations to identify the most "informative" tokens. It then prunes the input sequences, training subsequent weak learners on these compressed "subsequences," thereby reducing the total processing load.
2.3 Importance-sampling BoostTransformer
This version addresses early overfitting by computing a probability distribution over the training set based on residuals (how "wrong" the model currently is). It then samples a subset of the most informative (hardest) examples to train the next learner, focusing the model's capacity where it is needed most.
3. Experimental Setup
The models were evaluated on three standard binary sentiment classification benchmarks:
- IMDB: 25,000 movie reviews for training, 25,000 for testing.
- Yelp Polarity: 100,000 training samples and 38,000 testing samples.
- Amazon Polarity: 100,000 training samples and 25,000 testing samples.
4. Results and Discussion
The proposed methods consistently outperformed vanilla Transformers in both accuracy and efficiency across all benchmarks.
4.1 Performance and Stability
On average, BoostTransformer variants improved accuracy by 0.55% to 0.87%. A key insight is that boosting acts as a stabilizer; while standard Transformers often show performance fluctuations or decay after a few epochs, the BoostTransformer variants maintain a much more stable and upward trajectory.
4.2 Training Efficiency
The efficiency gains were significant. The Subsequence BoostTransformer required only two-thirds of the training time of a standard Transformer, while the Importance-sampling BoostTransformer cut training time in half. This demonstrates that using attention maps as a functional tool for data compression and residuals for importance sampling can drastically reduce resource consumption.
5. Conclusion and Limitations
While BoostTransformer shows great promise, there are trade-offs. Pruning tokens to create subsequences might break direct dependencies between consecutive words, which could impact tasks requiring deep syntactic understanding. Additionally, the benefits of combining subsequence and importance sampling may depend on the specific scale and nature of the data. Future work will explore these strategies in low-resource regimes and for more fine-grained NLP tasks.
Summary updated