Learning from Executions for Semantic Parsing

Bailin Wang, Mirella Lapata, Ivan Titov

Introduction

Semantic parsing—the task of translating natural language queries into machine-executable code like SQL or lambda calculus—is a critical component of modern natural language interfaces. However, the development of these systems is often hindered by a significant data bottleneck: training requires large-scale datasets of utterance-program pairs. Creating these pairs is expensive and time-consuming, as it requires domain experts to write complex code for every natural language query.

To address this, researchers have turned to semi-supervised learning to leverage the abundance of unlabeled user queries. This paper introduces Execution-guided Posterior Regularization (X-PR), a framework that utilizes a "free" signal: whether a generated program actually runs on a target database or environment. While executability does not guarantee correctness, it serves as a powerful filter to eliminate impossible candidates.

Figure 1: Example of program candidates where executability (Exe) does not always imply correctness (Gold).

The Challenge of Weak Supervision

The primary challenge in learning from executions is the presence of "spurious" programs—queries that are syntactically valid and return data but do not actually represent the user's intent. As shown in Figure 1, a program might be executable (Exe) but fail to match the gold standard (Gold). Furthermore, standard maximum marginal likelihood (MML) approaches often suffer from a "short program bias," where the model learns to prefer overly simplistic programs because they are statistically more likely to be executable by chance.

Methodology: Execution-guided Posterior Regularization (X-PR)

The X-PR framework improves upon standard semi-supervised techniques like Self-Training by introducing three novel training objectives designed to better navigate the space of executable programs:

  1. Repulsion MML: This objective explicitly penalizes programs that were encountered during beam search but failed to execute. By telling the model what not to generate, it narrows the search space toward valid logical forms.
  2. Gentle MML: This is a conservative approach that shifts probability mass away from non-executable programs and toward executable ones. Crucially, it does so without over-committing to unseen programs, preventing the model from becoming overconfident in potentially spurious candidates.
  3. Sparse MML: To combat the spurious program problem, Sparse MML utilizes a SparseMax operator. This encourages the model to concentrate its probability mass on a very small subset of executable programs, reflecting the reality that typically only one specific program correctly captures the user's intent.

These objectives are integrated into a state-of-the-art RAT-SQL base parser, which employs a relation-aware Transformer to model the complex relationships between natural language utterances and database schemas.

Experimental Evaluation

The researchers evaluated X-PR on two benchmark datasets: OVERNIGHT (covering 8 domains like Recipes and Calendar) and GEOQUERY (US geography questions). To simulate low-data environments, they used a split where only 10% to 30% of the data was labeled, treating the remainder as unlabeled queries for X-PR training.

Results and Analysis

The X-PR methods consistently outperformed both the supervised-only baselines and standard semi-supervised techniques like Self-Training and Top-K MML.

Figure 2: Training dynamics showing (a) average ratios and (b) coverage of gold programs for various MML objectives.

As illustrated in Figure 2, the proposed objectives—particularly Sparse MML—demonstrate superior performance in terms of gold program coverage over the course of training. On the OVERNIGHT dataset with 30% labeled data, Sparse MML achieved an average accuracy of 72.7%, compared to the supervised baseline of 68.5% and Self-Training at 70.3%. This improvement effectively "creates" the value of an additional 10-15% of expert-labeled data for free.

Conclusion

X-PR demonstrates that execution signals provide a robust, cost-effective way to improve semantic parsers. By explicitly handling non-executable programs and encouraging sparsity to avoid spurious results, the framework bridges the performance gap in low-resource settings. Future work may involve extending these techniques to learning directly from denotations (final answers) and applying them to larger, more complex datasets.

Summary updated

BibTeX
@inproceedings{wang2021learning,
  author = {Bailin Wang and Mirella Lapata and Ivan Titov},
  title = {{Learning from Executions for Semantic Parsing}},
  booktitle = {Conference of the North American Chapter of the Association for Computational Linguistics},
  year = {2021},
  doi = {10.18653/v1/2021.naacl-main.219},
}
Figure