[Paper Review] Photon: A Robust Cross-Domain Text-to-SQL System
Photon is a robust, modular, cross-domain text-to-SQL system that combines a BERT-based neural semantic parser (63.2% structure accuracy on Spider dev), a human-in-the-loop question corrector that detects and suggests corrections for untranslatable inputs, and a SQL executor with natural language response generation. It improves robustness against ambiguous or untranslatable user questions through discriminative neural sequence editing and interactive correction, enabling practical deployment for non-expert users across diverse databases.
Natural language interfaces to databases (NLIDB) democratize end user access to relational data. Due to fundamental differences between natural language communication and programming, it is common for end users to issue questions that are ambiguous to the system or fall outside the semantic scope of its underlying query language. We present Photon, a robust, modular, cross-domain NLIDB that can flag natural language input to which a SQL mapping cannot be immediately determined. Photon consists of a strong neural semantic parser (63.2\% structure accuracy on the Spider dev benchmark), a human-in-the-loop question corrector, a SQL executor and a response generator. The question corrector is a discriminative neural sequence editor which detects confusion span(s) in the input question and suggests rephrasing until a translatable input is given by the user or a maximum number of iterations are conducted. Experiments on simulated data show that the proposed method effectively improves the robustness of text-to-SQL system against untranslatable user input. The live demo of our system is available at http://naturalsql.com.
Motivation & Objective
- To address the challenge of untranslatable or ambiguous natural language questions in text-to-SQL systems, which commonly fail when users deviate from canonical phrasings.
- To improve robustness in real-world deployment by detecting untranslatable inputs and enabling user correction through interactive feedback.
- To bridge the gap between neural text-to-SQL models and industrial applications by supporting cross-domain generalization and user-friendly interaction.
- To reduce unexpected errors during user interaction by flagging problematic inputs early and guiding users toward executable queries.
Proposed method
- Photon employs a BERT-based, database schema-aware encoder-decoder architecture for neural semantic parsing, with a pointer-generator decoder and static SQL correctness check.
- The question corrector is a discriminative neural sequence editor that identifies confusion spans in input questions and suggests rephrings to improve translatable potential.
- The system uses a human-in-the-loop mechanism where users refine questions iteratively until a valid SQL query can be generated.
- A template-based response generator converts SQL execution results into natural language for user comprehension.
- The system is designed as a modular pipeline: question correction → semantic parsing → SQL execution → response generation.
- It is evaluated on the Spider benchmark with a focus on handling untranslatable inputs through simulated data and live user interaction.
Experimental results
Research questions
- RQ1How can a text-to-SQL system detect and handle untranslatable or ambiguous natural language questions in real-world user interactions?
- RQ2Can a discriminative neural sequence editor effectively identify and correct confusion spans in user questions to improve downstream SQL generation?
- RQ3What impact does interactive correction have on the robustness and usability of cross-domain text-to-SQL systems?
- RQ4How does the integration of a human-in-the-loop correction mechanism improve system reliability compared to end-to-end neural models alone?
- RQ5To what extent can a neural semantic parser generalize across domains while maintaining high accuracy and robustness under noisy input?
Key findings
- Photon achieves 63.2% structure accuracy on the Spider dev set, demonstrating strong performance among state-of-the-art neural text-to-SQL models.
- The neural question corrector effectively detects untranslatable inputs and guides users toward rephrasing, reducing failure cases in real-world deployment.
- Simulated experiments show that the proposed correction mechanism significantly improves robustness against untranslatable user input.
- The system successfully handles diverse natural language expressions and maintains usability for non-expert users across unseen databases.
- The modular, interactive design enables practical deployment in industrial settings, with potential for extension to voice input, spell-checking, and visualization.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.