EvoSchema: Towards Text-to-SQL Robustness Against Schema Evolution
Organizations: The Ohio State University, Columbus, OH · Adobe Inc., Seattle, WA · Purdue University, West Lafayette, IN · Adobe Inc., Bangalore ·
Abstract
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.
Figures & tables
| Perturbation Data | Column-level | Table-level | Schema Evolution | Multiple DB | Seed Data | Features of Seed Data (Average) | ||||
|---|---|---|---|---|---|---|---|---|---|---|
| Affects SQL | Tab/DB | Col/DB | Col/Tab | PK/DB | FK/DB | |||||
| FootballDB ( Fürst et al., 2025 ) | - | reduce PK/FK references, reduce JOIN paths | ✓ | ✗ | FIFA World Cup ( Becklas, 2018 ) | 15 | 107 | 7.1 | - | 16 |
| Dr.Spider ( Chang et al., 2023 ) | Rename | ✗ | ✓ | ✓ | Spider ( Chang et al., 2023 ) | 5.1 | 22.1 | 5.4 | 3.7 | 3.2 |
| ADVETA ( Pi et al., 2022 ) | Add; Rename | ✗ | ✓ | ✓ | Spider ( Chang et al., 2023 ) | 5.1 | 22.1 | 5.4 | 3.7 | 3.2 |
| MT-TEQL ( Ma and Wang, 2021 ) | Add; Remove; Shuffle; Rename | Split; Merge; Shuffle | ✗ | ✓ | Spider ( Chang et al., 2023 ) | 5.1 | 22.1 | 5.4 | 3.7 | 3.2 |
| EvoSchema (Ours) | Add; Remove; Rename; Split; Merge | Split; Merge; Rename; Add; Remove | ✓ | ✓ | BIRD ( Li et al., 2024d ) | 7.3 | 72.5 | 10.6 | 6.5 | 9.3 |
| Data Statistics | |||||||||||
| Perturbation Type | Train | Eval | Eval* | Manipulated Items/Table | Manipulated Items/Query | ||||||
| Min | Mean | Median | Max | Min | Mean | Median | Max | ||||
| Original | 9426 | 1534 | 1068 | - | - | - | - | - | - | - | - |
| Column Manipulation | |||||||||||
| Add Columns | 9219 | 1506 | 846 | 1 | 5.7 | 3 | 83 | 1 | 5.9 | 4 | 43 |
| Remove Columns | 9426 | 1534 | 1076 | 1 | 6.2 | 2 | 87 | 1 | 6.9 | 3 | 70 |
| Perturbation Type | Code Llama | Mistral | Llama 3 | SQLCoder | GPT-3.5 | GPT-4 | ||||
|---|---|---|---|---|---|---|---|---|---|---|
| w/o | w/ | w/o | w/ | w/o | w/ | w/o | w/ | |||
| Table Match F1 | ||||||||||
| Original | 89.77 | 90.42 | 89.58 | 90.62 | 89.96 | 89.53 | 89.69 | 90.64 | 87.28 | 88.98 |
| Add Columns | 89.73 | 90.27 | 89.65 | 90.03 | 89.08 | 89.70 | 89.30 | 90.52 | 86.35 | 88.12 |
| Remove Columns | 89.82 | 90.24 | 89.89 | 90.66 | 90.09 | 89.82 | 89.81 | 90.54 | 87.18 | 88.87 |
| Rename Columns | 85.28 | 85.07 | 84.32 | 84.27 | 83.74 | 82.92 | 85.32 | 84.93 | 81.73 | 83.20 |
| Human Evaluation on EvoSchema | |||||
|---|---|---|---|---|---|
| Perturbation Type | GPT-4 | Code Llama | CHESS SS+CG | ||
| ZS | ICL | w/o | w/ | ||
| Original | 62 | 58 | 65 | 64 | 63 |
| Add Columns | 59 | 55 | 62 | 61 | 66 |
| Remove Columns | 65 | 61 | 66 | 63 | 64 |
| Rename Columns | 57 | 56 | 57 | 57 | 62 |
| Exec Acc on EvoSchema | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Perturbation Type | Code Llama | Mistral | Llama 3 | SQLCoder | GPT-3.5 | GPT-4 | ||||
| w/o | w/ | w/o | w/ | w/o | w/ | w/o | w/ | |||
| Original | 58 | 57 | 59 | 58 | 55 | 51 | 58 | 58 | 44 | 47 |
| Add Columns | 57 | 55 | 56 | 56 | 52 | 49 | 55 | 57 | 43 | 46 |
| Remove Columns | 59 | 57 | 60 | 58 | 56 | 53 | 60 | 58 | 45 | 47 |
| Rename Columns | 54 | 52 | 55 | 54 | 49 | 47 | 56 | 55 | 43 | 45 |
| Perturbation Type Ablation | ||||||
|---|---|---|---|---|---|---|
| Perturbation Type | Table Match F1 | Column Match F1 | ||||
| both | w/o table-p | w/o column-p | both | w/o table-p | w/o column-p | |
| Original | 90.73 | 90.80 (+0.07) | 90.04 (-0.69) | 81.09 | 82.15 (+1.06) | 80.49 (-0.60) |
| Add Columns | 90.86 | 90.80 (-0.06) | 89.75 (-1.11) | 79.63 | 80.81 (+1.18) | 77.29 (-2.34) |
| Remove Columns | 90.72 | 90.83 (+0.11) | 90.48 (-0.24) | 83.28 | 83.85 (+0.57) | 82.61 (-0.67) |
| Rename Columns | 85.35 | 85.38 (+0.03) | 84.57 (-0.78) | 76.49 | 77.53 (+1.04) | 75.17 (-1.32) |
| Out of Scope Effect | ||||||||||
| Perturbation Type | Table Match F1 | Column Match F1 | + OOS FP | + OOS TP | ||||||
| w/o | w/ | + OOS | w/o | w/ | + OOS | Tab | Col | Tab | Col | |
| Original | 89.77 | 90.42 | 82.98 (-7.44) | 80.66 | 81.64 | 75.43 (-6.21) | 7.11 | 0.65 | - | - |
| Add Columns | 89.73 | 90.27 | 86.07 (-4.20) | 78.26 | 80.27 | 77.00 (-3.27) | 4.25 | 0.40 | - | - |
| Remove Columns | 89.82 | 90.24 | 82.24 (-8.00) | 82.67 | 82.75 | 75.90 (-6.85) | 7.56 | 0.72 | - | - |
| Remove Col in SQL | - | - | - | - | - | - | 5.02 | - | - | 84.03 |
| Add Irrelevant Tables Effect | ||||||
|---|---|---|---|---|---|---|
| Perturbation Type | Table Match F1 | Column Match F1 | ||||
| w/o | w/o+ | w/ | w/o | w/o+ | w/ | |
| Original | 89.77 | 87.65 | 90.42 | 80.66 | 79.24 | 81.64 |
| Add Columns | 89.73 | 86.35 | 90.27 | 78.26 | 75.31 | 80.27 |
| Remove Columns | 89.82 | 87.30 | 90.24 | 82.67 | 80.74 | 82.75 |
| Rename Columns | 85.28 | 81.90 | 85.07 | 76.50 | 73.28 | 76.94 |
| Intra-database Effect | ||||
|---|---|---|---|---|
| Perturbation Type | Table Match F1 | Column Match F1 | ||
| w/o | w/ | w/o | w/ | |
| Original | 87.24 | 87.43 | 79.54 | 80.89 |
| Add Columns | 87.14 | 87.43 | 76.36 | 78.92 |
| Remove Columns | 87.29 | 87.27 | 81.14 | 81.29 |
| Rename Columns | 85.71 | 86.43 | 77.45 | 79.09 |
Text-to-SQL
Text-to-SQL translates natural-language questions into executable database queries, linking user intent to schemas, values, and SQL logic.
See all 173 papers