Lune

ICDE2026Top-tier venue

Knapsack Optimization-Based Schema Linking for LLM-Based Text-to-SQL Generation

Zheng Yuan, Hao Chen, Zijin Hong, Qinggang Zhang, Feiran Huang, Qing Li, Xiao Huang

Abstract

Generating SQLs from user queries is a longstanding challenge, where the accuracy of initial schema linking significantly impacts subsequent SQL generation performance. However, current schema linking models still struggle with missing relevant schema elements or an excess of redundant ones. A crucial reason for this is that commonly used metrics, recall and precision, fail to capture relevant element missing and thus cannot reflect actual schema linking performance. Motivated by this, we propose enhanced schema linking metrics by introducing a restricted missing indicator. Accordingly, we introduce Knapsack optimization-based Schema Linking Approach (KaSLA), a plug-in schema linking method designed to prevent the missing of relevant schema elements while minimizing the inclusion of redundant ones. KaSLA employs a hierarchical linking strategy that first identifies the optimal table linking and subsequently links columns within the selected table to reduce linking candidate space. In each linking process, it utilizes a knapsack optimization approach to link potentially relevant elements while accounting for a limited tolerance of potentially redundant ones. With this optimization, KaSLA-1.6B achieves superior schema linking results compared to large-scale LLMs, including DeepSeek-V3 with the state-of-theart (SOTA) schema linking method. Extensive experiments on Spider and BIRD benchmarks verify that KaSLA can significantly improve the SQL generation performance of SOTA Text2SQL models by substituting their schema linking processes. The code is available at https://github.com/DEEP-PolyU/KaSLA.

Index Terms-text-to-SQL, database, large language models, natural language understanding a significant 14.91% performance gap between state-of-theart schema linking methods and ground-truth linking results. Consequently, enhancing schema linking accuracy represents a critical research frontier with significant potential to advance text-to-SQL capabilities.

Recent state-of-the-art text-to-SQL models primarily focus on the final SQL generation stage, often relying on basic or even neglecting schema linking strategies. Existing schema

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.

10 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

  • ReEx-SQL: Reasoning with Execution-Aware Reinforcement Learning for Text-to-SQL cites DIN-SQL: Decomposed In-Context Learning of Text-to-SQL with Self-Correction
  • ReEx-SQL: Reasoning with Execution-Aware Reinforcement Learning for Text-to-SQL cites Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
  • ErrorLLM: Modeling SQL Errors for Text-to-SQL Refinement cites LoRA: Low-Rank Adaptation of Large Language Models
  • ErrorLLM: Modeling SQL Errors for Text-to-SQL Refinement cites DIN-SQL: Decomposed In-Context Learning of Text-to-SQL with Self-Correction
  • DIN-SQL: Decomposed In-Context Learning of Text-to-SQL with Self-Correction cites Finetuned Language Models are Zero-Shot Learners
  • DIN-SQL: Decomposed In-Context Learning of Text-to-SQL with Self-Correction cites Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
  • OpenSQL: Data-Efficient Text-to-SQL for Open-Source LLMs via Synthesized Intermediate Supervision cites DIN-SQL: Decomposed In-Context Learning of Text-to-SQL with Self-Correction
  • OpenSQL: Data-Efficient Text-to-SQL for Open-Source LLMs via Synthesized Intermediate Supervision cites Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
  • LinearRAG: Linear Graph Retrieval Augmented Generation on Large-scale Corpora cites FaithfulRAG: Fact-Level Conflict Modeling for Context-Faithful Retrieval-Augmented Generation
  • Finetuned Language Models are Zero-Shot Learners cites Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers10

  1. LinearRAG: Linear Graph Retrieval Augmented Generation on Large-scale CorporaLuyao Zhuang, Shengyuan Chen, Yilin Xiao, Huachi Zhou et al.ICLR 2026 · 54 citations
  2. FaithfulRAG: Fact-Level Conflict Modeling for Context-Faithful Retrieval-Augmented GenerationQinggang Zhang, Zhishang Xiang, Yilin Xiao, Le Wang et al.ACL 2025 · 18 citations
  3. 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
  4. 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
  5. ErrorLLM: Modeling SQL Errors for Text-to-SQL RefinementZijin Hong, Hao Chen, Zheng Yuan, Qinggang Zhang et al.KDD 2026 · 3 citations

Builds on23

  1. Chain-of-Thought Prompting Elicits Reasoning in Large Language ModelsJason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma et al.NeurIPS 2022 · 22,562 citations
  2. LoRA: Low-Rank Adaptation of Large Language ModelsEdward J. Hu, Yelong Shen, Phillip Wallis, Zeyuan Allen-Zhu et al.ICLR 2022 · 18,833 citations
  3. Finetuned Language Models are Zero-Shot LearnersJason Wei, Maarten Bosma, Vincent Y. Zhao, Kelvin Guu et al.ICLR 2022 · 4,966 citations
  4. SimCSE: Simple Contrastive Learning of Sentence EmbeddingsTianyu Gao, Xingcheng Yao, Danqi ChenEMNLP 2021 · 2,496 citations
  5. DIN-SQL: Decomposed In-Context Learning of Text-to-SQL with Self-CorrectionMohammadreza Pourreza, Davood RafieiNeurIPS 2023 · 909 citations

Related papers

  1. SchemaRAG: A Schema-aware Retrieval-Augmented Generation Framework for Text-to-SQLDi Wu, Zetong Tang, Yi He, Xin LuoSIGMOD 2026 · 9 citations
  2. Re-appraising the Schema Linking for Text-to-SQLYujian Gan, Xinyun Chen, Matthew PurverACL Findings 2023 · 4 citations
  3. Graph-Link: Bridging the Semantic-Structural Gap in Text-to-SQL via Constrained Subgraph InductionJianwei Zhong, Yuxi Yang, Quanxin Liu, Ruida Xu et al.ICML 2026
  4. A Comparative Evaluation of Schema Subsetting for LLM-based NL-to-SQL over Large-Schema DatabasesKyle Luoma, Arun KumarVLDB 2026
  5. JOLT-SQL: Joint Loss Tuning of Text-to-SQL with Confusion-aware Noisy Schema SamplingJinwang Song, Hongying Zan, Kunli Zhang, Lingling Mu et al.EMNLP 2025
Dusk over the sea between two cliffs drawn in fine vertical lines