StructVAE: Tree-structured Latent Variable Models for Semi-supervised Semantic Parsing

Pengcheng Yin, Chunting Zhou, Junxian He, Graham Neubig

Abstract

Semantic parsing is the task of transducing natural language (NL) utterances into formal meaning representations (MRs), commonly represented as tree structures. Annotating NL utterances with their corresponding MRs is expensive and time-consuming, and thus the limited availability of labeled data often becomes the bottleneck of data-driven, supervised models. We introduce StructVAE, a variational auto-encoding model for semisupervised semantic parsing, which learns both from limited amounts of parallel data, and readily-available unlabeled NL utterances. StructVAE models latent MRs not observed in the unlabeled data as tree-structured latent variables. Experiments on semantic parsing on the ATIS domain and Python code generation show that with extra unlabeled data, StructVAE outperforms strong supervised models.

Introduction

Semantic parsing—the task of converting natural language (NL) into formal meaning representations (MRs) like SQL, Python code, or lambda calculus—is notoriously "data-hungry." Because MRs are complex and highly structured, creating labeled datasets requires expert annotators, making it expensive and slow. While unlabeled natural language is abundant (e.g., questions asked to a search engine or comments on GitHub), most semantic parsers cannot utilize it because they lack the corresponding target MR. StructVAE addresses this labeled data bottleneck by proposing a way to learn from both limited parallel data (NL-MR pairs) and abundant unlabeled NL utterances using a variational auto-encoding framework.

Methodology

StructVAE adapts the Variational Autoencoder (VAE) framework to handle structured, discrete outputs. Unlike standard VAEs that use "flat" continuous vectors as latent variables, StructVAE models the latent space as tree-structured MRs. This forces the latent space to correspond directly to the symbolic structures (Abstract Syntax Trees) required for semantic parsing.

The StructVAE architecture consists of an inference model (parser), a reconstruction model (decoder), and a prior over the latent semantic space.

The model consists of three main components:

  1. The Inference Model (The Parser): An off-the-shelf transition-based parser that maps an NL utterance ($x$) into a tree-structured MR ($z$). It uses an Abstract Syntax Description Language (ASDL) grammar to ensure the generated trees are syntactically valid.
  2. The Reconstruction Model (The Decoder): An attentional sequence-to-sequence model that takes the generated tree ($z$) and attempts to recreate the original NL utterance ($x$).
  3. The Prior: A language model that estimates how "natural" or likely a generated MR tree is, independently of the input text.
An example of a tree-structured meaning representation (AST) for the Python command `sorted(my_list, reverse=True)`.

Training Strategy

On labeled data, the model minimizes standard parsing loss. On unlabeled data, it maximizes the Variational Lower Bound (ELBO). The model guesses a latent MR, checks its "naturalness" via the Prior, and verifies if it can reconstruct the original input. Since the latent trees are discrete, the authors use the REINFORCE algorithm with a carefully designed baseline to stabilize training.

Key Insights

  • The "Reconstruction" Signal: If a parser produces a high-quality meaning representation, that representation should contain enough information to reconstruct the original sentence. This provides an external "sanity check" on the parser's guesses.
  • Prior Knowledge as Regularization: The prior (a language model over code/logic) prevents the parser from hallucinating "gibberish" structures that might technically allow for reconstruction but are invalid in the target language.
  • Robustness over Self-Training: Standard self-training can reinforce a model's own errors. StructVAE is more robust because the reconstruction and prior components provide independent signals for validation.

Experiments and Results

The model was evaluated on the ATIS dataset (flight inquiries) and the DJANGO dataset (Python code). To simulate a semi-supervised environment, the authors sub-sampled these datasets to create small labeled sets.

StructVAE consistently outperformed supervised baselines across different data sizes. On the DJANGO dataset with only 1,000 labeled examples, StructVAE achieved 52.0% accuracy compared to the supervised baseline's 49.9%. Gains were most significant when labeled data was very scarce; on ATIS with 500 labels, the model improved performance by nearly 3% absolute. Furthermore, the framework proved generalizable across different types of parsers and meaning representations.

Conclusion

StructVAE demonstrates the effectiveness of treating meaning representations as structured latent variables in a semi-supervised setting. While training with REINFORCE is sensitive to hyperparameters, the inclusion of a reconstruction signal and a structured prior allows the model to leverage unlabeled data effectively. Future work may extend this framework to graph-structured latent variables to handle representations like Abstract Meaning Representation (AMR).

Summary updated

BibTeX
@inproceedings{yin2018structvae,
  author = {Pengcheng Yin and Chunting Zhou and Junxian He and Graham Neubig},
  title = {{StructVAE: Tree-structured Latent Variable Models for Semi-supervised Semantic Parsing}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2018},
  url = {https://openreview.net/forum?id=Sybv3heObB},
}
Figure