Lune

ACL Findings2024

Before Generation, Align it! A Novel and Effective Strategy for Mitigating Hallucinations in Text-to-SQL Generation

Ge Qu, Jinyang Li, Bowen Li, Bowen Qin, Nan Huo, Chenhao Ma, Reynold Cheng

Abstract

Large Language Models (LLMs) driven by In-Context Learning (ICL) have significantly improved the performance of text-to-SQL. Previous methods generally employ a two-stage reasoning framework, namely 1) schema linking and 2) logical synthesis, making the framework not only effective but also interpretable. Despite these advancements, the inherent bad nature of the generalization of LLMs often results in hallucinations, which limits the full potential of LLMs. In this work, we first identify and categorize the common types of hallucinations at each stage in text-to-SQL. We then introduce a novel strategy, Task Alignment (TA), designed to mitigate hallucinations at each stage. TA encourages LLMs to take advantage of experiences from similar tasks rather than starting the tasks from scratch. This can help LLMs reduce the burden of generalization, thereby mitigating hallucinations effectively. We further propose TA-SQL, a text-to-SQL framework based on this strategy. The experimental results and comprehensive analysis demonstrate the effectiveness and robustness of our framework. Specifically, it enhances the performance of the GPT-4 baseline by 21.23% relatively on BIRD dev and it yields significant improvements across six models and four mainstream, complex textto-SQL benchmarks. For reproducibility, we release our code and prompt at https:// github.com/quge2023/TA-SQL.

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.

24 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • SWE-SQL: Illuminating LLM Pathways to Solve User SQL Issues in Real-World Applications cites DIN-SQL: Decomposed In-Context Learning of Text-to-SQL with Self-Correction
  • SWE-SQL: Illuminating LLM Pathways to Solve User SQL Issues in Real-World Applications cites SHARE: An SLM-based Hierarchical Action CorREction Assistant for Text-to-SQL
  • SWE-SQL: Illuminating LLM Pathways to Solve User SQL Issues in Real-World Applications cites Text-to-SQL Empowered by Large Language Models: A Benchmark Evaluation
  • DIN-SQL: Decomposed In-Context Learning of Text-to-SQL with Self-Correction cites Decomposed Prompting: A Modular Approach for Solving Complex Tasks
  • SHARE: An SLM-based Hierarchical Action CorREction Assistant for Text-to-SQL cites DIN-SQL: Decomposed In-Context Learning of Text-to-SQL with Self-Correction
  • SHARE: An SLM-based Hierarchical Action CorREction Assistant for Text-to-SQL cites Text-to-SQL Empowered by Large Language Models: A Benchmark Evaluation
  • SHARE: An SLM-based Hierarchical Action CorREction Assistant for Text-to-SQL cites MAGIC: Generating Self-Correction Guideline for In-Context Text-to-SQL
  • Text-to-SQL Empowered by Large Language Models: A Benchmark Evaluation cites DIN-SQL: Decomposed In-Context Learning of Text-to-SQL with Self-Correction
  • Text-to-SQL Empowered by Large Language Models: A Benchmark Evaluation cites Training language models to follow instructions with human feedback
  • CogSQL: A Cognitive Framework for Enhancing Large Language Models in Text-to-SQL Translation cites DIN-SQL: Decomposed In-Context Learning of Text-to-SQL with Self-Correction
  • CogSQL: A Cognitive Framework for Enhancing Large Language Models in Text-to-SQL Translation cites Text-to-SQL Empowered by Large Language Models: A Benchmark Evaluation
  • MAGIC: Generating Self-Correction Guideline for In-Context Text-to-SQL cites DIN-SQL: Decomposed In-Context Learning of Text-to-SQL with Self-Correction
  • MAGIC: Generating Self-Correction Guideline for In-Context Text-to-SQL cites Text-to-SQL Empowered by Large Language Models: A Benchmark Evaluation
  • Decomposed Prompting: A Modular Approach for Solving Complex Tasks cites Training language models to follow instructions with human feedback
  • BIRD-INTERACT: Re-imagining Text-to-SQL Evaluation via Lens of Dynamic Interactions cites SWE-SQL: Illuminating LLM Pathways to Solve User SQL Issues in Real-World Applications
  • BIRD-INTERACT: Re-imagining Text-to-SQL Evaluation via Lens of Dynamic Interactions cites DIN-SQL: Decomposed In-Context Learning of Text-to-SQL with Self-Correction
  • BIRD-INTERACT: Re-imagining Text-to-SQL Evaluation via Lens of Dynamic Interactions cites SHARE: An SLM-based Hierarchical Action CorREction Assistant for Text-to-SQL
  • BIRD-INTERACT: Re-imagining Text-to-SQL Evaluation via Lens of Dynamic Interactions cites Text-to-SQL Empowered by Large Language Models: A Benchmark Evaluation
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers24

  1. MAGIC: Generating Self-Correction Guideline for In-Context Text-to-SQLArian Askari, Christian Pölitz, Xinye TangAAAI 2025 · 44 citations
  2. SWE-SQL: Illuminating LLM Pathways to Solve User SQL Issues in Real-World ApplicationsJinyang Li, Xiaolong Li, Ge Qu, Per Jacobsson et al.NeurIPS 2025 · 15 citations
  3. SHARE: An SLM-based Hierarchical Action CorREction Assistant for Text-to-SQLGe Qu, Jinyang Li, Bowen Qin, Xiaolong Li et al.ACL 2025 · 13 citations
  4. CogSQL: A Cognitive Framework for Enhancing Large Language Models in Text-to-SQL TranslationHongwei Yuan, Xiu Tang, Ke Chen, Lidan Shou et al.AAAI 2025 · 12 citations
  5. BIRD-INTERACT: Re-imagining Text-to-SQL Evaluation via Lens of Dynamic InteractionsNan Huo, Xiaohan Xu, Jinyang Li, Per Jacobsson et al.ICLR 2026 · 10 citations

