Skip to main content
QUICK REVIEW

[Paper Review] Improving Robustness and Generality of NLP Models Using Disentangled Representations

Jiawei Wu, Xiaoya Li|arXiv (Cornell University)|Sep 21, 2020
Topic ModelingComputer Science96 references5 citations
TL;DR

This paper proposes a disentangled representation learning framework that improves NLP model robustness and generalization by mapping inputs to multiple disentangled representations, which are ensembled for final prediction. Using L2 regularization or Total Correlation within a variational information bottleneck, the method enhances adversarial defense and cross-domain generalization with minimal accuracy drop on standard tasks.

ABSTRACT

Supervised neural networks, which first map an input $x$ to a single representation $z$, and then map $z$ to the output label $y$, have achieved remarkable success in a wide range of natural language processing (NLP) tasks. Despite their success, neural models lack for both robustness and generality: small perturbations to inputs can result in absolutely different outputs; the performance of a model trained on one domain drops drastically when tested on another domain. In this paper, we present methods to improve robustness and generality of NLP models from the standpoint of disentangled representation learning. Instead of mapping $x$ to a single representation $z$, the proposed strategy maps $x$ to a set of representations $\{z_1,z_2,...,z_K\}$ while forcing them to be disentangled. These representations are then mapped to different logits $l$s, the ensemble of which is used to make the final prediction $y$. We propose different methods to incorporate this idea into currently widely-used models, including adding an $L$2 regularizer on $z$s or adding Total Correlation (TC) under the framework of variational information bottleneck (VIB). We show that models trained with the proposed criteria provide better robustness and domain adaptation ability in a wide range of supervised learning tasks.

Motivation & Objective

  • To address the lack of robustness and domain generalization in supervised NLP models due to entangled representations.
  • To improve model resilience against adversarial attacks and distribution shift across domains.
  • To enable disentanglement of source-specific, target-specific, and general features through structured representation learning.
  • To develop a simple yet effective end-to-end method that enhances interpretability and performance without significant accuracy loss.

Proposed method

  • The model maps input x to K disentangled representations {z₁, ..., zK} instead of a single z, promoting feature separation.
  • Each representation zi is independently projected to a logit li, and the final prediction y is derived from an ensemble of logits.
  • L2 regularization is applied to encourage diversity and disentanglement among the representations.
  • Total Correlation (TC) is incorporated under the Variational Information Bottleneck (VIB) framework to minimize mutual information between representations.
  • The training objective combines cross-entropy loss with disentanglement regularizers (βL2 or γTC) to balance task accuracy and representation disentanglement.
  • First-order derivative saliency analysis is used to visualize how individual tokens influence each disentangled representation.

Experimental results

Research questions

  • RQ1Can disentangled representations improve model robustness against adversarial examples in NLP?
  • RQ2Can disentangled representations enhance domain generalization across distribution shifts in NLP tasks?
  • RQ3Does enforcing representation disentanglement via L2 or TC regularization lead to better performance on downstream tasks?
  • RQ4How do different hyperparameter settings (β, γ) affect the trade-off between robustness and accuracy?
  • RQ5Can disentangled representations capture distinct semantic aspects (e.g., sentiment polarity) in a more interpretable way?

Key findings

  • The VIB+TC method achieved 40.2% accuracy on the PWWS adversarial attack benchmark (IMDB, CNN backbone), outperforming the baseline (36.1%) at γ=0.15.
  • The Regularizer method achieved 22.7% accuracy on the PWWS attack at β=0.15, compared to 18.1% for the baseline, showing improved robustness.
  • With β=0.15, the Regularizer method improved clean accuracy to 90.1% on IMDB while significantly boosting adversarial defense performance.
  • The VIB+TC method achieved 38.8% accuracy on the GA (w/LM) attack at γ=0.15, compared to 34.7% for the baseline, indicating strong defense capability.
  • Visualization showed that z₁ encoded positive sentiment while z₄ encoded negative sentiment, confirming disentanglement of semantic factors.
  • The optimal hyperparameter values for β and γ were found to be around 0.1–0.15, with performance dropping sharply beyond this range.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.