DoubleMix: Simple Interpolation-Based Data Augmentation for Text Classification

Hui Chen, Wei Han, Diyi Yang, Soujanya Poria

Abstract

Deep learning models for Natural Language Processing (NLP) often struggle with data scarcity, leading to overfitting and reliance on shallow heuristics. We present DoubleMix, a novel two-step data augmentation strategy that performs interpolation within the hidden space of neural models. Unlike traditional Mixup methods that interpolate between different classes, DoubleMix blends an original text sample with a weighted combination of its own perturbed variants. This approach allows the model to explore a multi-dimensional "feature polygon," significantly boosting robustness and performance in text classification tasks, particularly in low-resource settings.

Introduction

Deep learning models for NLP are notoriously data-hungry. When labeled data is limited, these models often fail to generalize, instead capturing shortcuts that do not hold in real-world applications. While data augmentation (DA) is a common remedy, existing techniques face significant hurdles. Token-level methods, such as synonym replacement or back-translation, can produce grammatically incoherent or semantically altered sentences. Conversely, hidden-level methods like Mixup or TMix typically interpolate between samples of different classes, creating "soft labels" that may not accurately represent the underlying data manifold, leading to inefficient learning.

DoubleMix addresses these challenges by shifting the focus from inter-class interpolation to intra-class exploration. By mixing a sample with its own variations, the model learns to be invariant to noise within a specific class's manifold, avoiding the ambiguity of mixed labels.

Methodology

DoubleMix introduces a two-step interpolation process integrated within the hidden layers of a transformer-based architecture, such as BERT. The process consists of four primary components:

  1. Perturbation Generation: For a given input $x$, the system generates $N$ perturbed versions using operations such as back-translation, synonym replacement, or the addition of Gaussian noise.
  2. Step I: The Polygon Mix: The hidden representations of these $N$ perturbed samples are combined using weights drawn from a Dirichlet distribution. This creates a "synthetic" perturbed feature representing a point within a polygon formed by the perturbations in the feature space.
  3. Step II: The Anchor Mix: This synthetic feature is then mixed with the hidden representation of the original "anchor" sample using a Beta distribution. The original sample is constrained to have a higher weight, ensuring the resulting feature remains close to the ground truth and does not degrade into noise.
  4. Consistency Regularization: To stabilize training, the model employs a Jensen-Shannon Divergence (JSD) loss in addition to standard Cross-Entropy. This forces the model to produce consistent probability distributions for both the original and the augmented DoubleMix features.

Experimental Setup

The effectiveness of DoubleMix was evaluated across six diverse text classification benchmarks, including Sentiment Analysis (SST-2, IMDB), Question Classification (TREC), Humor Detection (Puns), and Natural Language Inference (SNLI, MNLI). A specific emphasis was placed on low-resource settings, where the NLI datasets were subsampled to 1K, 2.5K, 5K, and 10K training examples to test the model's efficiency with limited data.

Key Insights and Results

Performance and Data Efficiency

DoubleMix consistently outperformed the BERT baseline and popular DA methods—including EDA, Back-translation, TMix, and SSMix—across all datasets. The gains were most significant in low-resource scenarios; for instance, on the SNLI dataset with only 1,000 samples, DoubleMix improved accuracy by approximately 2% over the baseline.

Feature Space and Robustness

Analysis of the model's internal behavior revealed several key insights:

  • From Lines to Polygons: While traditional Mixup interpolates along a line between two points, DoubleMix’s use of Dirichlet sampling allows it to explore a multi-dimensional region around the original sample, providing a denser training signal.
  • Optimal Interpolation Depth: Ablation studies indicated that interpolating in the deeper layers of BERT (layers 9-12) is most effective, as these layers capture the complex semantic information necessary for meaningful feature shifting.
  • Counterfactual Robustness: DoubleMix showed marked improvement on counterfactual examples—sentences where minor changes flip the logical meaning—suggesting the model learns actual semantics rather than keyword memorization.
  • Clustering: t-SNE visualizations demonstrated that DoubleMix produces tighter and better-separated class clusters compared to standard BERT training.

Conclusion

DoubleMix provides a simple yet powerful framework for enhancing text classifiers through intra-class interpolation. By leveraging consistency regularization and polygon-based feature exploration, it overcomes the semantic and label-noise limitations of previous augmentation strategies. Future research will explore making the interpolation weights learnable and extending the DoubleMix framework to Natural Language Generation (NLG) tasks, where maintaining semantic consistency is even more critical.

Summary updated

BibTeX
@inproceedings{chen2022doublemix,
  author = {Hui Chen and Wei Han and Diyi Yang and Soujanya Poria},
  title = {{DoubleMix: Simple Interpolation-Based Data Augmentation for Text Classification}},
  booktitle = {International Conference on Computational Linguistics},
  year = {2022},
}
Figure