Skip to main content
QUICK REVIEW

[Paper Review] Towards Robustness of Text-to-SQL Models against Synonym Substitution

Yujian Gan, Xinyun Chen|arXiv (Cornell University)|Jun 2, 2021
Topic ModelingComputer Science32 references14 citations
TL;DR

This paper introduces Spider-Syn, a human-curated text-to-SQL benchmark that evaluates model robustness under synonym substitution in natural language questions. It demonstrates that state-of-the-art models suffer significant accuracy drops when schema-related words are replaced with synonyms, and proposes two defense strategies—multi-annotation selection and adversarial training—showing that multi-annotation selection significantly improves robustness without additional training.

ABSTRACT

Recently, there has been significant progress in studying neural networks to translate text descriptions into SQL queries. Despite achieving good performance on some public benchmarks, existing text-to-SQL models typically rely on the lexical matching between words in natural language (NL) questions and tokens in table schemas, which may render the models vulnerable to attacks that break the schema linking mechanism. In this work, we investigate the robustness of text-to-SQL models to synonym substitution. In particular, we introduce Spider-Syn, a human-curated dataset based on the Spider benchmark for text-to-SQL translation. NL questions in Spider-Syn are modified from Spider, by replacing their schema-related words with manually selected synonyms that reflect real-world question paraphrases. We observe that the accuracy dramatically drops by eliminating such explicit correspondence between NL questions and table schemas, even if the synonyms are not adversarially selected to conduct worst-case adversarial attacks. Finally, we present two categories of approaches to improve the model robustness. The first category of approaches utilizes additional synonym annotations for table schemas by modifying the model input, while the second category is based on adversarial training. We demonstrate that both categories of approaches significantly outperform their counterparts without the defense, and the first category of approaches are more effective.

Motivation & Objective

  • To investigate the robustness of text-to-SQL models against synonym substitution in real-world paraphrased questions.
  • To identify the vulnerability of existing models that rely on exact lexical matching between NL questions and schema tokens.
  • To develop and evaluate defense mechanisms that improve robustness without requiring adversarial retraining.
  • To provide a reliable benchmark for synonym substitution that reflects natural language variation, not worst-case adversarial examples.

Proposed method

  • Construct Spider-Syn by manually replacing schema-related words in Spider dataset questions with semantically equivalent synonyms, preserving the original SQL query.
  • Introduce multi-annotation selection (MAS), which enriches model input with multiple synonym variants for table and column names.
  • Apply adversarial training by augmenting the training set with synonym-substituted NL questions from Spider-Syn.
  • Use both manual and automatic synonym annotation for MAS, with manual annotations showing superior performance.
  • Evaluate models on Spider-Syn and standard adversarial benchmarks to compare robustness improvements.
  • Implement both GNN-based and IRNet-based models to test the generalization of defense methods across architectures.

Experimental results

Research questions

  • RQ1How does synonym substitution affect the performance of state-of-the-art text-to-SQL models when the substitution reflects real-world paraphrasing rather than worst-case adversarial examples?
  • RQ2Can multi-annotation selection improve model robustness without requiring additional training?
  • RQ3How does adversarial training with synonym-substituted examples compare to multi-annotation selection in improving robustness?
  • RQ4Does the effectiveness of defense methods vary across different model architectures such as GNNs and IRNet?
  • RQ5To what extent does the quality of synonym annotations (manual vs. automatic) impact model robustness?

Key findings

  • State-of-the-art text-to-SQL models experience a significant performance drop on Spider-Syn, with accuracy dropping by up to 30% compared to the original Spider benchmark.
  • The IRNet model achieves 53.2% accuracy on Spider-Syn when trained only on original Spider data, indicating strong vulnerability to synonym substitution.
  • Multi-annotation selection (MAS) with manual synonyms improves IRNet’s accuracy on Spider-Syn to 49.7%, outperforming adversarial training with automatic synonyms (44.3% accuracy).
  • MAS with manual annotations achieves 39.3% accuracy on IRNet, significantly outperforming adversarial training with automatic synonyms (35.1%).
  • The combination of MAS and GNN-based models achieves 44.0% accuracy on Spider-Syn, demonstrating effectiveness across different architectures.
  • The proposed multi-annotation selection method is both more effective and computationally lighter than adversarial training, making it a practical defense strategy.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.