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

NL-EDIT: Correcting Semantic Parse Errors through Natural Language Interaction

Ahmed Elgohary, Christopher Meek, Matthew Richardson, Adam Fourney, Gonzalo A. Ramos, Ahmed Hassan Awadallah

Abstract

Not available

Introduction

Semantic parsing—the task of converting natural language questions into machine-executable code like SQL—is a cornerstone of modern data interfaces. However, even state-of-the-art models frequently make mistakes. Most existing systems are "one-shot": if the model produces an incorrect query, the user is often left with no way to fix it other than rephrasing their entire question and hoping for the best.

While some interactive systems exist, they often rely on rigid feedback mechanisms, such as binary "yes/no" signals or forcing users to interact with complex logical forms. The challenge addressed here is creating a system that can interpret natural language feedback (e.g., "Actually, you should find the last name too") and use that context to precisely surgically repair an erroneous SQL query.

Overview of the NL-EDIT interaction loop, showing how natural language feedback leads to a corrected SQL query and explanation.

Methodology

The authors introduce NL-EDIT, which frames error correction as a sequence-to-sequence task where the output is a set of edits rather than a full query. The model is built on several key components:

  • Edit-Based Representation: The model breaks SQL queries down into clauses (SELECT, WHERE, etc.) and arguments. It then learns to generate a "linearized" sequence of operations, such as <select> add last_name </select> or <where> remove age </where>.
  • Context-Aware Encoder: The encoder uses BERT to process a concatenation of the user's feedback, the system's natural language explanation of the current (incorrect) query, the original question, and the database schema.
  • Relation-Aware Transformer: To better "ground" the feedback, the authors use a Relation-Aware Transformer. This allows the model to explicitly link tokens in the feedback to specific columns in the schema or specific steps in the system's explanation.
  • Synthetic Data Generation: Because human-in-the-loop data is expensive to collect, the authors developed a method to automatically synthesize 50,000 training examples. They take correct SQL queries, apply random "errors" (edits) to create an incorrect version, and then use templates to generate the corresponding feedback needed to reverse those errors.

Experimental Setup

The model was evaluated using several benchmarks:

  • SPLASH: The primary benchmark for natural language feedback in text-to-SQL, containing over 9,000 question-feedback pairs.
  • SPIDER: A large-scale text-to-SQL dataset used as the "seed" for the synthetic data generation process.
  • Cross-Parser Generalization Sets: The authors collected three new test sets based on errors from different high-performing parsers (EditSQL, TaBERT, and RAT-SQL) to test how well NL-EDIT generalizes to models it wasn't trained on.

Key Results

NL-EDIT demonstrates significant improvements in interactive semantic parsing:

  • State-of-the-Art Performance: NL-EDIT achieved 41.17% correction accuracy on the SPLASH test set, outperforming the previous best baseline (25.16%) by 16 points.
  • End-to-End Boost: When integrated with a standard parser, it improved the overall accuracy from 41.3% to 61.6%—a 20.3% absolute gain from just one round of feedback.
  • Zero-Shot Generalization: Remarkably, NL-EDIT generalized well to errors made by other parsers it had never seen during training, providing accuracy boosts ranging from 4.3% to 8.9% across different architectures.
  • Progress Metric: The authors introduced a "Progress" metric to show that even when the model didn't get the query 100% right, it still reduced the number of errors in 72.4% of cases, significantly improving the user experience.
Performance analysis of NL-EDIT, showing correction accuracy relative to feedback length, explanation length, and edit size.

Discussion and Limitations

While NL-EDIT represents a major step forward, several challenges remain:

  • Complexity Ceiling: The model's performance drops sharply when the initial query requires more than two edits to fix. Complex, multi-error queries remain a significant challenge.
  • Localization Issues: One of the main failure modes is "localization"—the model sometimes understands what to change but applies it to the wrong part of a complex query.
  • Long-Form Feedback: NL-EDIT struggles with very long feedback where the user essentially rewrites the whole query in natural language rather than suggesting specific edits.

Future work may explore curriculum learning and expanding the model to handle multi-turn interactions where a user might provide several rounds of feedback.

Summary updated

BibTeX
@inproceedings{elgohary2021nl,
  author = {Ahmed Elgohary and Christopher Meek and Matthew Richardson and Adam Fourney and Gonzalo A. Ramos and Ahmed Hassan Awadallah},
  title = {{NL-EDIT: Correcting Semantic Parse Errors through Natural Language Interaction}},
  booktitle = {Conference of the North American Chapter of the Association for Computational Linguistics},
  year = {2021},
  doi = {10.18653/v1/2021.naacl-main.444},
}
Figure