[Paper Review] Conditional BERT Contextual Augmentation
This paper proposes conditional BERT contextual augmentation, a novel data augmentation method that fine-tunes BERT with a label-conditional masked language model (C-MLM) to generate semantically consistent, label-compatible sentence variations. The method significantly improves text classification performance across six datasets when applied to both CNN and RNN classifiers, outperforming existing baselines and enabling applications in style transfer.
We propose a novel data augmentation method for labeled sentences called conditional BERT contextual augmentation. Data augmentation methods are often applied to prevent overfitting and improve generalization of deep neural network models. Recently proposed contextual augmentation augments labeled sentences by randomly replacing words with more varied substitutions predicted by language model. BERT demonstrates that a deep bidirectional language model is more powerful than either an unidirectional language model or the shallow concatenation of a forward and backward model. We retrofit BERT to conditional BERT by introducing a new conditional masked language model\footnote{The term "conditional masked language model" appeared once in original BERT paper, which indicates context-conditional, is equivalent to term "masked language model". In our paper, "conditional masked language model" indicates we apply extra label-conditional constraint to the "masked language model".} task. The well trained conditional BERT can be applied to enhance contextual augmentation. Experiments on six various different text classification tasks show that our method can be easily applied to both convolutional or recurrent neural networks classifier to obtain obvious improvement.
Motivation & Objective
- To address the limitation of existing text data augmentation methods that fail to preserve label compatibility during word replacement.
- To enhance contextual augmentation by leveraging BERT’s deep bidirectional representations with label-conditioned predictions.
- To develop a general-purpose data augmentation framework applicable to both convolutional and recurrent neural network classifiers.
- To explore the potential of conditional BERT beyond classification, particularly in style transfer tasks.
Proposed method
- Fine-tune BERT using a novel conditional masked language model (C-MLM) objective that conditions word prediction on both context and sentence label.
- Apply C-MLM by randomly masking tokens in input sentences and training the model to predict label-compatible replacements.
- Use the fine-tuned conditional BERT model to generate augmented training samples by replacing masked words with predicted label-consistent substitutes.
- Apply the augmented data to train both CNN and RNN classifiers on text classification tasks.
- Adapt the conditional BERT model for style transfer by reversing the input label and generating sentences with opposite sentiment using the same C-MLM mechanism.
- Utilize attention-based methods to identify style-relevant words in sentences, which are then masked and replaced to transfer sentiment style.
Experimental results
Research questions
- RQ1Can a deep bidirectional transformer-based language model be effectively fine-tuned to generate data augmentations that preserve label compatibility?
- RQ2How does conditional BERT contextual augmentation compare to existing replacement-based and contextual augmentation methods in terms of performance on text classification tasks?
- RQ3To what extent can the conditional BERT model generalize across different neural network architectures (e.g., CNN vs. RNN) in downstream classification tasks?
- RQ4Can the conditional BERT model be repurposed for style transfer by conditioning on target sentiment labels?
- RQ5What is the optimal number of fine-tuning steps required for conditional BERT to outperform standard BERT in data augmentation?
Key findings
- Conditional BERT contextual augmentation significantly improves classification accuracy across six diverse text classification datasets when used with both CNN and RNN classifiers.
- The method outperforms baseline approaches including synonym replacement (w/WordNet), contextual augmentation (w/context), and label-conditional contextual augmentation (w/context+label).
- Conditional BERT achieves performance gains with as few as 1–6 fine-tuning epochs, indicating high efficiency and ease of deployment.
- The model demonstrates strong generalization, with fine-tuning epochs required to outperform standard BERT ranging from 1 to 6 depending on the dataset and classifier.
- Conditional BERT can successfully perform style transfer by generating sentences with reversed sentiment while preserving sentence structure and context.
- The conditional BERT model generates semantically coherent and label-compatible sentence variations, as validated by qualitative examples on the SST2 dataset.
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.