Lune

ACL2026Top-tier venue

QBridge: Bridging Natural Language and SQL via Gold Query Rewriting with Agentic Refinement

Zhensheng Luo, Sai Wu, Yuan Qiu, Chang Yao, Gang Chen, Xiu Tang

Abstract

Natural language to SQL (NL2SQL) provides an intuitive interface for querying structured data, yet real user questions are often noisy, ambiguous, and weakly grounded to database semantics. As a result, token-level schema linking and single-pass SQL decoding can be brittle: small misunderstandings in language or schema grounding may propagate into incorrect generation. We present QBridge, an agentic, feedback-driven NL2SQL framework based on a Refined Gold Query Paradigm, which bridges natural language and SQL via Gold Query-a structured, SQL-aligned intermediate representation. A core insight of QBridge is Distilled Back-Translation (DBT) for SL-independent rewriting. DBT converts SQL-grounded supervision into execution-verified Gold-Querystyle rewrites from a teacher model, and distills a lightweight, plug-and-play rewriter that generates schema-aware rewrites without requiring explicit schema linking at inference. QBridge then (i) verifies and conservatively refines the rewrite into a high-fidelity Refined Gold Query, and (ii) refines the generated SQL with dual feedback from execution validity and semantic consistency, enabling interpretable self-correction while remaining compatible with diverse SQL backbones. Extensive experiments on Spider, BIRD, and three robustness variants demonstrate that QBridge consistently improves zero-shot NL2SQL, outperforming strong prompting and agentic baselines while showing strong robustness and generalization. Code and data are available at https: //github.com/WannaBSteve/QBridge .

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

Questions to start from

Lune can draw on

the full paper · related work

Get the answer

Free to start. No credit card required.

Lineage

  • DIN-SQL: Decomposed In-Context Learning of Text-to-SQL with Self-Correction cites Natural SQL: Making SQL Easier to Infer from Natural Language Specifications
  • CodeS: Towards Building Open-source Language Models for Text-to-SQL cites DIN-SQL: Decomposed In-Context Learning of Text-to-SQL with Self-Correction
  • CodeS: Towards Building Open-source Language Models for Text-to-SQL cites TaBERT: Pretraining for Joint Understanding of Textual and Tabular Data
Builds onCited byLeft to right by year; the more cited, the higher.

Builds on11

  1. DIN-SQL: Decomposed In-Context Learning of Text-to-SQL with Self-CorrectionMohammadreza Pourreza, Davood RafieiNeurIPS 2023 · 909 citations
  2. Self-Consistency Improves Chain of Thought Reasoning in Language ModelsXuezhi Wang, Jason Wei, Dale Schuurmans, Quoc V. Le et al.ICLR 2023 · 681 citations
  3. TaBERT: Pretraining for Joint Understanding of Textual and Tabular DataPengcheng Yin, Graham Neubig, Wen-tau Yih, Sebastian RiedelACL 2020 · 417 citations
  4. CodeS: Towards Building Open-source Language Models for Text-to-SQLHaoyang Li, Jing Zhang, Hanbing Liu, Ju Fan et al.SIGMOD 2024 · 124 citations
  5. Natural SQL: Making SQL Easier to Infer from Natural Language SpecificationsYujian Gan, Xinyun Chen, Jinxia Xie, Matthew Purver et al.EMNLP Findings 2021 · 88 citations

Related papers

  1. GBV-SQL: Guided Generation and SQL2Text Back-Translation Validation for Multi-Agent Text2SQLDaojun Chen, Xi Wang, Shenyuan Ren, Qingzhi Ma et al.ACL 2026
  2. Sphinteract: Resolving Ambiguities in NL2SQL Through User InteractionFuheng Zhao, Shaleen Deep, Fotis Psallidas, Avrilia Floratou et al.VLDB 2025 · 12 citations
  3. SPARQLing Database Queries from Intermediate Question DecompositionsIrina Saparina, Anton OsokinEMNLP 2021 · 11 citations
  4. Grounding Natural Language to SQL Translation with Data-Based Self-ExplanationsYuankai Fan, Tonghui Ren, Can Huang, Zhenying He et al.ICDE 2025 · 7 citations
  5. APEX-SQL: Talking to the data via Agentic Exploration for Text-to-SQLBowen Cao, Weibin Liao, Yushi Sun, Dong Fang et al.KDD 2026 · 7 citations
Dusk over the sea between two cliffs drawn in fine vertical lines