Consistency Training with Virtual Adversarial Discrete Perturbation

Jungsoo Park, Gyuwan Kim, Jaewoo Kang

Abstract

Consistency training is a cornerstone of semi-supervised learning, yet its effectiveness in Natural Language Processing (NLP) is often limited by model-agnostic perturbations. We present VAT-D (Virtual Adversarial Training with Discrete noise), a method that leverages model gradients to identify discrete adversarial token replacements. By targeting the model's specific vulnerabilities while maintaining semantic coherence via pre-trained language models, VAT-D achieves significant performance gains in low-resource settings and enhances robustness against adversarial attacks. Our results demonstrate that targeted, discrete perturbations provide a more effective regularization signal than random or continuous noise.

Introduction

In machine learning, consistency training utilizes unlabeled data by enforcing the principle that a model's predictions should remain stable under small input perturbations. For example, changing "The movie was good" to "The film was great" should not alter a sentiment classifier's output.

However, most existing text-based augmentation methods, such as Easy Data Augmentation (EDA) or back-translation, are model-agnostic. They do not account for the specific decision boundaries of the model being trained. Consequently, many augmented samples are "too easy," failing to challenge the model or refine its decision boundaries effectively. While Virtual Adversarial Training (VAT) has been successful in continuous domains like computer vision, applying it to discrete text is challenging due to the non-differentiable nature of dictionary lookups.

Methodology: VAT-D

The authors propose VAT-D to bridge the gap between adversarial training and discrete text. The approach follows a three-step pipeline:

  1. Distribution Sharpening: Standard consistency loss often suffers from a "dead zone" where gradients vanish if the perturbed input is too similar to the original. VAT-D "sharpens" the model's initial prediction on unlabeled data, amplifying high probabilities to provide a clearer gradient signal for finding directions that maximize model confusion.
  2. Semantic Filtering: To ensure that adversarial changes do not flip the ground-truth label (e.g., changing "good" to "bad"), a pre-trained Masked Language Model (MLM) like BERT is used to identify the top-10 contextually appropriate replacement candidates for a given word.
  3. Adversarial Token Replacement: Among the filtered candidates, the system uses the sharpened gradient to select the specific token that causes the highest divergence in the model’s output. This "white-box" search ensures the perturbation is specifically targeted at the model's current weaknesses.

Key Insights and Results

The core innovation of VAT-D is the shift from random noise to targeted adversarial noise. By pushing the decision boundary in low-density regions where the model is most brittle, the model learns to be more robust with significantly fewer labeled examples.

Figure 5: (a) Distribution of selected indices from the top-k candidates. (b) Consistency loss over training steps for various augmentation strategies.

As shown in the analysis above, VAT-D maintains a much higher consistency loss throughout training compared to uniform or sampling-based methods. This indicates that VAT-D successfully identifies "harder" examples that provide a stronger training signal. Furthermore, the distribution of selected indices shows that VAT-D explores the full range of semantically valid candidates, whereas standard sampling is heavily biased toward the most likely (and often least informative) word.

Performance Benchmarks

  • Semi-Supervised Learning: On the AG News dataset with only 10 labels per class, VAT-D outperformed a standard BERT baseline by 7.1 points, surpassing other consistency methods like UDA and EDA by nearly 3 points.
  • Robustness: On the Adversarial NLI (ANLI) benchmark—designed specifically to fool state-of-the-art models—VAT-D improved RoBERTa-Large test accuracy by 8.0 points over standard training, even outperforming complex optimization-based baselines like SMART.

Limitations and Future Work

While effective, VAT-D introduces a computational overhead, running approximately 2.5x slower than standard training due to the additional forward/backward passes required for adversarial search. Additionally, simultaneous replacement of multiple tokens can occasionally result in ungrammatical sentences. Future work may involve entity-aware filtering to prevent the replacement of factual anchors (e.g., city names) that could inadvertently change the ground truth of a task.

Conclusion

VAT-D demonstrates that discrete adversarial perturbations are a powerful tool for NLP consistency training. By combining the semantic constraints of language models with gradient-based adversarial search, the method provides a robust framework for improving both model performance in low-data regimes and generalizability against adversarial attacks.

Summary updated

BibTeX
@inproceedings{park2022consistency,
  author = {Jungsoo Park and Gyuwan Kim and Jaewoo Kang},
  title = {{Consistency Training with Virtual Adversarial Discrete Perturbation}},
  booktitle = {Conference of the North American Chapter of the Association for Computational Linguistics},
  year = {2022},
  doi = {10.18653/v1/2022.naacl-main.414},
}
Figure