Text AutoAugment: Learning Compositional Augmentation Policy for Text Classification

Shuhuai Ren, Jinchao Zhang, Lei Li, Xu Sun, Jie Zhou

Introduction

Deep learning models are notoriously data-hungry. In real-world scenarios, practitioners often encounter low-resource regimes with few labeled examples or class-imbalanced datasets. While data augmentation (DA) can mitigate these issues by creating synthetic training samples, existing NLP methods like EDA or Back-Translation often rely on manually tuned, "preset" hyperparameters that are rarely optimal for every dataset. Furthermore, these traditional methods typically apply only a single operation at a time, limiting the diversity of synthetic data.

Text AutoAugment (TAA) addresses these flaws by automating the search for optimal, compositional data augmentation strategies. By treating augmentation as an optimization problem, TAA significantly boosts classification accuracy—averaging an 8.8% gain in low-resource settings and 9.7% in class-imbalanced scenarios—outperforming traditional manual heuristics.

Methods: A Learnable, Compositional Framework

TAA moves beyond heuristic-based augmentation to a learnable approach. It defines a "policy" as a set of $N$ atomic operations, where each operation is a triplet: (type, probability, magnitude). For any given sentence, the system randomly samples and sequentially applies a subset of these operations.

The TAA framework samples and applies a sequence of text-editing operations to generate diverse synthetic texts.

The framework utilizes five word-level operations: Random Swap, Random Delete, WordNet Substitution, TF-IDF Substitution, and TF-IDF Insertion. To find the best policy without exhaustive manual testing, TAA employs Sequential Model-based Global Optimization (SMBO) with a Tree-structured Parzen Estimator (TPE). The objective is to minimize the loss of a model (e.g., BERT) on a validation set, effectively "learning" which edits maximize model generalization.

Key Insights and Results

The researchers evaluated TAA across six benchmark datasets (IMDB, SST-2, SST-5, YELP-2, YELP-5, and TREC) under "stress tests" involving low-resource and class-imbalanced conditions.

Performance Gains

TAA consistently outperformed strong baselines such as EDA and Back-Translation. In low-resource settings, it achieved an average accuracy improvement of 8.8% over the "No Augmentation" baseline.

Comparison of TAA against baselines (EDA, CWS, LDM) on SST-5 and TREC datasets, showing superior test accuracy across different numbers of augmented samples.

Compositional Power and Distortion

A key finding is the "sweet spot" of distortion. TAA identifies the exact threshold where diversity is maximized without destroying the sentence's semantic integrity. Applying operations sequentially (e.g., swapping words and then deleting others) creates much richer training signals than individual applications. The authors found that a policy of 8 operations, sampled 2 at a time, yielded optimal results.

Transferability and Efficiency

Interestingly, policies discovered on one dataset (e.g., IMDB) transfer well to others (e.g., Yelp) with minimal performance loss, suggesting that TAA uncovers general rules for effective text perturbation. Despite the automated search, TAA is efficient, requiring approximately 4.24 GPU hours to find an optimal policy on standard hardware.

Limitations and Future Work

Currently, TAA focuses on word-level edits and does not explicitly account for higher-level syntactic structures. While highly effective for classification, its application to structured prediction tasks like NER or summarization remains unexplored. Future research may integrate generative models (like GPT or BART) into the TAA search space to combine editing efficiency with the fluency of generative paraphrasing.

Summary updated

BibTeX
@inproceedings{ren2021text,
  author = {Shuhuai Ren and Jinchao Zhang and Lei Li and Xu Sun and Jie Zhou},
  title = {{Text AutoAugment: Learning Compositional Augmentation Policy for Text Classification}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2021},
  doi = {10.18653/v1/2021.emnlp-main.711},
}
Figure