Abstract
Srinivasan Iyer, Ioannis Konstas, Alvin Cheung, Jayant Krishnamurthy, Luke Zettlemoyer. Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers).
2017.
Introduction
Developing natural language interfaces for databases (NLIDBs) has historically been a complex engineering challenge. Traditional semantic parsers often require experts to design intermediate logical representations, such as lambda calculus, or perform extensive feature engineering for every new domain. These intermediate languages create a bottleneck: they are difficult for non-experts to author, making training data collection expensive, and they may not capture the full expressive power of SQL.
This paper introduces a method to bypass these "middleman" languages by mapping natural language questions directly to SQL using neural sequence-to-sequence models. By employing a feedback loop where users and crowd workers correct system errors, the model can be deployed in new domains "from scratch" and improve its accuracy significantly through real-world interaction.
Methods
The proposed framework combines neural machine learning with a human-in-the-loop feedback cycle, as detailed in the LEARN procedure.
- Neural Seq2Seq Model: An encoder-decoder model with global attention translates natural language utterances directly into SQL queries.
- Entity Anonymization: To improve generalization, specific entities (e.g., "San Diego") are replaced with typed placeholders (e.g.,
CITY_NAME_1) during processing and restored before execution. - Data Augmentation: To bootstrap the model before user interaction, the authors use schema templates to generate initial question-SQL pairs and paraphrasing (via the Paraphrase Database) to create linguistic variations.
- The Feedback Loop: Once deployed, the system presents results to users who flag them as "Correct" or "Wrong." Incorrect queries are sent to crowd workers to provide the ground-truth SQL, which is then used to retrain the model.
Datasets
The approach was evaluated on three benchmarks:
- Geo880: 880 queries about US geography.
- ATIS: 5,418 utterances related to flight bookings.
- SCHOLAR: A new dataset introduced in this work, consisting of 816 utterances and SQL queries for an academic paper database, collected via a live user study.
Key Results
The system demonstrates competitive performance and rapid improvement through interaction. On the Geo880 benchmark, the model achieved 82.5% accuracy, while on ATIS, it reached 79.24%—comparable to state-of-the-art systems requiring significantly more manual engineering.
In a live deployment for the SCHOLAR domain, accuracy jumped from 25% (using only synthetic bootstrap data) to 63.5% after just three iterations of user feedback. Simulated experiments further showed that with perfect feedback, the model could achieve high-quality performance using only 55% of the available data, highlighting the efficiency of the interactive approach.
Insights and Limitations
A core insight is that targeting SQL directly allows researchers to tap into a large pool of skilled labor, as SQL proficiency is far more common than expertise in academic logical forms. Furthermore, the results show that a "good enough" bootstrapped model can evolve into a high-performing system through natural user interaction.
However, challenges remain. Approximately 15% of errors in the SCHOLAR dataset were due to failures in identifying or linking entities from text to the database. Additionally, users occasionally misidentify correct queries as wrong (6.1% error rate), often due to incomplete database results. While effective for many queries, the Seq2Seq architecture still struggles with highly complex nested subqueries or rare SQL keywords.
Summary updated