{"status":"ok","message-type":"work","message-version":"1.0.0","message":{"indexed":{"date-parts":[[2026,5,19]],"date-time":"2026-05-19T07:13:11Z","timestamp":1779174791120,"version":"3.51.4"},"reference-count":45,"publisher":"Association for Computing Machinery (ACM)","issue":"8","content-domain":{"domain":["dl.acm.org"],"crossmark-restriction":true},"short-container-title":["Proc. VLDB Endow."],"published-print":{"date-parts":[[2025,4]]},"abstract":"<jats:p>Large Language Models (LLMs) have demonstrated impressive capabilities across a range of natural language processing tasks. In particular, improvements in reasoning abilities and the expansion of context windows have opened new avenues for leveraging these powerful models. NL2SQL is challenging in that the natural language question is inherently ambiguous, while the SQL generation requires a precise understanding of complex data schema and semantics. One approach to this semantic ambiguous problem is to provide more and sufficient contextual information.<\/jats:p>\n          <jats:p>\n            In this work, we explore the performance and the latency tradeoffs of the extended context window (a.k.a., long context) offered by Google's state-of-the-art LLM (\n            <jats:italic toggle=\"yes\">gemini-1.5-pro<\/jats:italic>\n            ). We study the impact of various contextual information, including column example values, question and SQL query pairs, user-provided hints, SQL documentation, and schema. To the best of our knowledge, this is the first work to study how the extended context window and extra contextual information can help NL2SQL generation with respect to both accuracy and latency cost. We show that long context LLMs are robust and do not get lost in the extended contextual information. Additionally, our long-context NL2SQL pipeline based on Google's\n            <jats:italic toggle=\"yes\">Gemini-pro-1.5<\/jats:italic>\n            achieves strong performance across multiple benchmark datasets without fine-tuning or expensive self-consistency based techniques.\n          <\/jats:p>","DOI":"10.14778\/3742728.3742761","type":"journal-article","created":{"date-parts":[[2025,9,3]],"date-time":"2025-09-03T13:32:53Z","timestamp":1756906373000},"page":"2735-2747","update-policy":"https:\/\/doi.org\/10.1145\/crossmark-policy","source":"Crossref","is-referenced-by-count":7,"title":["Is Long Context All You Need? Leveraging LLM's Extended Context for NL2SQL"],"prefix":"10.14778","volume":"18","author":[{"given":"Yeounoh","family":"Chung","sequence":"first","affiliation":[{"name":"Google"}],"role":[{"role":"author","vocabulary":"crossref"}]},{"given":"Gaurav T.","family":"Kakkar","sequence":"additional","affiliation":[{"name":"Google"}],"role":[{"role":"author","vocabulary":"crossref"}]},{"given":"Yu","family":"Gan","sequence":"additional","affiliation":[{"name":"Google"}],"role":[{"role":"author","vocabulary":"crossref"}]},{"given":"Brenton","family":"Milne","sequence":"additional","affiliation":[{"name":"Google"}],"role":[{"role":"author","vocabulary":"crossref"}]},{"given":"Fatma","family":"\u00d6zcan","sequence":"additional","affiliation":[{"name":"Google"}],"role":[{"role":"author","vocabulary":"crossref"}]}],"member":"320","published-online":{"date-parts":[[2025,9,3]]},"reference":[{"key":"e_1_2_1_1_1","volume-title":"https:\/\/www.sqlite.org\/index.html Accessed","year":"2024","unstructured":"2024. https:\/\/www.sqlite.org\/index.html Accessed: October 15, 2024."},{"key":"e_1_2_1_2_1","volume-title":"Many-shot In-Context Learning. In ICML 2024 Workshop on In-Context Learning. https:\/\/openreview.net\/forum?id=goi7DFHlqS","author":"Agarwal Rishabh","year":"2024","unstructured":"Rishabh Agarwal, Avi Singh, Lei M Zhang, Bernd Bohnet, Luis Rosias, Stephanie C.Y. Chan, Biao Zhang, Aleksandra Faust, and Hugo Larochelle. 2024. Many-shot In-Context Learning. In ICML 2024 Workshop on In-Context Learning. https:\/\/openreview.net\/forum?id=goi7DFHlqS"},{"key":"e_1_2_1_3_1","volume-title":"Increasing the LLM Accuracy for Question Answering: Ontologies to the Rescue! arXiv preprint arXiv:2405.11706","author":"Allemang Dean","year":"2024","unstructured":"Dean Allemang and Juan Sequeda. 2024. Increasing the LLM Accuracy for Question Answering: Ontologies to the Rescue! arXiv preprint arXiv:2405.11706 (2024)."},{"key":"e_1_2_1_4_1","volume-title":"Longbench: A bilingual, multitask benchmark for long context understanding. arXiv preprint arXiv:2308.14508","author":"Bai Yushi","year":"2023","unstructured":"Yushi Bai, Xin Lv, Jiajie Zhang, Hongchang Lyu, Jiankai Tang, Zhidian Huang, Zhengxiao Du, Xiao Liu, Aohan Zeng, Lei Hou, et al. 2023. Longbench: A bilingual, multitask benchmark for long context understanding. arXiv preprint arXiv:2308.14508 (2023)."},{"key":"e_1_2_1_5_1","volume-title":"E-SQL: Direct Schema Linking via Question Enrichment in Text-to-SQL. arXiv preprint arXiv:2409.16751","author":"Cafero\u011flu Hasan Alp","year":"2024","unstructured":"Hasan Alp Cafero\u011flu and \u00d6zg\u00fcr Ulusoy. 2024. E-SQL: Direct Schema Linking via Question Enrichment in Text-to-SQL. arXiv preprint arXiv:2409.16751 (2024)."},{"key":"e_1_2_1_6_1","volume-title":"BEAVER: An Enterprise Benchmark for Text-to-SQL. arXiv preprint arXiv:2409.02038","author":"Chen Peter Baile","year":"2024","unstructured":"Peter Baile Chen, Fabian Wenz, Yi Zhang, Moe Kayali, Nesime Tatbul, Michael Cafarella, \u00c7a\u011fatay Demiralp, and Michael Stonebraker. 2024. BEAVER: An Enterprise Benchmark for Text-to-SQL. arXiv preprint arXiv:2409.02038 (2024)."},{"key":"e_1_2_1_7_1","volume-title":"Stronger, Smaller NL2SQL. arXiv preprint arXiv:2401.02997","author":"Dom\u00ednguez Jos\u00e9 Manuel","year":"2024","unstructured":"Jos\u00e9 Manuel Dom\u00ednguez, Benjam\u00edn Err\u00e1zuriz, and Patricio Daher. 2024. Blar-SQL: Faster, Stronger, Smaller NL2SQL. arXiv preprint arXiv:2401.02997 (2024)."},{"key":"e_1_2_1_8_1","unstructured":"Xuemei Dong Chao Zhang Yuhang Ge Yuren Mao Yunjun Gao Jinshu Lin Dongfang Lou et al. 2023. C3: Zero-shot text-to-sql with chatgpt. arXiv preprint arXiv:2307.07306 (2023)."},{"key":"e_1_2_1_9_1","volume-title":"Conference on Innovative Data Systems Research. https:\/\/api.semanticscholar.org\/CorpusID:266729311","author":"Floratou Avrilia","year":"2024","unstructured":"Avrilia Floratou, Fotis Psallidas, Fuheng Zhao, Shaleen Deep, Gunther Hagleither, Wangda Tan, Joyce Cahoon, Rana Alotaibi, Jordan Henkel, Abhik Singla, Alex Van Grootel, Brandon Chow, Kai Deng, Katherine Lin, Marcos Campos, K. Venkatesh Emani, Vivek Pandit, Victor Shnayder, Wenjing Wang, and Carlo Curino. 2024. NL2SQL is a solved problem... Not!. In Conference on Innovative Data Systems Research. https:\/\/api.semanticscholar.org\/CorpusID:266729311"},{"key":"e_1_2_1_10_1","volume-title":"Text-to-SQL Empowered by Large Language Models: A Benchmark Evaluation. CoRR abs\/2308.15363","author":"Gao Dawei","year":"2023","unstructured":"Dawei Gao, Haibin Wang, Yaliang Li, Xiuyu Sun, Yichen Qian, Bolin Ding, and Jingren Zhou. 2023. Text-to-SQL Empowered by Large Language Models: A Benchmark Evaluation. CoRR abs\/2308.15363 (2023)."},{"key":"e_1_2_1_11_1","volume-title":"XiYan-SQL: A Multi-Generator Ensemble Framework for Text-to-SQL. arXiv preprint arXiv:2411.08599","author":"Gao Yingqi","year":"2024","unstructured":"Yingqi Gao, Yifu Liu, Xiaoxia Li, Xiaorong Shi, Yin Zhu, Yiming Wang, Shiqi Li, Wei Li, Yuntao Hong, Zhiling Luo, Jinyang Gao, Liyu Mou, and Yu Li. 2024. XiYan-SQL: A Multi-Generator Ensemble Framework for Text-to-SQL. arXiv preprint arXiv:2411.08599 (2024). https:\/\/arxiv.org\/abs\/2411.08599"},{"key":"e_1_2_1_12_1","volume-title":"Gemini API Pricing. https:\/\/ai.google.dev\/pricing#1_5pro Accessed","author":"Cloud Google","year":"2025","unstructured":"Google Cloud. 2024. Gemini API Pricing. https:\/\/ai.google.dev\/pricing#1_5pro Accessed: January 7, 2025."},{"key":"e_1_2_1_13_1","volume-title":"Gemini in BigQuery. https:\/\/cloud.google.com\/bigquery\/docs\/write-sql-gemini Accessed","author":"Cloud Google","year":"2024","unstructured":"Google Cloud. 2024. Gemini in BigQuery. https:\/\/cloud.google.com\/bigquery\/docs\/write-sql-gemini Accessed: October 15, 2024."},{"key":"e_1_2_1_14_1","doi-asserted-by":"publisher","DOI":"10.1007\/S00778-022-00776-8"},{"key":"e_1_2_1_15_1","doi-asserted-by":"publisher","DOI":"10.14778\/3611540.3611575"},{"key":"e_1_2_1_16_1","volume-title":"Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing (Volume 1: Long Papers)","author":"Lee Chia-Hsuan","year":"2021","unstructured":"Chia-Hsuan Lee, Oleksandr Polozov, and Matthew Richardson. 2021. KaggleDBQA: Realistic Evaluation of Text-to-SQL Parsers. In Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing (Volume 1: Long Papers). Association for Computational Linguistics, Online, 2261\u20132273. https:\/\/aclanthology.org\/2021.acl-long.176"},{"key":"e_1_2_1_17_1","volume-title":"Mcssql: Leveraging multiple prompts and multiple-choice selection for text-to-sql generation. arXiv preprint arXiv:2405.07467","author":"Lee Dongjun","year":"2024","unstructured":"Dongjun Lee, Choongwon Park, Jaehyuk Kim, and Heesoo Park. 2024. Mcssql: Leveraging multiple prompts and multiple-choice selection for text-to-sql generation. arXiv preprint arXiv:2405.07467 (2024)."},{"key":"e_1_2_1_18_1","volume-title":"Michael Boratko, Yi Luan, S\u00e9bastien MR Arnold, Vincent Perot, Siddharth Dalmia, et al.","author":"Lee Jinhyuk","year":"2024","unstructured":"Jinhyuk Lee, Anthony Chen, Zhuyun Dai, Dheeru Dua, Devendra Singh Sachan, Michael Boratko, Yi Luan, S\u00e9bastien MR Arnold, Vincent Perot, Siddharth Dalmia, et al. 2024. Can Long-Context Language Models Subsume Retrieval, RAG, SQL, and More? arXiv preprint arXiv:2406.13121 (2024)."},{"key":"e_1_2_1_19_1","volume-title":"Gecko: Versatile text embeddings distilled from large language models. arXiv preprint arXiv:2403.20327","author":"Lee Jinhyuk","year":"2024","unstructured":"Jinhyuk Lee, Zhuyun Dai, Xiaoqi Ren, Blair Chen, Daniel Cer, Jeremy R Cole, Kai Hui, Michael Boratko, Rajvi Kapadia, Wen Ding, et al. 2024. Gecko: Versatile text embeddings distilled from large language models. arXiv preprint arXiv:2403.20327 (2024)."},{"key":"e_1_2_1_20_1","volume-title":"The Dawn of Natural Language to SQL: Are We Fully Ready? arXiv preprint arXiv:2406.01265","author":"Li Boyan","year":"2024","unstructured":"Boyan Li, Yuyu Luo, Chengliang Chai, Guoliang Li, and Nan Tang. 2024. The Dawn of Natural Language to SQL: Are We Fully Ready? arXiv preprint arXiv:2406.01265 (2024)."},{"key":"e_1_2_1_21_1","doi-asserted-by":"publisher","DOI":"10.1609\/aaai.v37i11.26535"},{"key":"e_1_2_1_22_1","unstructured":"Jinyang Li Binyuan Hui Ge Qu Jiaxi Yang Binhua Li Bowen Li Bailin Wang Bowen Qin Ruiying Geng Nan Huo et al. 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 (2024)."},{"key":"e_1_2_1_23_1","volume-title":"Xiang Yue, and Wenhu Chen.","author":"Li Tianle","year":"2024","unstructured":"Tianle Li, Ge Zhang, Quy Duc Do, Xiang Yue, and Wenhu Chen. 2024. Long-context llms struggle with long in-context learning. arXiv preprint arXiv:2404.02060 (2024)."},{"key":"e_1_2_1_24_1","doi-asserted-by":"publisher","DOI":"10.1162\/tacl_a_00638"},{"key":"e_1_2_1_25_1","volume-title":"A Survey of NL2SQL with Large Language Models: Where are we, and where are we going? arXiv preprint arXiv:2408.05109","author":"Liu Xinyu","year":"2024","unstructured":"Xinyu Liu, Shuyu Shen, Boyan Li, Peixian Ma, Runzhi Jiang, Yuxin Zhang, Ju Fan, Guoliang Li, Nan Tang, and Yuyu Luo. 2024. A Survey of NL2SQL with Large Language Models: Where are we, and where are we going? arXiv preprint arXiv:2408.05109 (2024)."},{"key":"e_1_2_1_26_1","volume-title":"Divide and prompt: Chain of thought prompting for text-to-sql. arXiv preprint arXiv:2304.11556","author":"Liu Xiping","year":"2023","unstructured":"Xiping Liu and Zhao Tan. 2023. Divide and prompt: Chain of thought prompting for text-to-sql. arXiv preprint arXiv:2304.11556 (2023)."},{"key":"e_1_2_1_27_1","volume-title":"The Death of Schema Linking? Text-to-SQL in the Age of Well-Reasoned Language Models. arXiv preprint arXiv:2408.07702","author":"Maamari Karime","year":"2024","unstructured":"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. arXiv preprint arXiv:2408.07702 (2024)."},{"key":"e_1_2_1_28_1","volume-title":"Enhancing few-shot text-to-sql capabilities of large language models: A study on prompt design strategies. arXiv preprint arXiv:2305.12586","author":"Nan Linyong","year":"2023","unstructured":"Linyong Nan, Yilun Zhao, Weijin Zou, Narutatsu Ri, Jaesung Tae, Ellen Zhang, Arman Cohan, and Dragomir Radev. 2023. Enhancing few-shot text-to-sql capabilities of large language models: A study on prompt design strategies. arXiv preprint arXiv:2305.12586 (2023)."},{"key":"e_1_2_1_29_1","volume-title":"CHASE-SQL: Multi-Path Reasoning and Preference Optimized Candidate Selection in Text-to-SQL. In The Thirteenth International Conference on Learning Representations, ICLR 2025","author":"Pourreza Mohammadreza","year":"2025","unstructured":"Mohammadreza Pourreza, Hailong Li, Ruoxi Sun, Yeounoh Chung, Shayan Talaei, Gaurav Tarlok Kakkar, Yu Gan, Amin Saberi, Fatma Ozcan, and Sercan \u00d6. Arik. 2025. CHASE-SQL: Multi-Path Reasoning and Preference Optimized Candidate Selection in Text-to-SQL. In The Thirteenth International Conference on Learning Representations, ICLR 2025, Singapore, April 24\u201328, 2025. OpenReview.net. https:\/\/openreview.net\/forum?id=CvGqMD5OtX"},{"key":"e_1_2_1_30_1","volume-title":"Din-sql: Decomposed in-context learning of text-to-sql with self-correction. Advances in Neural Information Processing Systems 36","author":"Pourreza Mohammadreza","year":"2024","unstructured":"Mohammadreza Pourreza and Davood Rafiei. 2024. Din-sql: Decomposed in-context learning of text-to-sql with self-correction. Advances in Neural Information Processing Systems 36 (2024)."},{"key":"e_1_2_1_31_1","unstructured":"Machel Reid Nikolay Savinov Denis Teplyashin Dmitry Lepikhin Timothy Lillicrap Jean-baptiste Alayrac Radu Soricut Angeliki Lazaridou Orhan Firat Julian Schrittwieser et al. 2024. Gemini 1.5: Unlocking multimodal understanding across millions of tokens of context. arXiv preprint arXiv:2403.05530 (2024)."},{"key":"e_1_2_1_32_1","doi-asserted-by":"publisher","DOI":"10.1145\/3661304.3661901"},{"key":"e_1_2_1_33_1","volume-title":"Exploring chain-of-thought style prompting for text-to-sql. arXiv preprint arXiv:2305.14215","author":"Tai Chang-You","year":"2023","unstructured":"Chang-You Tai, Ziru Chen, Tianshu Zhang, Xiang Deng, and Huan Sun. 2023. Exploring chain-of-thought style prompting for text-to-sql. arXiv preprint arXiv:2305.14215 (2023)."},{"key":"e_1_2_1_34_1","doi-asserted-by":"publisher","DOI":"10.48550\/ARXIV.2405.16755"},{"key":"e_1_2_1_35_1","unstructured":"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 Multi-Agent Collaborative Framework for Text-to-SQL. arXiv:cs.CL\/2312.11242"},{"key":"e_1_2_1_36_1","doi-asserted-by":"publisher","DOI":"10.18653\/v1\/2020.acl-main.677"},{"key":"e_1_2_1_37_1","volume-title":"Aakanksha Chowdhery, and Denny Zhou.","author":"Wang Xuezhi","year":"2022","unstructured":"Xuezhi Wang, Jason Wei, Dale Schuurmans, Quoc Le, Ed Chi, Sharan Narang, Aakanksha Chowdhery, and Denny Zhou. 2022. Self-consistency improves chain of thought reasoning in language models. arXiv preprint arXiv:2203.11171 (2022)."},{"key":"e_1_2_1_38_1","volume-title":"Denny Zhou, et al.","author":"Wei Jason","year":"2022","unstructured":"Jason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma, Fei Xia, Ed Chi, Quoc V Le, Denny Zhou, et al. 2022. Chain-of-thought prompting elicits reasoning in large language models. Advances in neural information processing systems 35 (2022), 24824\u201324837."},{"key":"e_1_2_1_39_1","volume-title":"TaBERT: Pretraining for joint understanding of textual and tabular data. arXiv preprint arXiv:2005.08314","author":"Yin Pengcheng","year":"2020","unstructured":"Pengcheng Yin, Graham Neubig, Wen-tau Yih, and Sebastian Riedel. 2020. TaBERT: Pretraining for joint understanding of textual and tabular data. arXiv preprint arXiv:2005.08314 (2020)."},{"key":"e_1_2_1_40_1","doi-asserted-by":"publisher","DOI":"10.18653\/v1\/D18-1425"},{"key":"e_1_2_1_41_1","volume-title":"Large language models meet nl2code: A survey. arXiv preprint arXiv:2212.09420","author":"Zan Daoguang","year":"2022","unstructured":"Daoguang Zan, Bei Chen, Fengji Zhang, Dianjie Lu, Bingchao Wu, Bei Guan, Yongji Wang, and Jian-Guang Lou. 2022. Large language models meet nl2code: A survey. arXiv preprint arXiv:2212.09420 (2022)."},{"key":"e_1_2_1_42_1","volume-title":"Proceedings of the 37th International Conference on Neural Information Processing Systems (NIPS '23)","author":"Zheng Lianmin","year":"2024","unstructured":"Lianmin Zheng, Wei-Lin Chiang, Ying Sheng, Siyuan Zhuang, Zhanghao Wu, Yonghao Zhuang, Zi Lin, Zhuohan Li, Dacheng Li, Eric P. Xing, Hao Zhang, Joseph E. Gonzalez, and Ion Stoica. 2024. Judging LLM-as-a-judge with MT-bench and Chatbot Arena. In Proceedings of the 37th International Conference on Neural Information Processing Systems (NIPS '23). Curran Associates Inc., Red Hook, NY, USA, Article 2020, 29 pages."},{"key":"e_1_2_1_43_1","volume-title":"Seq2sql: Generating structured queries from natural language using reinforcement learning. arXiv preprint arXiv:1709.00103","author":"Zhong Victor","year":"2017","unstructured":"Victor Zhong, Caiming Xiong, and Richard Socher. 2017. Seq2sql: Generating structured queries from natural language using reinforcement learning. arXiv preprint arXiv:1709.00103 (2017)."},{"key":"e_1_2_1_44_1","unstructured":"Denny Zhou Nathanael Sch\u00e4rli Le Hou Jason Wei Nathan Scales Xuezhi Wang Dale Schuurmans Claire Cui Olivier Bousquet Quoc Le et al. 2022. Least-to-most prompting enables complex reasoning in large language models. arXiv preprint arXiv:2205.10625 (2022)."},{"key":"e_1_2_1_45_1","unstructured":"Fan Zhou Siqiao Xue Danrui Qi Wenhui Shi Wang Zhao Ganglin Wei Hongyang Zhang Caigai Jiang Gangwei Jiang Zhixuan Chu and Faqiang Chen. 2024. DB-GPT-Hub: Towards Open Benchmarking Text-to-SQL Empowered by Large Language Models. arXiv:2406.11434"}],"container-title":["Proceedings of the VLDB Endowment"],"original-title":[],"language":"en","link":[{"URL":"https:\/\/dl.acm.org\/doi\/pdf\/10.14778\/3742728.3742761","content-type":"unspecified","content-version":"vor","intended-application":"similarity-checking"}],"deposited":{"date-parts":[[2025,9,3]],"date-time":"2025-09-03T13:34:28Z","timestamp":1756906468000},"score":1,"resource":{"primary":{"URL":"https:\/\/dl.acm.org\/doi\/10.14778\/3742728.3742761"}},"subtitle":[],"short-title":[],"issued":{"date-parts":[[2025,4]]},"references-count":45,"journal-issue":{"issue":"8","published-print":{"date-parts":[[2025,4]]}},"alternative-id":["10.14778\/3742728.3742761"],"URL":"https:\/\/doi.org\/10.14778\/3742728.3742761","relation":{},"ISSN":["2150-8097"],"issn-type":[{"value":"2150-8097","type":"print"}],"subject":[],"published":{"date-parts":[[2025,4]]},"assertion":[{"value":"2025-09-03","order":3,"name":"published","label":"Published","group":{"name":"publication_history","label":"Publication History"}}]}}