arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2106.01065cs.CL
收藏

Text-to-SQL模型对同义词替换的鲁棒性

Towards Robustness of Text-to-SQL Models against Synonym Substitution

Queen Mary University of London(伦敦玛丽女王大学);UC Berkeley(加州大学伯克利分校);Jožef Stefan Institute(约瑟夫·斯特凡研究所);Nanning Central Sub-branch of the People’s Bank of China(中国人民银行南宁中心支行);Guangxi University of Finance and Economics(广西财经学院);Beijing MeiyiLab Co.,Ltd.(北京美仪实验室有限公司)

Yujian Gan, Xinyun Chen, Qiuping Huang, Matthew Purver, John R. Woodward, Jinxia Xie, Pengsheng Huang

摘要:

最近,在研究神经网络将文本描述翻译成SQL查询方面取得了重大进展。尽管在一些公共基准测试中取得了良好的性能,但现有的文本到SQL模型通常依赖于自然语言(NL)问题中的单词与表模式中的标记之间的词汇匹配,这可能使模型容易受到破坏模式链接机制的攻击。在这项工作中,我们调查的鲁棒性的文本到SQL模型的同义词替换。特别是,我们引入了Spider-Syn,这是一个基于Spider基准测试的人工数据集,用于文本到SQL的翻译。Spider-Syn中的NL问题是从Spider修改而来的,通过手动选择反映真实世界问题释义的同义词来替换它们的模式相关单词。我们观察到,通过消除NL问题和表模式之间的这种明确的对应关系,即使同义词没有被敌对地选择来进行最坏情况的对抗攻击,准确性也会急剧下降。最后,我们提出了两类方法来提高模型的鲁棒性。第一类方法通过修改模型输入为表模式使用额外的同义词注释,而第二类方法基于对抗训练。我们证明,这两类方法显着优于他们的同行没有防御,和第一类的方法更有效。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