构建文本转SQL鲁棒性评估基准,应对数据库结构变化挑战
EvoSchema: Towards Text-to-SQL Robustness Against Schema Evolution
- 设计十类真实场景的数据库演化扰动,系统模拟结构变化
- 发现表级修改对模型性能影响远大于列级修改
- 训练数据加入演化设计可显著提升模型鲁棒性
神经文本转SQL模型在给定数据库模式时将自然语言问题转换为SQL查询,已取得显著进展。然而,数据库模式常因新需求而演进,导致基于静态模式训练的模型性能下降。现有工作多局限于重述语义或语法映射,缺乏全面可控的评估方式来研究模型在模式演化下的鲁棒性,难以应对现实世界中日益复杂丰富的数据库变更,尤其在大模型时代更为不足。为此,我们提出EvoSchema,一个综合性基准,用于评估和增强文本转SQL系统在真实模式演化下的鲁棒性。EvoSchema引入新型模式演化分类法,涵盖十类跨列级与表级修改的扰动类型,系统模拟数据库模式的动态性。通过EvoSchema,我们对开源与闭源大模型进行了深度评估,发现表级扰动对模型性能的影响显著高于列级变化。此外,EvoSchema推动了更鲁棒的文本转SQL系统发展,体现在模型训练与数据库设计两个层面。在多样化模式设计上训练的模型能更好区分相同问题在不同模式下的差异,避免学习虚假模式,平均表现优于在未扰动数据上训练的模型。该基准为理解模型行为提供了洞见,并为设计适应动态真实环境的系统指明路径。
原文摘要 · Abstract (English)
Neural text-to-SQL models, which translate natural language questions (NLQs) into SQL queries given a database schema, have achieved remarkable performance. However, database schemas frequently evolve to meet new requirements. Such schema evolution often leads to performance degradation for models trained on static schemas. Existing work either mainly focuses on simply paraphrasing some syntactic or semantic mappings among NLQ, DB and SQL, or lacks a comprehensive and controllable way to investigate the model robustness issue under the schema evolution, which is insufficient when facing the increasingly complex and rich database schema changes in reality, especially in the LLM era. To address the challenges posed by schema evolution, we present EvoSchema, a comprehensive benchmark designed to assess and enhance the robustness of text-to-SQL systems under real-world schema changes. EvoSchema introduces a novel schema evolution taxonomy, encompassing ten perturbation types across columnlevel and table-level modifications, systematically simulating the dynamic nature of database schemas. Through EvoSchema, we conduct an in-depth evaluation spanning different open source and closed-source LLMs, revealing that table-level perturbations have a significantly greater impact on model performance compared to column-level changes. Furthermore, EvoSchema inspires the development of more resilient text-to-SQL systems, in terms of both model training and database design. The models trained on EvoSchema's diverse schema designs can force the model to distinguish the schema difference for the same questions to avoid learning spurious patterns, which demonstrate remarkable robustness compared to those trained on unperturbed data on average. This benchmark offers valuable insights into model behavior and a path forward for designing systems capable of thriving in dynamic, real-world environments.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。