Model-based Interactive Semantic Parsing: A Unified Framework and A Text-to-SQL Case Study

Ziyu Yao, Yu Su, Huan Sun, Wen-tau Yih

Abstract

Semantic parsing, the task of converting natural language into formal code like SQL, is essential for natural language interfaces to databases. However, current systems struggle with ambiguity, model limitations, and a lack of user trust. This paper introduces MISP (Model-based Interactive Semantic Parsing), a unified framework that transforms static semantic parsers into intelligent agents capable of proactive interaction. By utilizing uncertainty-based error detection and a "world model" to incorporate user feedback, MISP significantly improves text-to-SQL accuracy while minimizing the interaction burden on the user.

Introduction

Despite advancements in neural semantic parsing, converting vague or complex user queries into accurate SQL remains challenging. Users often find it difficult to verify the output of "black box" models, leading to a lack of trust. While interactive parsing—incorporating human feedback—offers a solution, previous approaches were often ad-hoc and tightly coupled to specific architectures. The MISP framework addresses these issues by providing a generalizable, modular system that can work with any base parser to resolve ambiguities through targeted, binary questions.

The MISP Framework

The authors frame the problem as an interaction between a Model-based Intelligent Agent and its environment (the user). The MISP framework is composed of four primary components that manage the parsing state and the interaction loop:

  1. Agent State: This represents the current state of the semantic parse, which may be partial or complete.
  2. World Model: Acting as a wrapper around the base parser, the world model takes user feedback (e.g., confirming or rejecting a specific column) and transitions the agent to a new state by constraining the parser's search space.
  3. Error Detector: This component decides when a question is necessary by introspecting the model's internal uncertainty. The authors evaluated both probability-based confidence thresholds and Bayesian uncertainty via dropout masks.
  4. Actuator: A rule-based Natural Language Generation (NLG) component that translates technical SQL elements into simple, binary (Yes/No) questions for the user.
The detailed workflow of the MISP system, illustrating the interaction loop between the user and the agent components.

Experimental Setup and Results

The framework was evaluated on two major text-to-SQL benchmarks: WikiSQL (simple, single-table queries) and Spider (complex, cross-domain queries with joins). The authors integrated MISP with three state-of-the-art base parsers: SQLNet, SQLova, and SyntaxSQLNet.

Performance Gains and Efficiency

MISP demonstrated significant improvements across all benchmarks. On WikiSQL, the execution accuracy of the SQLova parser increased from 85.3% to 94% with an average of only 0.77 questions per query. Furthermore, MISP proved more efficient than previous state-of-the-art systems; for example, it achieved higher accuracy than DialSQL while requiring 50% fewer questions (1.1 vs 2.4 on average for SQLNet).

Performance comparison of MISP-SQL against non-interactive and previous interactive baselines on the WikiSQL dataset.

Generalizability

The system successfully scaled to the complex Spider dataset, where it improved the accuracy of SyntaxSQLNet by 10% absolute, requiring approximately 3 questions per query to resolve complex structural ambiguities.

Key Insights and Discussion

A core finding of the study is that a model's internal uncertainty is a powerful signal for triggering human intervention. Interestingly, simple probability-based error detection often outperformed more complex Bayesian methods in identifying specific erroneous query components.

The modularity of MISP allows for easy upgrades to the base parser without redesigning the interaction logic. However, the authors noted that the system's effectiveness is still bounded by the base parser's quality; if a parser cannot find the correct path even with constraints, questions may be wasted on unsolvable predictions.

Conclusion

MISP provides a robust, unified framework for interactive semantic parsing that balances accuracy gains with user effort. Future work will explore the use of Reinforcement Learning to further optimize question-asking strategies and lifelong learning to allow parsers to continuously improve from every human interaction.

Summary updated

BibTeX
@inproceedings{yao2019model,
  author = {Ziyu Yao and Yu Su and Huan Sun and Wen-tau Yih},
  title = {{Model-based Interactive Semantic Parsing: A Unified Framework and A Text-to-SQL Case Study}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2019},
  url = {https://openreview.net/forum?id=HPy62j4lQx},
}
Figure