Builds on22

  1. Training language models to follow instructions with human feedbackLong Ouyang, Jeffrey Wu, Xu Jiang, Diogo Almeida et al.NeurIPS 2022 · 24,707 citations
  2. DIN-SQL: Decomposed In-Context Learning of Text-to-SQL with Self-CorrectionMohammadreza Pourreza, Davood RafieiNeurIPS 2023 · 909 citations
  3. Text-to-SQL Empowered by Large Language Models: A Benchmark EvaluationDawei Gao, Haibin Wang, Yaliang Li, Xiuyu Sun et al.VLDB 2024 · 609 citations
  4. Retrieval Augmentation Reduces Hallucination in ConversationKurt Shuster, Spencer Poff, Moya Chen, Douwe Kiela et al.EMNLP Findings 2021 · 579 citations
  5. Decomposed Prompting: A Modular Approach for Solving Complex TasksTushar Khot, Harsh Trivedi, Matthew Finlayson, Yao Fu et al.ICLR 2023 · 94 citations

Related papers

  1. OpenSearch-SQL: Enhancing Text-to-SQL with Dynamic Few-shot and Consistency AlignmentXiangjin Xie, Guangwei Xu, Lingyan Zhao, Ruijie GuoSIGMOD 2025 · 28 citations
  2. ReSQL: Self-Improving Framework for Reasoning-Aware Text-to-SQL Dataset GenerationMinjun Park, Yongju Seong, Myoseop Sim, Kyungkoo Min et al.ACL Findings 2026
  3. OpenSQL: Data-Efficient Text-to-SQL for Open-Source LLMs via Synthesized Intermediate SupervisionRuilin Hu, Yuyu Luo, Guoliang Li, Shuangqiao Wu et al.VLDB 2026 · 4 citations
  4. ReEx-SQL: Reasoning with Execution-Aware Reinforcement Learning for Text-to-SQLYaxun Dai, Wenxuan Xie, Xialie Zhuang, Tianyu Yang et al.ACL 2026 · 8 citations
  5. ROUTE: Robust Multitask Tuning and Collaboration for Text-to-SQLYang Qin, Chao Chen, Zhihang Fu, Ze Chen et al.ICLR 2025
Dusk over the sea between two cliffs drawn in fine vertical lines