Semantic Parsing with Semi-Supervised Sequential Autoencoders

Tomás Kociský, Gábor Melis, Edward Grefenstette, Chris Dyer, Wang Ling, Phil Blunsom, Karl Moritz Hermann

Abstract

We present a novel semi-supervised approach for sequence transduction and apply it to semantic parsing. The unsupervised component is based on a generative model in which latent sentences generate the unpaired logical forms. We apply this method to a number of semantic parsing tasks focusing on domains with limited access to labelled training data and extend those datasets with synthetically generated logical forms.

Introduction

Semantic parsing—the task of translating natural language (e.g., "What is the capital of Texas?") into machine-readable logical forms (e.g., answer(capital(stateid('texas')))—is a critical component for building natural interfaces to databases. While neural sequence-to-sequence (S2S) models have shown great promise, they are notoriously data-hungry. Collecting pairs of natural language sentences and their corresponding code is expensive and requires expert annotation.

In many domains, however, the "output" side (the logical forms or code) is relatively easy to find or generate synthetically. The core challenge addressed in this work is: How can we train a semantic parser using only logical forms? Standard autoencoders struggle with this because the intermediate "latent" step is a sequence of discrete words, which prevents the direct application of gradient-based optimization.

Methodology: The SEQ4 Architecture

We propose the SEQ4 model, a semi-supervised architecture comprising a chain of four Long Short-Term Memory (LSTM) networks. The model treats natural language as a latent variable in a differentiable sequential autoencoder ($y \to x \to y$), allowing it to learn from unpaired data.

The SEQ4 architecture showing the sequence-to-sequence autoencoder flow.

The four components are:

  1. Encoder ($y$): Reads the input logical form.
  2. Latent Predictor ($\tilde{x}$): Predicts a "latent" natural language sentence.
  3. Latent Encoder ($\tilde{x}$): Reads the predicted latent sentence.
  4. Decoder ($y$): Reconstructs the original logical form.

The Differentiable Trick

To overcome the non-differentiability of discrete word choices, we avoid picking specific words for the latent sentence $\tilde{x}$ during training. Instead, we draw from a logistic-normal distribution. By using the "reparameterization trick," the model can backpropagate through this continuous relaxation of discrete symbols. This allows the entire $y \to x \to y$ pipeline to be trained end-to-end via gradient descent. The final loss function combines standard supervised learning (for $(x, y)$ pairs) with an unsupervised reconstruction loss (for unpaired $y$).

Experimental Setup

The model was evaluated on three distinct semantic parsing tasks:

  • GEOQUERY: 880 questions about US geography.
  • SAIL: A maze navigation task mapping instructions to action sequences.
  • NLMAPS: A dataset for querying OpenStreetMap.

To leverage the semi-supervised component, we introduced synthetic data generation. For GEOQUERY, a 3-gram model created 7 million synthetic queries. For SAIL, we generated 150k random paths in a new, larger maze.

Results and Discussion

SEQ4 achieved state-of-the-art results on several benchmarks. On GEOQUERY, it reached 87.3% accuracy, outperforming previous neural models. On the SAIL dataset, the semi-supervised approach improved performance from a 58.6% supervised baseline to 63.25%.

Performance comparison on GEOQUERY with varying amounts of supervised data.

A key insight is the model's effectiveness under extreme data scarcity. As shown in the ablation studies, when only 5% of the labeled data was available, the semi-supervised model outperformed the purely supervised S2S baseline by nearly 10 percentage points. This demonstrates that treating natural language as a structured latent bottleneck, regularized via KL divergence, allows the model to extract significant signal from unpaired logical forms.

Conclusion

The SEQ4 model demonstrates that semi-supervised learning via sequential autoencoders is a viable path for semantic parsing in low-resource domains. Future work includes extending this to a dual formulation that also utilizes unpaired natural language and exploring more sophisticated synthetic data generation methods for complex domains like NLMAPS.

Summary updated

BibTeX
@inproceedings{kocisky2016semantic,
  author = {Tomás Kociský and Gábor Melis and Edward Grefenstette and Chris Dyer and Wang Ling and Phil Blunsom and Karl Moritz Hermann},
  title = {{Semantic Parsing with Semi-Supervised Sequential Autoencoders}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2016},
  url = {https://openreview.net/forum?id=B1NVoGGdbH},
}
Figure