[Paper Review] Improved Text Classification via Test-Time Augmentation
This paper demonstrates that test-time augmentation (TTA) significantly improves text classification accuracy using pre-trained language models without retraining. By applying multiple stochastic, non-deterministic augmentations (e.g., synonym replacement) to test inputs and averaging predictions, TTA achieves up to 1.4 percentage point accuracy gains on the WILDS CivilComments dataset, with multi-sample single-augmentation policies outperforming single-sample or multi-augmentation approaches.
Test-time augmentation -- the aggregation of predictions across transformed examples of test inputs -- is an established technique to improve the performance of image classification models. Importantly, TTA can be used to improve model performance post-hoc, without additional training. Although test-time augmentation (TTA) can be applied to any data modality, it has seen limited adoption in NLP due in part to the difficulty of identifying label-preserving transformations. In this paper, we present augmentation policies that yield significant accuracy improvements with language models. A key finding is that augmentation policy design -- for instance, the number of samples generated from a single, non-deterministic augmentation -- has a considerable impact on the benefit of TTA. Experiments across a binary classification task and dataset show that test-time augmentation can deliver consistent improvements over current state-of-the-art approaches.
Motivation & Objective
- To investigate whether test-time augmentation (TTA) can improve text classification performance in NLP without retraining.
- To identify effective augmentation policies that maximize accuracy gains in TTA for pre-trained language models.
- To understand why multi-sample TTA with a single augmentation outperforms single-sample or multi-augmentation configurations.
- To evaluate the impact of augmentation type (word-based vs. character-based) and aggregation strategy on TTA performance.
- To provide practical, post-hoc recommendations for applying TTA in NLP classification tasks.
Proposed method
- Apply a pre-trained classifier to the original test input and M augmented versions generated by a stochastic augmentation policy.
- Use a simple average of class logits from all M+1 inputs (original + augmented) to produce the final prediction.
- Design four TTA policy configurations: single-sample single-augmentation, multi-sample single-augmentation, single-sample multi-augmentation, and multi-sample multi-augmentation.
- Use word-level, semantic-aware transforms (e.g., WordNet, PPDB synonyms) and character-level transforms (e.g., random character replacement) as augmentation methods.
- Evaluate performance on the WILDS CivilComments binary classification dataset using accuracy averaged over 10 random test subsets.
- Analyze correction and corruption rates across policies to explain performance differences.
Experimental results
Research questions
- RQ1Does test-time augmentation improve text classification accuracy when applied post-hoc to a pre-trained language model?
- RQ2How does the design of the augmentation policy—specifically, the number of samples and choice of transforms—affect TTA performance?
- RQ3Why does multi-sample single-augmentation TTA outperform single-sample or multi-augmentation configurations?
- RQ4What is the relative impact of word-based versus character-based augmentation on TTA accuracy?
- RQ5Can TTA surpass models fine-tuned on the same data, and what does this imply about its potential in NLP?
Key findings
- Multi-sample single-augmentation TTA configurations improved accuracy by up to 1.4 percentage points, significantly outperforming single-sample and multi-augmentation policies.
- The 4-sample, 1-augmentation policy created more corrections (misclassified examples fixed by augmentation) than corruptions (correct examples misclassified), leading to net accuracy gains.
- Corrections showed higher prediction overlap (average 0.51) across samples than corruptions (0.23), suggesting ensemble averaging stabilizes correct predictions.
- Word-based transforms (e.g., synonym replacement using WordNet or PPDB) outperformed character-based transforms, which often altered word stems and led to semantic misclassification.
- TTA achieved 93.7% accuracy on the CivilComments dataset, surpassing the original model’s 92.3% accuracy despite no fine-tuning or training-time augmentation.
- Multi-sample single-augmentation offered the best trade-off between computational cost and accuracy gain, as multi-augmentation configurations provided only marginal improvements (≤0.04%).
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.