Weakly Supervised Semantic Parsing with Execution-based Spurious Program Filtering

Kang-il Lee, Segwang Kim, Kyomin Jung

Abstract

The problem of spurious programs is a longstanding challenge when training a semantic parser from weak supervision. To eliminate such programs that have wrong semantics but correct denotation, existing methods focus on exploiting similarities between examples based on domain-specific knowledge. In this paper, we propose a domain-agnostic filtering mechanism based on program execution results. Specifically, for each program obtained through the search process, we first construct a representation that captures the program's semantics as execution results under various inputs. Then, we run a majority vote on these representations to identify and filter out programs with significantly different semantics from the other programs. In particular, our method is orthogonal to the program search process so that it can easily augment any of the existing weakly supervised semantic parsing frameworks. Empirical evaluations on the Natural Language Visual Reasoning and WikiTableQuestions demonstrate that applying our method to the existing semantic parsers induces significantly improved performances.

Introduction

Semantic parsing is the process of translating natural language into machine-executable code. Ideally, these models are trained using pairs of utterances and their corresponding programs. However, because writing programs is expensive and requires expert knowledge, researchers often turn to weak supervision, where models are trained only on the utterance and the final answer (the denotation).

The primary challenge in weak supervision is the spurious program problem: the model may find a program that is logically incorrect but happens to yield the correct answer by coincidence on a specific dataset. These programs introduce noise that prevents the model from learning true logic. This paper introduces a domain-agnostic filtering mechanism that identifies these imposters by executing candidate programs across multiple different "worlds" and using a majority vote to keep only those that exhibit consistent semantic behavior.

Execution-based Filtering Mechanism

The core idea is that while a spurious program might get the right answer on one specific table or image, it is unlikely to behave like the "gold" (correct) program when executed on different inputs. The proposed method treats a program's "meaning" not as its syntax, but as its behavior across a distribution of inputs.

Program Representation and World Selection

For every candidate program generated by the parser, a representation vector is created. Each entry in the vector is the result of executing that program on a different "world" (a different image or table).

  • NLVR (Images): The system retrieves other images from the training set that have similar descriptions using BLEU scores.
  • WTQ (Tables): To handle varying column names across tables, the authors developed a "consistent replacement" strategy, swapping entity and column names in the program with those found in a target table of the same data type.
Consistent replacement strategy for WTQ tables.

Majority Voting and Filtering

The filtering process assumes that among the pool of programs that yielded the correct answer on the original input, the "gold" programs will behave similarly to each other on new inputs, while spurious ones will deviate.

Conceptual illustration of gold vs. spurious programs across worlds.

Two types of voting are employed:

  1. Hard Vote: A "centroid" behavior is defined by the most common result for each world. This works best for binary tasks like NLVR.
  2. Soft Vote: Programs are scored based on the proportion of other programs that share their execution results, which is superior for the diverse answer space of WTQ.

Programs that fall below a certain similarity threshold to the majority behavior are discarded before the model updates its weights.

Experimental Results

Empirical evaluations on two major benchmarks demonstrate that the filtering mechanism consistently improves the performance of state-of-the-art base parsers:

  • NLVR: On the LLD+CR base model, the method improved test consistency from 72.5% to 73.7%, achieving a new state-of-the-art for models not using external data.
  • WikiTableQuestions (WTQ): Applying the filter to the Structured Attention parser improved test accuracy from 44.5% to 44.8%.
  • Spurious Detection: In a manual analysis of 30 NLVR examples, the filter achieved an F1-score of 85.7% in identifying spurious programs.

Conclusion

This research presents an orthogonal filtering mechanism that can be plugged into almost any existing weakly supervised semantic parser. By leveraging execution results across multiple worlds, the system effectively identifies spurious programs without requiring hand-written rules, leading to more robust learning across different domains.

Summary updated

BibTeX
@inproceedings{lee2023weakly,
  author = {Kang-il Lee and Segwang Kim and Kyomin Jung},
  title = {{Weakly Supervised Semantic Parsing with Execution-based Spurious Program Filtering}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2023},
  url = {https://openreview.net/forum?id=aUn1BAzo7q},
}
Figure