S ^2 SQL : Injecting Syntax to Question-Schema Interaction Graph Encoder for Text-to- SQL Parsers (2022)

Abstract: The task of converting a natural language question into an executable SQL query, known as text-to-SQL, is an important branch of semantic parsing. The state-of-the-art graph-based encoder has been successfully used in this task but does not model the question syntax well. In this paper, we propose S ^2 SQL, injecting Syntax to question-Schema graph encoder for Text-to-SQL parsers, which effectively leverages the syntactic dependency information of questions in text-to-SQL to improve the performance. We also employ the decoupling constraint to induce diverse relational edge embedding, which further improves the network’s performance. Experiments on the Spider and robustness setting Spider-Syn demonstrate that the proposed approach outperforms all existing methods when pre-training models are used, resulting in a performance ranks first on the Spider leaderboard.

## introduction relational databases are ubiquitous and store a great amount of structured information. the interaction with databases often requires expertise on writing structured code like sql, which is not friendly for users who are not proficient in query languages. text-to-sql aims to automatically translate natural language questions into executable sql statements @xcite @xcite @xcite @xcite . recently, a large-scale, multi-table, realistic textto-sql benchmark, spider @xcite , has been released. the most effective and popular encoder architecture on spider is the question-schema interaction graph @xcite . built on that, * work done during an internship at alibaba damo. ## related work extensive work has been conducted on improving the encoder and decoder @xcite @xcite @xcite @xcite as well as table-based pretraining @xcite @xcite @xcite . besides, wang et al. (2021a) proposed a metalearning based training objective to boost generalization. scholak et al. (2021) proposed picard, a method for constraining auto-regressive decoders of t5. among the encoder-related work, guo et al. (2019) introduced the schema linking module, which aimed to recognize the columns and the tables mentioned in a question. lin et al. (2020) leveraged the database content to augment the schema representation. bogin et al. (2019) employed gnn to derive the representation of the schema structure. then, chen et al. (2021) proposed shadowgnn to abstract the representation of question and schema with attention. besides, hui et al. (2021a) present a dynamic graph framework that can model contextual information for context-dependent setting. the most recent approaches @xcite achieved the best performance through relation-aware transformer. unlike these works, we investigated the impact of the syntactic structures during the encoding stage. ## conclusion we present syntax-enhanced question-schema graph encoder (s 2 sql) that can effectively model syntactic information for text-to-sql and introduce the decoupling constraint to induce the diverse relation embedding. the proposed model achieves new state-of-the-art performance on the widely used benchmark, spider and spider-syn.