Generating Sentences from Disentangled Syntactic and Semantic Spaces

Yu Bao, Hao Zhou, Shujian Huang, Lei Li, Lili Mou, Olga Vechtomova, Xin-Yu Dai, Jiajun Chen

Abstract

Variational Auto-encoders (VAEs) are powerful tools for text generation, yet they typically interweave syntax and semantics within a single latent space. This entanglement limits the ability to perform precise manipulations, such as paraphrasing or style transfer. We introduce DSS-VAE, a model that explicitly separates meaning from structure into two distinct latent spaces. By leveraging linearized parse trees and adversarial training, DSS-VAE allows for "mixing and matching" sentence styles and contents, outperforming standard VAEs in both fluency and reconstruction.

Introduction

The primary challenge in using VAEs for text generation is the lack of structural control. In a standard VAE, moving through the latent space often changes both the meaning and the structure of a sentence simultaneously. This makes tasks like unsupervised paraphrasing—where the goal is to preserve meaning while altering syntax—extremely difficult. Previous solutions often relied on rigid grammar constraints that sacrificed the smoothness of the latent space. DSS-VAE addresses this by modeling syntax explicitly while maintaining a continuous, searchable representation.

The DSS-VAE Framework

The core innovation of this work is the separation of the latent variable $z$ into two components: $z_{sem}$ (semantics) and $z_{syn}$ (syntax). To ensure effective disentanglement, the authors employ three primary strategies:

  1. Linearized Parse Trees: The syntactic space $z_{syn}$ is trained to predict a linearized version of a constituency parse tree (e.g., S NP PRP /NP VP ...). This forces the model to capture structural blueprints rather than just word sequences.
  2. Multi-Task and Adversarial Learning: The model uses a multi-task approach where $z_{sem}$ predicts the "Bag-of-Words" (content) and $z_{syn}$ predicts the tree structure. Adversarial classifiers are then used to prevent "leakage"—ensuring $z_{syn}$ contains no content information and $z_{sem}$ contains no structural information.
  3. Adversarial Reconstruction Loss: This ensures that both latent spaces are necessary for full sentence reconstruction, preventing the decoder from ignoring one of the components.
The DSS-VAE architecture disentangles latent spaces using multi-task and adversarial losses.

Experimental Evaluation

The model was evaluated on the Penn Treebank (PTB) for language modeling, the Quora Question Pairs dataset for unsupervised paraphrasing, and the Stanford Natural Language Inference (SNLI) dataset for syntax transfer.

Key Results and Insights

A significant finding is the "inadmissibility" of vanilla VAEs. When plotting fluency (Forward Perplexity) against reconstruction quality (BLEU), DSS-VAE consistently occupies the superior "upper-left" region of the graph. This indicates that DSS-VAE achieves a better trade-off, outperforming standard VAEs on both metrics simultaneously.

Comparison of BLEU vs. Forward-PPL shows DSS-VAE achieving a better trade-off than vanilla VAEs.

In the task of unsupervised paraphrasing, DSS-VAE achieved a BLEU-ref of 20.54 on the Quora dataset, surpassing the state-of-the-art CGMH method (18.85). Furthermore, the model demonstrated successful syntax transfer (or "syntax grafting"), where the structure of one sentence is applied to the meaning of another. Quantitative evaluations using Tree Edit Distance (TED) confirmed that generated sentences were structurally closer to the intended syntax provider.

Conclusion and Future Work

DSS-VAE represents a significant step toward controllable text generation by treating syntax as a high-dimensional sequence problem rather than a simple categorical attribute. While the model shows great promise, it faces challenges when semantic and syntactic inputs are highly incompatible (e.g., mapping a complex structure onto a very short meaning). Future work will explore more sophisticated disentanglement techniques and the application of this framework to other stylistic attributes beyond syntax.

Summary updated

BibTeX
@inproceedings{bao2019generating,
  author = {Yu Bao and Hao Zhou and Shujian Huang and Lei Li and Lili Mou and Olga Vechtomova and Xin-Yu Dai and Jiajun Chen},
  title = {{Generating Sentences from Disentangled Syntactic and Semantic Spaces}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2019},
  doi = {10.18653/v1/p19-1602},
}
Figure