NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Speak to your Parser: Interactive Text-to-SQL with Natural Language Feedback

Ahmed Elgohary, Saghar Hosseini, Ahmed Hassan Awadallah

Introduction

Most current Text-to-SQL systems operate as "one-shot" tools: they either successfully translate a natural language query into SQL or they fail, leaving the user with no recourse. This paper introduces SPLASH, a novel dataset and framework designed for interactive semantic parsing. By allowing users to correct mispredicted SQL queries using natural language feedback—such as "No, I wanted the names, not the addresses"—the system can iteratively refine its output.

An example of interactive feedback where a user corrects a column selection error.

The Problem: Bridging the Communication Gap

Translating natural language into SQL is essential for making databases accessible to non-experts. However, even state-of-the-art neural parsers frequently make errors. In traditional systems, a user who does not know SQL cannot fix these mistakes. The authors observe that many parsing errors are relatively minor, often involving a single incorrect column or a missing filter. They propose a workflow where the system explains its interpretation, and the user provides free-form feedback to guide the model toward the correct query.

The SPLASH Dataset

To facilitate research in this area, the researchers developed SPLASH (Semantic Parsing with Language Assistance from Humans).

  • Foundation: Built upon the Spider dataset, a large-scale, cross-domain Text-to-SQL benchmark.
  • Scale: Contains 9,314 question-feedback pairs across 140 databases.
  • Diversity: Feedback covers various error types, including incorrect columns/tables (36%), missing filters (19%), and missing information (13%).
  • Human-in-the-loop: Crowd workers with no SQL knowledge used natural language explanations of system errors to write corrective feedback, achieving 95.5% accuracy in identifying logical errors.

Methodology

The task is formalized as SQL parse correction: given a question $q$, a database schema $s$, a mispredicted parse $p'$, and natural language feedback $f$, the model must generate the corrected gold parse $p$.

The researchers evaluated several approaches:

  1. SQL Explanation Framework: A template-based system translates complex SQL into step-by-step natural language instructions.
  2. Seq2Struct+Feedback: An encoder-decoder model that appends feedback to the original question.
  3. EditSQL+Feedback: A conversational model adapted to treat feedback as a second dialogue turn, using the incorrect parse as context.
  4. Handcrafted Re-ranker: A baseline that scores candidate parses from a beam search based on how well they align with entities in the user's feedback.

Key Insights: Errors are "Near Misses"

A critical finding of the research is that the majority of system errors are close to the correct answer. Analysis revealed that 78% of mispredicted queries have an edit distance of 3 or less from the target gold query. This quantitative evidence suggests that the correction task is highly feasible because the models are often "almost there."

Distribution of edit distances between predicted and gold SQL queries, showing most errors are minor.

Furthermore, the study demonstrated that human feedback is highly informative. Even a simple re-ranker using feedback outperformed a strong one-shot neural model, indicating that human instructions contain high-signal data that current models have yet to fully exploit.

Results and Performance Gap

The models were evaluated on Correction Accuracy (how often they fixed a wrong query) and End-to-End Accuracy (the total success rate including the initial one-shot attempt).

Model Correction Accuracy End-to-End Accuracy
One-shot (No Feedback) N/A 41.3%
Handcrafted Re-ranking 16.6% 49.5%
EditSQL + Feedback (Best) 25.2% 53.7%
Estimated Human Performance 81.5% 81.6%

While the best model (EditSQL+BERT) provided a significant 12.4% absolute boost to end-to-end accuracy, it still only fixed about a quarter of the errors it encountered. This highlights a massive 56% performance gap compared to human capability.

Conclusion and Future Work

The SPLASH framework proves that interactive feedback can significantly enhance Text-to-SQL systems. However, current models struggle to map specific linguistic feedback to structural SQL edits. Future research should focus on treating mispredicted parses as structured objects to be edited rather than simple text strings, and extending the framework to support multi-turn interactions for more complex troubleshooting.

Summary updated

BibTeX
@inproceedings{elgohary2020speak,
  author = {Ahmed Elgohary and Saghar Hosseini and Ahmed Hassan Awadallah},
  title = {{Speak to your Parser: Interactive Text-to-SQL with Natural Language Feedback}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2020},
  doi = {10.18653/v1/2020.acl-main.187},
}
Figure