Paper commentary
EDA: Easy Data Augmentation Techniques for Boosting Performance on Text Classification Tasks
Four simple text edits boost small text classification datasets
- Problem Labelled text is costly to collect, and NLP has few simple, general transformations that keep a sentence's label intact. Small text classification datasets therefore get little augmentation.
- Method EDA applies one of four word-level edits to each training sentence: synonym replacement, random insertion, random swap, or random deletion. The number of edits scales with sentence length, and CNN and LSTM-RNN classifiers train on the augmented data.
- Results EDA on 50% of training data reached 88.6% accuracy, versus 88.3% for normal training.
Why small text datasets need augmentation
Text classifiers depend heavily on how much labelled data they see, and labelled text is slow and tedious to gather. Computer vision and speech pipelines routinely augment their training data, and this helps models stay robust when data is scarce. Language is harder to transform in a general way, because a rule that changes wording can also change the label, so NLP has not settled on a common augmentation method.
This study asks whether a few cheap text edits can enlarge a training set without changing class labels. The focus is on small datasets, where overfitting is more severe, so the benefit of augmentation is expected to be largest there.
Four word-level edits and how their size is set
For each training sentence, EDA picks one of four operations at random: synonym replacement, random insertion, random swap and random deletion. Synonym replacement swaps non-stop words for randomly chosen synonyms, and random insertion places a synonym of a non-stop word at a random position, with both using WordNet as the synonym source.
Random swap exchanges the positions of two random words, and random deletion removes each word independently.
Three operations change a fixed number of words \(n = \alpha l\), where \(l\) is the sentence length and \(\alpha\) is the fraction of words changed. Random deletion uses the same \(\alpha\) as its per-word removal probability, so \(p = \alpha\). Longer sentences can absorb more edits while keeping their label, so scaling the edit count with length keeps the perturbation proportional to the sentence.
Each original sentence produces \(n_{aug}\) augmented sentences, so the number of generated examples is a separate setting from the edit strength \(\alpha\). The augmented sentences are then used to train a CNN, implemented after Kim (2014), and an LSTM-RNN.
Gains at different training set sizes
Five benchmarks are used: SST-2, CR, SUBJ, TREC and PC, with training sets of 500, 2,000, 5,000 and all available data. Each reported setting averages five random seeds.
At \(N_{train}=500\), the RNN average moved from 75.3 to 79.1, and the CNN average from 78.6 to 80.7. Averaged across models and datasets, EDA improved performance by 0.8% on full datasets and by 3.0% at \(N_{train}=500\).
Without augmentation, the best average accuracy was 88.3%, reached with 100% of the training data. Training with EDA on only 50% of the training data reached an average accuracy of 88.6% across the five datasets.
Checking whether augmented sentences keep their labels
The check uses an RNN trained on PC without augmentation, then applied to the test set. Nine augmented sentences were generated per original test sentence, and the outputs of the last dense layer were projected to two dimensions with t-SNE.
The augmented sentences lie closely around their original sentences, and the authors read this as evidence that EDA mostly keeps the original labels. The check is a visual projection on one dataset and one model, so it does not measure label correctness directly.
Which operation drives the gain
Each operation was run alone with \(\alpha\) set to 0.05, 0.1, 0.2, 0.3, 0.4 or 0.5, to test whether the gain comes mainly from synonym replacement. Earlier work used synonym replacement, while the other three operations had not been studied in this way.
Synonym replacement helped at small \(\alpha\), but large \(\alpha\) hurt performance, which the authors attribute to too many replaced words changing the sentence's identity. Random insertion gave gains that stayed more stable across \(\alpha\) values.
Random swap gave high gains at \(\alpha \le 0.2\), which declined at \(\alpha \ge 0.3\). Random deletion had the highest gains at low \(\alpha\) and severely hurt performance at high \(\alpha\).
The gains were larger on smaller datasets for all four operations, and \(\alpha=0.1\) was the most consistent setting across them.
How many augmented sentences to generate
The sweep covers \(n_{aug}\) values of 1, 2, 4, 8, 16 and 32, with performance gain averaged over all five datasets. For small training sets, generating many augmented sentences gave large gains, because overfitting is more likely there.
The recommended settings are \(\alpha=0.05\) with \(n_{aug}=16\) at \(N_{train}=500\), \(\alpha=0.05\) with \(n_{aug}=8\) at 2,000, and \(\alpha=0.1\) with \(n_{aug}=4\) at 5,000 and above.
Comparison with earlier augmentation results
Back-translation, translational augmentation and noising have shown BLEU gains for machine translation, and task-specific heuristics have been used for other tasks. For synonym replacement, one tweet classification study reported a 1.4% F1-score boost from finding synonyms with k-nearest neighbours over word embeddings.
Kobayashi (2018) reported a 0.5% gain on five datasets by replacing words with predictions from a bi-directional language model. Hu (2017) reported a 3% accuracy gain on two datasets from a generative model that combines a VAE and an attribute discriminator. The authors argue that EDA gives results of the same order of magnitude without training a language model or using an external dataset.
These figures come from different models, datasets and settings, so they are not a controlled comparison with EDA.
Limitations
With pre-trained models, one study found EDA's improvement negligible when using ULMFit, and the authors expect similar results for ELMo and BERT.
The evaluation covers five benchmarks and two architectures, and other studies on NLP augmentation use different models and datasets, so fair comparison is hard. The theoretical basis of the operations is left for future work.
Paper info
- Authors
- Jason Wei, Kai Zou
- Venue
- arXiv · Preprint
- First published
- 2019-1-31
- Added
- 2026-11-12
- Updated
- 2019-8-25
- Version
- v2
- arXiv
- 1901.11196
- Category
- cs.CL
- Original paper terms
- arXiv non-exclusive 1.0
- What we show
- Paper info and commentary
AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.
Quote from the paper
Jason Wei, Kai Zou (2019). EDA: Easy Data Augmentation Techniques for Boosting Performance on Text Classification Tasks. arXiv:1901.11196v2. https://arxiv.org/abs/1901.11196v2
BibTeX
@misc{wei2019easy,
title = {{EDA: Easy Data Augmentation Techniques for Boosting Performance on Text Classification Tasks}},
author = {Jason Wei and Kai Zou},
year = {2019},
eprint = {1901.11196},
archivePrefix = {arXiv},
url = {https://arxiv.org/abs/1901.11196v2}
}