[论文解读] Towards Robustness of Text-to-SQL Models against Synonym Substitution
本文提出了Spider-Syn,一个由人工构建的文本到SQL基准测试,用于评估模型在自然语言问题中同义词替换下的鲁棒性。实验表明,当模式相关词汇被同义词替换时,当前最先进模型的准确率显著下降。为此,本文提出了两种防御策略——多标注选择和对抗性训练,结果表明多标注选择在无需额外训练的情况下显著提升了模型鲁棒性。
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.
研究动机与目标
- 探究最先进的文本到SQL模型在真实世界改写问题中同义词替换下的鲁棒性。
- 识别现有模型在依赖自然语言问题与模式标记之间精确词汇匹配时的脆弱性。
- 开发并评估无需对抗性微调即可提升鲁棒性的防御机制。
- 提供一个可靠的同义词替换基准,反映自然语言变化,而非最坏情况的对抗样本。
提出的方法
- 通过人工将Spider数据集中问题中的模式相关词汇替换为语义等价的同义词,同时保留原始SQL查询,构建Spider-Syn。
- 提出多标注选择(MAS),通过为表名和列名引入多个同义词变体来丰富模型输入。
- 通过在训练集中加入Spider-Syn中同义词替换的自然语言问题,实施对抗性训练。
- 对MAS采用人工和自动同义词标注,结果显示人工标注性能更优。
- 在Spider-Syn和标准对抗性基准上评估模型,比较鲁棒性提升效果。
- 实现基于GNN和IRNet的模型,以检验防御方法在不同架构上的泛化能力。
实验结果
研究问题
- RQ1当同义词替换反映真实世界改写而非最坏情况对抗样本时,其对最先进文本到SQL模型性能的影响如何?
- RQ2多标注选择是否能在不增加训练的前提下提升模型鲁棒性?
- RQ3与多标注选择相比,使用同义词替换样本进行对抗性训练在提升鲁棒性方面表现如何?
- RQ4不同模型架构(如GNN和IRNet)下,防御方法的有效性是否存在差异?
- RQ5同义词标注质量(人工 vs. 自动)在多大程度上影响模型鲁棒性?
主要发现
- 最先进的文本到SQL模型在Spider-Syn上的性能显著下降,准确率相比原始Spider基准最高下降30%。
- 仅在原始Spider数据上训练的IRNet模型在Spider-Syn上的准确率为53.2%,表明其对同义词替换具有显著脆弱性。
- 使用人工同义词的多标注选择(MAS)将IRNet在Spider-Syn上的准确率提升至49.7%,优于使用自动同义词的对抗性训练(准确率44.3%)。
- 使用人工标注的MAS在IRNet上达到39.3%的准确率,显著优于使用自动同义词的对抗性训练(35.1%)。
- MAS与GNN模型结合在Spider-Syn上达到44.0%的准确率,表明该方法在不同架构中均具有效果。
- 所提出的多标注选择方法在有效性与计算效率上均优于对抗性训练,是一种实用的防御策略。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。