论文标题

MT-TEQL:通过变质测试评估和增强文本到SQL模型的一致性

MT-Teql: Evaluating and Augmenting Consistency of Text-to-SQL Models with Metamorphic Testing

论文作者

Ma, Pingchuan, Wang, Shuai

论文摘要

文本到SQL是从人类话语中生成SQL查询的任务。但是,由于自然语言的变化,在词汇层面上,两种语义上等效的话语可能会有所不同。同样,用户偏好(例如,正常形式的选择)在表达概念上相同的模式时会导致表结构的巨大变化。想象文本到SQL模型的一般难度以保持针对语言和模式变化的预测一致性,我们提出了MT-TEQL,MT-TEQL是一种基于变质测试的基于变质测试的框架,用于系统地评估和增强文本到SQL模型的一致性。受到软件变质测试原理的启发,MT-TEQL提供了模型 - 静态框架,该框架实现了一组全面的变质关系(MRS),以对语言和架构进行语义推广转换。当原始输入引起不同的SQL查询时,可以暴露模型不一致。此外,我们利用转化的输入来重新训练模型,以进一步稳健性提升。我们的实验表明,我们的框架暴露了SOTA模型中数千个预测错误,并通过数量级来丰富现有数据集,从而消除了40%以上的不一致错误而不会损害标准精度。

Text-to-SQL is a task to generate SQL queries from human utterances. However, due to the variation of natural language, two semantically equivalent utterances may appear differently in the lexical level. Likewise, user preferences (e.g., the choice of normal forms) can lead to dramatic changes in table structures when expressing conceptually identical schemas. Envisioning the general difficulty for text-to-SQL models to preserve prediction consistency against linguistic and schema variations, we propose MT-Teql, a Metamorphic Testing-based framework for systematically evaluating and augmenting the consistency of TExt-to-SQL models. Inspired by the principles of software metamorphic testing, MT-Teql delivers a model-agnostic framework which implements a comprehensive set of metamorphic relations (MRs) to conduct semantics-preserving transformations toward utterances and schemas. Model Inconsistency can be exposed when the original and transformed inputs induce different SQL queries. In addition, we leverage the transformed inputs to retrain models for further model robustness boost. Our experiments show that our framework exposes thousands of prediction errors from SOTA models and enriches existing datasets by order of magnitude, eliminating over 40% inconsistency errors without compromising standard accuracy.

扫码加入交流群

加入微信交流群

微信交流群二维码

扫码加入学术交流群,获取更多资源