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

12/21/2020
by   Pingchuan Ma, et al.
2

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.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
02/21/2023

Conversational Text-to-SQL: An Odyssey into State-of-the-Art and Challenges Ahead

Conversational, multi-turn, text-to-SQL (CoSQL) tasks map natural langua...
research
08/22/2022

Recent Advances in Text-to-SQL: A Survey of What We Have and What We Expect

Text-to-SQL has attracted attention from both the natural language proce...
research
09/11/2021

Natural SQL: Making SQL Easier to Infer from Natural Language Specifications

Addressing the mismatch between natural language descriptions and the co...
research
10/20/2019

Byte-Pair Encoding for Text-to-SQL Generation

Neural sequence-to-sequence models provide a competitive approach to the...
research
06/02/2021

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

Recently, there has been significant progress in studying neural network...
research
05/14/2022

RASAT: Integrating Relational Structures into Pretrained Seq2Seq Model for Text-to-SQL

Relational structures such as schema linking and schema encoding have be...
research
04/26/2023

A Case-Based Reasoning Framework for Adaptive Prompting in Cross-Domain Text-to-SQL

Recent advancements in Large Language Models (LLMs), such as Codex, Chat...

Please sign up or login with your details

Forgot password? Click here to reset