Abstract
Class imbalance remains a significant challenge in Natural Language Processing (NLP), where minority classes often lack sufficient representation for deep learning models to generalize effectively. Traditional augmentation techniques, such as token-level synonym replacement or back-translation, often struggle to balance semantic fidelity with computational efficiency. In this paper, we introduce Reprint (Randomized Extrapolation based on Principal Components), a hidden-space data augmentation method. Reprint leverages Principal Component Analysis (PCA) to identify the geometric subspaces of target classes and extrapolates features from majority to minority classes. By incorporating a soft label refinement strategy, Reprint generates diverse yet realistic synthetic samples. Our experiments across four benchmark datasets demonstrate that Reprint consistently outperforms existing baselines, particularly in scenarios with severe data scarcity.
1. Introduction
Deep learning models are inherently data-driven, yet real-world datasets frequently exhibit long-tailed distributions. In NLP tasks like intent classification or topic categorization, certain classes may have thousands of examples while others have only a handful. This imbalance leads to biased models that perform poorly on minority classes.
Augmenting text data is non-trivial. Token-level modifications (e.g., EDA) often disrupt local syntax or fail to capture global semantics. Sentence-level methods (e.g., back-translation) are computationally intensive and may introduce unwanted noise. Hidden-space augmentation—generating synthetic feature vectors in the embedding space—offers a promising alternative. However, existing methods often fail to respect the unique geometric distribution of different classes. Reprint addresses this by using PCA to model class-specific subspaces, ensuring that synthetic data remains faithful to the underlying distribution of the minority class.
2. The Reprint Method
Reprint operates on pre-computed embeddings (e.g., from BERT or ALBERT) and follows a three-stage process:
2.1 Subspace Projection
The method begins by using PCA to identify the principal components of both the majority (source) and minority (target) classes. This step captures the "shape" of each class in the high-dimensional embedding space.
2.2 Residual Extrapolation
Unlike simple interpolation methods, Reprint performs extrapolation. It identifies the "residual" of a majority class sample—the variance not captured by its primary PCA components—and applies this variation to a projected sample of the minority class. This effectively borrows the stylistic variation of the majority class while maintaining the structural identity of the minority class.
2.3 Label Refinement
To prevent overfitting to synthetic noise, Reprint employs a "soft" labeling strategy. Rather than assigning a hard 100% label to the target class, it calculates a weighted label based on the determinants of the transformation matrices. This approach, inspired by Mixup, acts as a regularizer and improves the model's ability to generalize.
3. Experimental Evaluation
We evaluated Reprint on four standard text classification benchmarks: SNIPS (intent classification), Yahoo Answers (topic classification), AG News (news categories), and DBpedia (structured content). To simulate real-world imbalance, we restricted minority classes to 32, 64, or 128 instances.
3.1 Performance and Efficiency
Reprint outperformed eight major baselines, including SMOTE, EDA, and GE3. On average, Reprint yielded a 5.20% accuracy improvement over simple upsampling. The performance gains were most significant in "severe" imbalance scenarios (e.g., 16-32 samples), highlighting the method's robustness. Furthermore, because Reprint relies on linear algebra rather than generative modeling, it is highly computationally efficient.
3.2 The Role of PCA
Ablation studies revealed a "Goldilocks" zone for PCA dimensionality. Using approximately 5 principal components (capturing roughly 50% of the explained variance) provided the best balance between representation and noise reduction.
4. Discussion: Fidelity vs. Diversity
Using Maximum Mean Discrepancy (MMD) and t-SNE visualizations, we confirmed that Reprint generates samples that are statistically closer to the original data distribution than previous extrapolation methods. This high fidelity, combined with the diversity introduced by the residual extrapolation, allows the model to learn more robust decision boundaries.
5. Conclusion and Future Work
Reprint provides an efficient and effective framework for hidden-space data augmentation in imbalanced NLP tasks. By respecting the geometric subspaces of data, it generates high-quality synthetic samples that improve model generalization. Future work will explore non-linear characterizations of data geometry, such as manifold learning, and the integration of Reprint into semi-supervised learning pipelines.
Summary updated