Lune

ACL2025Top-tier venue

DCG-SQL: Enhancing In-Context Learning for Text-to-SQL with Deep Contextual Schema Link Graph

Jihyung Lee, Jin-Seop Lee, Jaehoon Lee, YunSeok Choi, Jee-Hyong Lee

Abstract

Text-to-SQL, which translates a natural language question into an SQL query, has advanced with in-context learning of Large Language Models (LLMs). However, existing methods show little improvement in performance compared to randomly chosen demonstrations, and significant performance drops when smaller LLMs (e.g., Llama 3.1-8B) are used. This indicates that these methods heavily rely on the intrinsic capabilities of hyperscaled LLMs, rather than effectively retrieving useful demonstrations. In this paper, we propose a novel approach for effectively retrieving demonstrations and generating SQL queries. We construct a Deep Contextual Schema Link Graph, which contains key information and semantic relationship between a question and its database schema items. This graph-based structure enables effective representation of Textto-SQL samples and retrieval of useful demonstrations for in-context learning. Experimental results on the Spider benchmark demonstrate the effectiveness of our approach, showing consistent improvements in SQL generation performance and efficiency across both hyper-scaled LLMs and small LLMs. The code is available at https://github.com/jjklle/DCG-SQL . Methods Retrieval GPT-4 Llama 3.1-8B ACT-SQL ✓ 83.9 75.0 ✗ 83.2 75.6

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.

2 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

  • EcoTable: Cost-effective Table Integration in Data Lakes for Natural Language Queries cites DIN-SQL: Decomposed In-Context Learning of Text-to-SQL with Self-Correction
  • LEAF-SQL: Level-Wise Exploration with Adaptive Fine-Graining for Text-to-SQL Skeleton Prediction cites Text-to-SQL Empowered by Large Language Models: A Benchmark Evaluation
  • Automatic Chain of Thought Prompting in Large Language Models cites Language Models are Few-Shot Learners
  • DIN-SQL: Decomposed In-Context Learning of Text-to-SQL with Self-Correction cites Automatic Chain of Thought Prompting in Large Language Models
  • DIN-SQL: Decomposed In-Context Learning of Text-to-SQL with Self-Correction cites Language Models are Few-Shot Learners
  • 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 Bridging Textual and Tabular Data for Cross-Domain Text-to-SQL Semantic Parsing
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers2

  1. EcoTable: Cost-effective Table Integration in Data Lakes for Natural Language QueriesYuhui Wang, Jinqi Liu, Chengliang Chai, Hangyu Zhao et al.VLDB 2026
  2. LEAF-SQL: Level-Wise Exploration with Adaptive Fine-Graining for Text-to-SQL Skeleton PredictionZhao Tan, Xiping Liu, Qing Shu, Qizhi Wan et al.ICDE 2026

Builds on16

  1. Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah et al.NeurIPS 2020 · 64,255 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. Automatic Chain of Thought Prompting in Large Language ModelsZhuosheng Zhang, Aston Zhang, Mu Li, Alex SmolaICLR 2023 · 234 citations
  5. Bridging Textual and Tabular Data for Cross-Domain Text-to-SQL Semantic ParsingXi Victoria Lin, Richard Socher, Caiming XiongEMNLP Findings 2020 · 186 citations

Related papers

  1. Enhancing Text-to-SQL Capabilities of Large Language Models: A Study on Prompt Design StrategiesLinyong Nan, Yilun Zhao, Weijin Zou, Narutatsu Ri et al.EMNLP Findings 2023 · 49 citations
  2. ACT-SQL: In-Context Learning for Text-to-SQL with Automatically-Generated Chain-of-ThoughtHanchong Zhang, Ruisheng Cao, Lu Chen, Hongshen Xu et al.EMNLP Findings 2023 · 54 citations
  3. SchemaRAG: A Schema-aware Retrieval-Augmented Generation Framework for Text-to-SQLDi Wu, Zetong Tang, Yi He, Xin LuoSIGMOD 2026 · 9 citations
  4. Structure-Guided Large Language Models for Text-to-SQL GenerationQinggang Zhang, Hao Chen, Junnan Dong, Shengyuan Chen et al.ICML 2025
  5. Decomposition for Enhancing Attention: Improving LLM-based Text-to-SQL through Workflow ParadigmYuanzhen Xie, Xinzhou Jin, Tao Xie, Mingxiong Lin et al.ACL Findings 2024 · 34 citations
Dusk over the sea between two cliffs drawn in fine vertical lines