Closing the Cross-Dialect Gap: Query Plans as a Portable Interface in Text-to-SQL
Not on the map. Why?
Abstract (arXiv)
Text-to-SQL systems are typically trained and evaluated on a single dialect (SQLite), yet production deployments span PostgreSQL, MySQL, ClickHouse, and beyond. We show that this single-dialect assumption leads to a substantial drop in cross-dialect accuracy for every model we tested. The drop persists across scale, architecture, and even purpose-built text-to-SQL systems. We argue that the fix is to change the generation target: instead of asking an LLM to emit dialect-specific SQL, we have it emit a dialect-agnostic relational algebra query plan, which a deterministic compiler then renders into SQL for any supported backend. Across thirteen models from 3B to frontier scale, this restores cross-dialect portability nearly uniformly, at a small cost in peak accuracy on the model's home dialect for capable prompted models and none once fine-tuned on plans; under matched fine-tuning, plan supervision yields a stronger model than SQL supervision. We also introduce MetricName, a question-aware result-set comparator needed to evaluate fairly across dialects, where existing metrics confound semantic errors with benign cross-dialect variation. More broadly, the result is a reminder that a generation target chosen for execution is not necessarily the one that maximizes generation quality.
Key facts. No citing papers in the map yet (data through 13 Oct 2026). Builds on 26 of its 34 references that are in the map. First posted on arXiv 27 Sep 2026.
Builds on
26 of 34 references.
References · 26
- 2023Judging LLM-as-a-Judge with MT-Bench and Chatbot Arenacited by 8,492
- 2018Spider: A Large-Scale Human-Labeled Dataset for Complex and Cross-Domain Semantic Parsing and Text-to-SQL Taskcited by 1,133
- 2023Can LLM Already Serve as A Database Interface? A BIg Bench for Large-Scale Database Grounded Text-to-SQLscited by 680
- 2024LLM Evaluators Recognize and Favor Their Own Generationscited by 664
- 2023DIN-SQL: Decomposed In-Context Learning of Text-to-SQL with Self-Correctioncited by 472
- 2019RAT-SQL: Relation-Aware Schema Encoding and Linking for Text-to-SQL Parserscited by 422
- 2021PICARD: Parsing Incrementally for Constrained Auto-Regressive Decoding from Language Modelscited by 408
- 2023Text-to-SQL Empowered by Large Language Models: A Benchmark Evaluationcited by 383
- 2024Spider 2.0: Evaluating Language Models on Real-World Enterprise Text-to-SQL Workflowscited by 229
- 2019Towards Complex Text-to-SQL in Cross-Domain Database with Intermediate Representationcited by 210
- 2023Grammar-Constrained Decoding for Structured NLP Tasks without Finetuningcited by 188
- 2024CodeS: Towards Building Open-source Language Models for Text-to-SQLcited by 186
14 more
- 2024CHESS: Contextual Harnessing for Efficient SQL Synthesiscited by 167
- 2016Language to Logical Form with Neural Attentioncited by 158
- 2020Semantic Evaluation for Text-to-SQL with Distilled Test Suitescited by 123
- 2017Abstract Syntax Networks for Code Generation and Semantic Parsingcited by 92
- 2025OmniSQL: Synthesizing High-quality Text-to-SQL Data at Scalecited by 91
- 2018TRANX: A Transition-based Neural Abstract Syntax Parser for Semantic Parsing and Code Generationcited by 88
- 2018Apache Calcite: A Foundational Framework for Optimized Query Processing Over Heterogeneous Data Sourcescited by 24
- 2024SQL-GEN: Bridging the Dialect Gap for Text-to-SQL Via Synthetic Data And Model Mergingcited by 16
- 2024FLEX: Expert-level False-Less EXecution Metric for Reliable Text-to-SQL Benchmarkcited by 11
- 2025ExeSQL: Self-Taught Text-to-SQL Models with Execution-Driven Bootstrapping for SQL Dialectscited by 11
- 2024MoMQ: Mixture-of-Experts Enhances Multi-Dialect Query Generation across Relational and Non-Relational Databasescited by 6
- 2023Semantic Parsing for Complex Data Retrieval: Targeting Query Plans vs. SQL for No-Code Access to Relational Databasescited by 1
- 2025QueryGym: Step-by-Step Interaction with Relational Databasescited by 1
- 2026PolySQL: Scaling Text-to-SQL Evaluation Across SQL Dialects via Automated Backend Isomorphismcited by 1
Built on by
Not cited yet.