Closing the Cross-Dialect Gap: Query Plans as a Portable Interface in Text-to-SQL
Corentin Royer, Robin Oester, Yotam Perlitz, Yannick Metz, Andrea Giovannini, Mennatallah El-Assady
Abstract
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.
Create a lesson
Metadata
- Comments
- Accepted at Findings of the Association for Computational Linguistics: EMNLP 2026
Related papers
Semantic-aware Decoding for Diverse Text-to-SQL under Schema Ambiguity
Shared title terminologycs.CLYuxuan Jiang, Anna Mitsopoulou, Apostolos Koukouvinis et al.
TQTS-Bench: A Multi-Syntax Benchmark for Text-to-Query over Time-Series Databases
Shared title terminologycs.CLFei Lyu, Zhiyi Peng, Jiaming Liu et al.
Using LLMs to Detect LLM-Generated Texts: A Cross-Generation Analysis
Shared title terminologycs.CLHaiyue Yuan, Jie Guo, Weidong Qiu et al.
Fair Fact-Checking: Closing the Cross-Lingual Gap in LLM Factual Judgement with RoSh
Shared title terminologycs.CLMuhammad Ahmad, Fatemeh Seyedin, Adrian Weller et al.
Residual Cross-Model Narrative Convergence under Shared Prompts: Auditing Prompt Controls and Narrative Measurement
Shared title terminologycs.CLMehdy Sedaghat Payam
Fine-Tuning Without Gradients? Closed-Form, LLM-Written Classifiers on a Frozen Encoder
Shared title terminologycs.CLMd Nasir Uddin, Musa Tur Farazi, Soumik Bhattacharjee et al.