Rethinking Schema Linking: A Context-Aware Bidirectional Retrieval Approach for Text-to-SQL
Paper · 2026 · Md Mahadi Hasan Nahid, Davood Rafiei, Weiwei Zhang et al.
Summary
Text-to-SQL systems built on LLMs often receive the entire database schema. This adds irrelevant tables and columns, raises token costs, and encourages hallucinated SQL. The authors treat schema linking as a separate retrieval task. Their goal is to come close to an oracle ("perfect") schema without fixing the SQL after it is generated. The method is fully prompt-based and has two stages:
- Question augmentation. An LLM breaks the question into subquestions and extracts keywords, keyphrases and filter conditions.
- Bidirectional linking. One path picks tables first and then their columns. The other picks columns first and then infers the tables. The two outputs are merged.
On the BIRD and Spider benchmarks, the retrieved schemas achieve high recall with fewer false positives. SQL generated from these schemas beats full-schema baselines and halves the gap between full-schema and perfect-schema accuracy. The method is also much cheaper than multi-call pipelines such as CHESS. The work shows that better retrieval alone, without refinement or self-consistency, can substantially improve Text-to-SQL.
Key points
- The framework combines a table-first path (table retrieval, then column selection) with a column-first path (column retrieval, then table selection). Both paths use the same augmented question.
- Using the retrieved schema closes about 50% of the execution-accuracy gap between full-schema and perfect-schema settings on BIRD and Spider. No fine-tuning or query refinement is needed.
- In ablations with Gemini, the full bidirectional method reached 92.91% schema recall. Removing the table-first step lowered recall to 91.13%. A simpler, single-path variant lowered the false positive rate (25.29% → 18.81%) but missed needed schema elements.
- Inference cost on BIRD is 6 LLM calls, about 10.5k tokens per sample and 2.6 s latency. CHESS, SCSL and HyTCSL need roughly 78 calls, about 340k tokens and about 46.8 s.
- Proposed future work: adaptive retrieval that runs only one path for simple questions.
Institutions
Fields, topics and concepts
📚 Shelves 5The field of science this work belongs to (OpenAlex fields).Computer Science · 16,667 worksArtificial Intelligence · 16,194 worksArts and Humanities · 16,039 worksLanguage and Linguistics · 15,891 worksComputer Networks and Communications · 64 works
🧭 Topics 3Research subjects and languages the work is about.Information retrieval & search · 473 worksSemantic parsing & meaning representation · 185 worksCode & programming languages · 129 works
Cite
Cite as Md Mahadi Hasan Nahid, Davood Rafiei, Weiwei Zhang and Yong Zhang. 2026. Rethinking Schema Linking: A Context-Aware Bidirectional Retrieval Approach for Text-to-SQL. Findings of the Association for Computational Linguistics: EACL 2026.
@inproceedings{nahid2026rethinking,
title = {{Rethinking Schema Linking: A Context-Aware Bidirectional Retrieval Approach for Text-to-SQL}},
author = {Md Mahadi Hasan Nahid, Davood Rafiei, Weiwei Zhang and Yong Zhang},
booktitle = {Findings of the Association for Computational Linguistics: EACL 2026},
year = {2026},
doi = {10.18653/v1/2026.findings-eacl.236},
url = {https://doi.org/10.18653/v1/2026.findings-eacl.236}
}References
- Nikhil Abhyankar, Vivek Gupta, Dan Roth, and Chandan K. Reddy. 2025. H-STAR: LLM-driven hybrid SQL-text adaptive reasoning on tables. In Proceedings of the 2025 Conference of the Nations of the Americas Chapter of the Association for Computational Linguistics: Human Language Technologies (Volume 1:… find
- Hasan Alp Caferoğlu and Özgür Ulusoy. 2025. E-sql: Direct schema linking via question enrichment in text-to-sql. Preprint, arXiv:2409.16751. — [arXiv:2409.16751](https://arxiv.org/abs/2409.16751) find
- Zhenbiao Cao, Yuanlei Zheng, Zhihao Fan, Xiaojin Zhang, and Wei Chen. 2024. Rsl-sql: Robust schema linking in text-to-sql generation. arXiv preprint arXiv:2411.00073. — [arXiv:2411.00073](https://arxiv.org/abs/2411.00073) find
- Yeounoh Chung, Gaurav T. Kakkar, Yu Gan, Brenton Milne, and Fatma Ozcan. 2025. Is long context all you need? leveraging llm’s extended context for nl2sql. Preprint, arXiv:2501.12372. — [arXiv:2501.12372](https://arxiv.org/abs/2501.12372) find
- Yaxun dai, Haiqin Yang, Mou Hao, and Pingfu Chao. 2025. READ-SQL: Reasoning path decomposer for text-to-SQL. find
- DeepSeek-AI, Aixin Liu, Bei Feng, Bing Xue, Bingxuan Wang, Bochao Wu, Chengda Lu, Chenggang Zhao, Chengqi Deng, Chenyu Zhang, Chong Ruan, Damai Dai, Daya Guo, Dejian Yang, Deli Chen, Dongjie Ji, Erhang Li, Fangyun Lin, Fucong Dai, and 181 others. 2025. Deepseek-v3 technical report. Preprint, arXiv:2… find
- Naihao Deng, Yulong Chen, and Yue Zhang. 2022. Recent advances in text-to-SQL: A survey of what we have and what we expect. In Proceedings of the 29th International Conference on Computational Linguistics, pages 2166–2187, Gyeongju, Republic of Korea. International Committee on Computational Linguis… find
- Xuemei Dong, Chao Zhang, Yuhang Ge, Yuren Mao, Yunjun Gao, lu Chen, Jinshu Lin, and Dongfang Lou. 2023. C3: Zero-shot text-to-sql with chatgpt. Preprint, arXiv:2307.07306. — [arXiv:2307.07306](https://arxiv.org/abs/2307.07306) find
- Yingqi Gao, Yifu Liu, Xiaoxia Li, Xiaorong Shi, Yin Zhu, Yiming Wang, Shiqi Li, Wei Li, Yuntao Hong, Zhiling Luo, and 1 others. 2024. Xiyan-sql: A multi-generator ensemble framework for text-to-sql. arXiv preprint arXiv:2411.08599. — [arXiv:2411.08599](https://arxiv.org/abs/2411.08599) find
- Michael Glass, Mustafa Eyceoz, Dharmashankar Subramanian, Gaetano Rossiello, Long Vu, and Alfio Gliozzo. 2025. Extractive schema linking for text-to-sql. arXiv preprint arXiv:2501.17174. — [arXiv:2501.17174](https://arxiv.org/abs/2501.17174) find
- Satya Krishna Gorti, Ilan Gofman, Zhaoyan Liu, Jiapeng Wu, Noël Vouitsis, Guangwei Yu, Jesse C. Cresswell, and Rasa Hosseinzadeh. 2025. MSc-SQL: Multi-sample critiquing small language models for text-to-SQL translation. In Proceedings of the 2025 Conference of the Nations of the Americas Chapter of… find
- Zijin Hong, Zheng Yuan, Qinggang Zhang, Hao Chen, Junnan Dong, Feiran Huang, and Xiao Huang. 2025. Next-generation database interfaces: A survey of llm-based text-to-sql. Preprint, arXiv:2406.08426. — [arXiv:2406.08426](https://arxiv.org/abs/2406.08426) find
- Yuliang Huang, Zhiwei Yu, Zhiqiang Zhang, and Zhi Jin. 2022. Semantic enhanced text-to-sql parsing via iteratively learning schema linking graph. In Proceedings of the 28th ACM SIGKDD Conference on Knowledge Discovery and Data Mining (KDD), pages 3786–3794. find
- Binyuan Hui, Jian Yang, Zeyu Cui, Jiaxi Yang, Dayiheng Liu, Lei Zhang, Tianyu Liu, Jiajun Zhang, Bowen Yu, Keming Lu, Kai Dang, Yang Fan, Yichang Zhang, An Yang, Rui Men, Fei Huang, Bo Zheng, Yibo Miao, Shanghaoran Quan, and 5 others. 2024. Qwen2.5-coder technical report. Preprint, arXiv:2409.12186.
- Mayank Kothyari, Dhruva Dhingra, Sunita Sarawagi, and Soumen Chakrabarti. 2023. CRUSH4SQL: Collective retrieval using schema hallucination for Text2SQL. In Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing, pages 14054–14066, Singapore. Association for Computatio… find
- Philippe Laban, Alexander Fabbri, Caiming Xiong, and Chien-Sheng Wu. 2024. Summary of a haystack: A challenge to long-context LLMs and RAG systems. In Proceedings of the 2024 Conference on Empirical Methods in Natural Language Processing, pages 9885–9903, Miami, Florida, USA. Association for Computa…
- Dongjun Lee, Choongwon Park, Jaehyuk Kim, and Heesoo Park. 2025. MCS-SQL: Leveraging multiple prompts and multiple-choice selection for text-to-SQL generation. In Proceedings of the 31st International Conference on Computational Linguistics, pages 337–353, Abu Dhabi, UAE. Association for Computation…
- Wenqiang Lei, Weixin Wang, Zhixin Ma, Tian Gan, Wei Lu, Min-Yen Kan, and Tat-Seng Chua. 2020. Re-examining the role of schema linking in text-to-SQL. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 6943–6954, Online. Association for Computatio… find
- Jinyang Li, Binyuan Hui, Ge Qu, Jiaxi Yang, Binhua Li, Bowen Li, Bailin Wang, Bowen Qin, Ruiying Geng, Nan Huo, Xuanhe Zhou, Ma Chenhao, Guoliang Li, Kevin Chang, Fei Huang, Reynold Cheng, and Yongbin Li. 2023. Can llm already serve as a database interface? a big bench for large-scale database groun…
- Jinyang Li, Binyuan Hui, Ge Qu, Jiaxi Yang, Binhua Li, Bowen Li, Bailin Wang, Bowen Qin, Ruiying Geng, Nan Huo, and 1 others. 2024. Can llm already serve as a database interface? a big bench for large-scale database grounded text-to-sqls. Advances in Neural Information Processing Systems, 36.
- Geling Liu, Yunzhi Tan, Ruichao Zhong, Yuanzhen Xie, Lingchen Zhao, Qian Wang, Bo Hu, and Zang Li. 2024a. Solid-sql: Enhanced schema-linking based in-context learning for robust text-to-sql. Preprint, arXiv:2412.12522. find
- Geling Liu, Yunzhi Tan, Ruichao Zhong, Yuanzhen Xie, Lingchen Zhao, Qian Wang, Bo Hu, and Zang Li. 2025. Solid-SQL: Enhanced schema-linking based in-context learning for robust text-to-SQL. In Proceedings of the 31st International Conference on Computational Linguistics, pages 9793–9803, Abu Dhabi,… find
- Nelson F. Liu, Kevin Lin, John Hewitt, Ashwin Paranjape, Michele Bevilacqua, Fabio Petroni, and Percy Liang. 2024b. Lost in the middle: How language models use long contexts. Transactions of the Association for Computational Linguistics, 12:157–173.
- Xinyu Liu, Shuyu Shen, Boyan Li, Peixian Ma, Runzhi Jiang, Yuxin Zhang, Ju Fan, Guoliang Li, Nan Tang, and Yuyu Luo. 2024c. A survey of nl2sql with large language models: Where are we, and where are we going? Preprint, arXiv:2408.05109. — [arXiv:2408.05109](https://arxiv.org/abs/2408.05109) find
- Karime Maamari, Fadhil Abubaker, Daniel Jaroslawicz, and Amine Mhedhbi. 2024. The death of schema linking? text-to-SQL in the age of well-reasoned language models. In NeurIPS 2024 Third Table Representation Learning Workshop. find
- Toby Mao. 2021. Sqlglot: Python sql parser and transpiler. https://github.com/tobymao/sqlglot. Accessed: 2025-05-09. ↗
- Md Mahadi Hasan Nahid and Davood Rafiei. 2024a. NormTab: Improving symbolic reasoning in LLMs through tabular data normalization. In Findings of the Association for Computational Linguistics: EMNLP 2024, pages 3569–3585, Miami, Florida, USA. Association for Computational Linguistics. find
- Md Mahadi Hasan Nahid and Davood Rafiei. 2024b. TabSQLify: Enhancing reasoning capabilities of LLMs through table decomposition. In Proceedings of the 2024 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies (Volume 1: Long Papers),… find
- Md Mahadi Hasan Nahid and Davood Rafiei. 2025. Prism: Agentic retrieval with llms for multi-hop question answering. arXiv preprint arXiv:2510.14278. — [arXiv:2510.14278](https://arxiv.org/abs/2510.14278) find
- OpenAI, :, Aaron Hurst, Adam Lerer, Adam P. Goucher, Adam Perelman, Aditya Ramesh, Aidan Clark, AJ Ostrow, Akila Welihinda, Alan Hayes, Alec Radford, Aleksander M adry, Alex Baker-Whitcomb, Alex Beutel, Alex Borzunov, Alex Carney, Alex Chow, Alex Kirillov, and 401 others. 2024. Gpt-4o system card.…
- Mohammadreza Pourreza, Hailong Li, Ruoxi Sun, Yeounoh Chung, Shayan Talaei, Gaurav Tarlok Kakkar, Yu Gan, Amin Saberi, Fatma Ozcan, and Sercan O. Arik. 2024. Chase-sql: Multi-path reasoning and preference optimized candidate selection in text-to-sql. Preprint, arXiv:2410.01943. — [arXiv:2410.01943](https://arxiv.org/abs/2410.01943) find
- Mohammadreza Pourreza and Davood Rafiei. 2024a. Din-sql: Decomposed in-context learning of text-to-sql with self-correction. Advances in Neural Information Processing Systems, 36.
- Mohammadreza Pourreza and Davood Rafiei. 2024b. DTS-SQL: Decomposed text-to-SQL with small large language models. In Findings of the Association for Computational Linguistics: EMNLP 2024, pages 8212–8220, Miami, Florida, USA. Association for Computational Linguistics. find
- Ge Qu, Jinyang Li, Bowen Li, Bowen Qin, Nan Huo, Chenhao Ma, and Reynold Cheng. 2024. Before generation, align it! a novel and effective strategy for mitigating hallucinations in text-to-SQL generation. In Findings of the Association for Computational Linguistics: ACL 2024, pages 5456–5471, Bangkok,… find
- Josefa Lia Stoisser, Marc Boubnovski Martell, and Julien Fauqueur. 2025. Sparks of tabular reasoning via text2sql reinforcement learning. arXiv preprint arXiv:2505.00016. find
- Shayan Talaei, Mohammadreza Pourreza, Yu-Chen Chang, Azalia Mirhoseini, and Amin Saberi. 2024. Chess: Contextual harnessing for efficient sql synthesis. Preprint, arXiv:2405.16755. multi-agent collaborative framework for text-to-sql. Preprint, arXiv:2312.11242. — [arXiv:2405.16755](https://arxiv.org/abs/2405.16755) find
- Yihan Wang and Peiyu Liu. 2025. Linkalign: Scalable schema linking for real-world large-scale multi-database text-to-sql. arXiv preprint arXiv:2503.18596. find
- Sun Yang, Qiong Su, Zhishuai Li, Ziyue Li, Hangyu Mao, Chenxi Liu, and Rui Zhao. 2024. Sql-to-schema enhances schema linking in text-to-sql. In Database and Expert Systems Applications, pages 139–145, Cham. Springer Nature Switzerland. find
- Tao Yu, Rui Zhang, Kai Yang, Michihiro Yasunaga, Dongxu Wang, Zifan Li, James Ma, Irene Li, Qingning Yao, Shanelle Roman, Zilin Zhang, and Dragomir Radev. 2018. Spider: A large-scale human-labeled dataset for complex and cross-domain semantic parsing and text-to-SQL task. In Proceedings of the 2018…
- Zheng Yuan, Hao Chen, Zijin Hong, Qinggang Zhang, Feiran Huang, and Xiao Huang. 2025. Knapsack optimization-based schema linking for llm-based text-to-sql generation. arXiv preprint arXiv:2502.12911. — [arXiv:2502.12911](https://arxiv.org/abs/2502.12911) find
- Bohan Zhai, Canwen Xu, Yuxiong He, and Zhewei Yao. 2025. Excot: Optimizing reasoning for text-to-sql with execution feedback. arXiv preprint arXiv:2503.19988. find
- Yunjia Zhang, Jordan Henkel, Avrilia Floratou, Joyce Cahoon, Shaleen Deep, and Jignesh M Patel. 2023. Reactable: enhancing react for table question answering. arXiv preprint arXiv:2310.00815. — [arXiv:2310.00815](https://arxiv.org/abs/2310.00815) find
- Xiaohu Zhu, Qian Li, Lizhen Cui, and Yongkang Liu. 2024. Large language model enhanced text-to-sql generation: A survey. arXiv preprint arXiv:2410.06011. — [arXiv:2410.06011](https://arxiv.org/abs/2410.06011) find
- Gemini Team, Rohan Anil, Sebastian Borgeaud, Jean-Baptiste Alayrac, Jiahui Yu, Radu Soricut, Johan Schalkwyk, Andrew M. Dai, Anja Hauth, Katie Millican, David Silver, Melvin Johnson, Ioannis Antonoglou, Julian Schrittwieser, Amelia Glaese, Jilin Chen, Emily Pitler, Timothy Lillicrap, Angeliki Lazari… — Gemini: A Family of Highly Capable Multimodal Models
- Bailin Wang, Richard Shin, Xiaodong Liu, Oleksandr Polozov, and Matthew Richardson. 2020. RAT-SQL: Relation-aware schema encoding and linking for text-to-SQL parsers. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 7567–7578, Online. Association for…
- Bing Wang, Changyu Ren, Jian Yang, Xinnian Liang, Jiaqi Bai, Linzheng Chai, Zhao Yan, Qian-Wen Zhang, Di Yin, Xing Sun, and Zhoujun Li. 2024. Mac-sql: A find
Updated
This page in Markdown → https://md.research.elamur.ai/free/en/papers/nahid-2026-rethinking-schema-linking-context-aware/