{"status":"ok","message-type":"work","message-version":"1.0.0","message":{"indexed":{"date-parts":[[2026,7,15]],"date-time":"2026-07-15T07:13:25Z","timestamp":1784099605597,"version":"3.55.0"},"reference-count":48,"publisher":"Association for Computing Machinery (ACM)","issue":"3","content-domain":{"domain":[],"crossmark-restriction":false},"short-container-title":["Proc. ACM Manag. Data"],"published-print":{"date-parts":[[2025,6,17]]},"abstract":"<jats:p>Although multi-agent collaborative Large Language Models (LLMs) have achieved significant breakthroughs in the Text-to-SQL task, their performance is still constrained by various factors. These factors include the incompleteness of the framework, failure to follow instructions, and model hallucinations. To address these problems, we propose OpenSearch-SQL, which divides the Text-to-SQL task into four main modules: Preprocessing, Extraction, Generation, and Refinement, along with an Alignment module based on a consistency alignment mechanism. This architecture aligns the inputs and outputs of agents through the Alignment module, reducing failures in instruction following and hallucination. Furthermore, we introduce SQL-Like (an intermediate language), optimize the structured Chain-of-Thought (CoT) based on SQL-Like, and develop a dynamic few-shot strategy via self-taught Query-CoT-SQL.<\/jats:p>\n                  <jats:p>In terms of model selection, we directly applied the base LLMs without any post-training, thereby simplifying the task chain and enhancing the framework's portability. Experimental results show that OpenSearch-SQL achieves an execution accuracy(EX) of 69.3% on the BIRD development set, 72.28% on the test set, and a reward-based validity efficiency score (R-VES) of 69.36%, with all three metrics ranking first at the time of submission. These results demonstrate the comprehensive advantages of the proposed method in both effectiveness and efficiency.<\/jats:p>","DOI":"10.1145\/3725331","type":"journal-article","created":{"date-parts":[[2025,6,18]],"date-time":"2025-06-18T21:23:29Z","timestamp":1750281809000},"page":"1-24","source":"Crossref","is-referenced-by-count":28,"title":["OpenSearch-SQL: Enhancing Text-to-SQL with Dynamic Few-shot and Consistency Alignment"],"prefix":"10.1145","volume":"3","author":[{"ORCID":"https:\/\/orcid.org\/0009-0008-7696-0434","authenticated-orcid":false,"given":"Xiangjin","family":"Xie","sequence":"first","affiliation":[{"name":"Alibaba Cloud Computing, Hangzhou, China"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0000-0003-1849-2595","authenticated-orcid":false,"given":"Guangwei","family":"Xu","sequence":"additional","affiliation":[{"name":"Alibaba Cloud Computing, Hangzhou, China"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0009-0000-5209-5724","authenticated-orcid":false,"given":"Lingyan","family":"Zhao","sequence":"additional","affiliation":[{"name":"Alibaba Cloud Computing, Hangzhou, China"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0009-0000-5278-3172","authenticated-orcid":false,"given":"Ruijie","family":"Guo","sequence":"additional","affiliation":[{"name":"Alibaba Cloud Computing, Beijing, China"}],"role":[{"vocabulary":"crossref","role":"author"}]}],"member":"320","published-online":{"date-parts":[[2025,6,18]]},"reference":[{"key":"e_1_2_1_1_1","unstructured":"Jinze Bai Shuai Bai Yunfei Chu Zeyu Cui Kai Dang Xiaodong Deng Yang Fan Wenbin Ge Yu Han Fei Huang et al. 2023. Qwen technical report. arXiv preprint arXiv:2309.16609 (2023)."},{"key":"e_1_2_1_2_1","volume-title":"Global reasoning over database structures for text-to-sql parsing. arXiv preprint arXiv:1908.11214","author":"Bogin Ben","year":"2019","unstructured":"Ben Bogin, Matt Gardner, and Jonathan Berant. 2019. Global reasoning over database structures for text-to-sql parsing. arXiv preprint arXiv:1908.11214 (2019)."},{"key":"e_1_2_1_3_1","doi-asserted-by":"publisher","DOI":"10.1109\/ICDE51399.2021.00220"},{"key":"e_1_2_1_4_1","first-page":"309","article-title":"Ryansql: Recursively applying sketch-based slot fillings for complex text-to-sql in cross-domain databases","volume":"47","author":"Choi DongHyun","year":"2021","unstructured":"DongHyun Choi, Myeong Cheol Shin, EungGyun Kim, and Dong Ryeol Shin. 2021. Ryansql: Recursively applying sketch-based slot fillings for complex text-to-sql in cross-domain databases. Computational Linguistics, Vol. 47, 2 (2021), 309--332.","journal-title":"Computational Linguistics"},{"key":"e_1_2_1_5_1","volume-title":"BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding. arxiv","author":"Devlin Jacob","year":"2019","unstructured":"Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 2019. BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding. arxiv: 1810.04805 [cs.CL] https:\/\/arxiv.org\/abs\/1810.04805"},{"key":"e_1_2_1_6_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_7_1","volume-title":"Text-to-sql empowered by large language models: A benchmark evaluation. arXiv preprint arXiv: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. arXiv preprint arXiv:2308.15363 (2023)."},{"key":"e_1_2_1_8_1","volume-title":"Precise zero-shot dense retrieval without relevance labels. arXiv preprint arXiv:2212.10496","author":"Gao Luyu","year":"2022","unstructured":"Luyu Gao, Xueguang Ma, Jimmy Lin, and Jamie Callan. 2022. Precise zero-shot dense retrieval without relevance labels. arXiv preprint arXiv:2212.10496 (2022)."},{"key":"e_1_2_1_9_1","unstructured":"Yunfan Gao Yun Xiong Xinyu Gao Kangxiang Jia Jinliu Pan Yuxi Bi Yi Dai Jiawei Sun Meng Wang and Haofen Wang. 2024. Retrieval-Augmented Generation for Large Language Models: A Survey. arxiv: 2312.10997 [cs.CL]"},{"key":"e_1_2_1_10_1","unstructured":"Chunxi Guo Zhiliang Tian Jintao Tang Pancheng Wang Zhihua Wen Kang Yang and Ting Wang. 2023. Prompting GPT-3.5 for Text-to-SQL with De-semanticization and Skeleton Retrieval. arxiv: 2304.13301 [cs.CL] https:\/\/arxiv.org\/abs\/2304.13301"},{"key":"e_1_2_1_11_1","volume-title":"Towards complex text-to-sql in cross-domain database with intermediate representation. arXiv preprint arXiv:1905.08205","author":"Guo Jiaqi","year":"2019","unstructured":"Jiaqi Guo, Zecheng Zhan, Yan Gao, Yan Xiao, Jian-Guang Lou, Ting Liu, and Dongmei Zhang. 2019a. Towards complex text-to-sql in cross-domain database with intermediate representation. arXiv preprint arXiv:1905.08205 (2019)."},{"key":"e_1_2_1_12_1","volume-title":"Towards complex text-to-sql in cross-domain database with intermediate representation. arXiv preprint arXiv:1905.08205","author":"Guo Jiaqi","year":"2019","unstructured":"Jiaqi Guo, Zecheng Zhan, Yan Gao, Yan Xiao, Jian-Guang Lou, Ting Liu, and Dongmei Zhang. 2019b. Towards complex text-to-sql in cross-domain database with intermediate representation. arXiv preprint arXiv:1905.08205 (2019)."},{"key":"e_1_2_1_13_1","unstructured":"Kaiming He Xiangyu Zhang Shaoqing Ren and Jian Sun. 2015. Deep Residual Learning for Image Recognition. arxiv: 1512.03385 [cs.CV] https:\/\/arxiv.org\/abs\/1512.03385"},{"key":"e_1_2_1_14_1","doi-asserted-by":"publisher","DOI":"10.5555\/1287369.1287427"},{"key":"e_1_2_1_15_1","doi-asserted-by":"publisher","DOI":"10.1016\/B978-012722442-8\/50080-X"},{"key":"e_1_2_1_16_1","volume-title":"Learning a neural semantic parser from user feedback. arXiv preprint arXiv:1704.08760","author":"Iyer Srinivasan","year":"2017","unstructured":"Srinivasan Iyer, Ioannis Konstas, Alvin Cheung, Jayant Krishnamurthy, and Luke Zettlemoyer. 2017. Learning a neural semantic parser from user feedback. arXiv preprint arXiv:1704.08760 (2017)."},{"key":"e_1_2_1_17_1","doi-asserted-by":"publisher","DOI":"10.1007\/s00778-022-00776-8"},{"key":"e_1_2_1_18_1","volume-title":"MCS-SQL: 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. MCS-SQL: Leveraging Multiple Prompts and Multiple-Choice Selection For Text-to-SQL Generation. arXiv preprint arXiv:2405.07467 (2024)."},{"key":"e_1_2_1_19_1","unstructured":"Haoyang Li Jing Zhang Hanbing Liu Ju Fan Xiaokang Zhang Jun Zhu Renjie Wei Hongyan Pan Cuiping Li and Hong Chen. 2024b. CodeS: Towards Building Open-source Language Models for Text-to-SQL. arxiv: 2402.16347 [cs.CL]"},{"key":"e_1_2_1_20_1","volume-title":"Advances in Neural Information Processing Systems","volume":"36","author":"Li Jinyang","year":"2024","unstructured":"Jinyang Li, Binyuan Hui, Ge Qu, Jiaxi Yang, Binhua Li, Bowen Li, Bailin Wang, Bowen Qin, Ruiying Geng, Nan Huo, et al. 2024a. 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, Vol. 36 (2024)."},{"key":"e_1_2_1_21_1","unstructured":"Aixin Liu Bei Feng Bin Wang Bingxuan Wang Bo Liu Chenggang Zhao Chengqi Dengr Chong Ruan Damai Dai Daya Guo et al. 2024. Deepseek-v2: A strong economical and efficient mixture-of-experts language model. arXiv preprint arXiv:2405.04434 (2024)."},{"key":"e_1_2_1_22_1","volume-title":"Query rewriting for retrieval-augmented large language models. arXiv preprint arXiv:2305.14283","author":"Ma Xinbei","year":"2023","unstructured":"Xinbei Ma, Yeyun Gong, Pengcheng He, Hai Zhao, and Nan Duan. 2023. Query rewriting for retrieval-augmented large language models. arXiv preprint arXiv:2305.14283 (2023)."},{"key":"e_1_2_1_23_1","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: 2408.07702 [cs.CL] https:\/\/arxiv.org\/abs\/2408.07702"},{"key":"e_1_2_1_24_1","unstructured":"Yu. A. Malkov and D. A. Yashunin. 2018. Efficient and robust approximate nearest neighbor search using Hierarchical Navigable Small World graphs. arxiv: 1603.09320 [cs.DS] https:\/\/arxiv.org\/abs\/1603.09320"},{"key":"e_1_2_1_25_1","unstructured":"Meta. 2024. Introducing Meta Llama 3: The most capable openly available LLM to date. https:\/\/ai.meta.com\/blog\/meta-llama-3\/. Accessed: 2023-05--20."},{"key":"e_1_2_1_26_1","unstructured":"OpenAI Josh Achiam Steven Adler Sandhini Agarwal Lama Ahmad Ilge Akkaya Florencia Leoni Aleman Diogo Almeida Janko Altenschmidt Sam Altman et al. 2024. GPT-4 Technical Report. arxiv: 2303.08774 [cs.CL] https:\/\/arxiv.org\/abs\/2303.08774"},{"key":"e_1_2_1_27_1","volume-title":"Advances in Neural Information Processing Systems","volume":"36","author":"Pourreza Mohammadreza","year":"2024","unstructured":"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, Vol. 36 (2024)."},{"key":"e_1_2_1_28_1","doi-asserted-by":"crossref","unstructured":"Mohammadreza Pourreza and Davood Rafiei. 2024b. DTS-SQL: Decomposed Text-to-SQL with Small Large Language Models. arxiv: 2402.01117 [cs.CL]","DOI":"10.18653\/v1\/2024.findings-emnlp.481"},{"key":"e_1_2_1_29_1","volume-title":"Communicative agents for software development. arXiv preprint arXiv:2307.07924","author":"Qian Chen","year":"2023","unstructured":"Chen Qian, Xin Cong, Cheng Yang, Weize Chen, Yusheng Su, Juyuan Xu, Zhiyuan Liu, and Maosong Sun. 2023. Communicative agents for software development. arXiv preprint arXiv:2307.07924 (2023)."},{"key":"e_1_2_1_30_1","unstructured":"Alec Radford Jeffrey Wu Rewon Child David Luan Dario Amodei Ilya Sutskever et al. 2019. Language models are unsupervised multitask learners. OpenAI blog Vol. 1 8 (2019) 9."},{"key":"e_1_2_1_31_1","volume-title":"SmBoP: Semi-autoregressive bottom-up semantic parsing. arXiv preprint arXiv:2010.12412","author":"Rubin Ohad","year":"2020","unstructured":"Ohad Rubin and Jonathan Berant. 2020. SmBoP: Semi-autoregressive bottom-up semantic parsing. arXiv preprint arXiv:2010.12412 (2020)."},{"key":"e_1_2_1_32_1","volume-title":"Enhancing retrieval-augmented large language models with iterative retrieval-generation synergy. arXiv preprint arXiv:2305.15294","author":"Shao Zhihong","year":"2023","unstructured":"Zhihong Shao, Yeyun Gong, Yelong Shen, Minlie Huang, Nan Duan, and Weizhu Chen. 2023. Enhancing retrieval-augmented large language models with iterative retrieval-generation synergy. arXiv preprint arXiv:2305.15294 (2023)."},{"key":"e_1_2_1_33_1","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: 2305.14215 [cs.CL]"},{"key":"e_1_2_1_34_1","volume-title":"CHESS: Contextual Harnessing for Efficient SQL Synthesis. arxiv: 2405.16755 [cs.LG] https:\/\/arxiv.org\/abs\/2405.16755","author":"Talaei Shayan","year":"2024","unstructured":"Shayan Talaei, Mohammadreza Pourreza, Yu-Chen Chang, Azalia Mirhoseini, and Amin Saberi. 2024. CHESS: Contextual Harnessing for Efficient SQL Synthesis. arxiv: 2405.16755 [cs.LG] https:\/\/arxiv.org\/abs\/2405.16755"},{"key":"e_1_2_1_35_1","volume-title":"Dubo-SQL: Diverse Retrieval-Augmented Generation and Fine Tuning for Text-to-SQL. arXiv preprint arXiv:2404.12560","author":"Thorpe Dayton G","year":"2024","unstructured":"Dayton G Thorpe, Andrew J Duberstein, and Ian A Kinsey. 2024. Dubo-SQL: Diverse Retrieval-Augmented Generation and Fine Tuning for Text-to-SQL. arXiv preprint arXiv:2404.12560 (2024)."},{"key":"e_1_2_1_36_1","volume-title":"Mac-sql: Multi-agent collaboration for text-to-sql. arXiv preprint arXiv:2312.11242","author":"Wang Bing","year":"2023","unstructured":"Bing Wang, Changyu Ren, Jian Yang, Xinnian Liang, Jiaqi Bai, Qian-Wen Zhang, Zhao Yan, and Zhoujun Li. 2023. Mac-sql: Multi-agent collaboration for text-to-sql. arXiv preprint arXiv:2312.11242 (2023)."},{"key":"e_1_2_1_37_1","volume-title":"Rat-sql: Relation-aware schema encoding and linking for text-to-sql parsers. arXiv preprint arXiv:1911.04942","author":"Wang Bailin","year":"2019","unstructured":"Bailin Wang, Richard Shin, Xiaodong Liu, Oleksandr Polozov, and Matthew Richardson. 2019. Rat-sql: Relation-aware schema encoding and linking for text-to-sql parsers. arXiv preprint arXiv:1911.04942 (2019)."},{"key":"e_1_2_1_38_1","doi-asserted-by":"publisher","DOI":"10.1145\/3062341.3062365"},{"key":"e_1_2_1_39_1","doi-asserted-by":"publisher","DOI":"10.1007\/s11704-024-40231-1"},{"key":"e_1_2_1_40_1","volume-title":"Chi, Quoc Le, and Denny Zhou","author":"Wei Jason","year":"2023","unstructured":"Jason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma, Brian Ichter, Fei Xia, Ed Chi, Quoc Le, and Denny Zhou. 2023. Chain-of-Thought Prompting Elicits Reasoning in Large Language Models. arxiv: 2201.11903 [cs.CL] https:\/\/arxiv.org\/abs\/2201.11903"},{"key":"e_1_2_1_41_1","unstructured":"Shitao Xiao Zheng Liu Peitian Zhang and Niklas Muennighoff. 2023. C-Pack: Packaged Resources To Advance General Chinese Embedding. arxiv: 2309.07597 [cs.CL]"},{"key":"e_1_2_1_42_1","volume-title":"Sqlnet: Generating structured queries from natural language without reinforcement learning. arXiv preprint arXiv:1711.04436","author":"Xu Xiaojun","year":"2017","unstructured":"Xiaojun Xu, Chang Liu, and Dawn Song. 2017. Sqlnet: Generating structured queries from natural language without reinforcement learning. arXiv preprint arXiv:1711.04436 (2017)."},{"key":"e_1_2_1_43_1","volume-title":"Syntaxsqlnet: Syntax tree networks for complex and cross-domaintext-to-sql task. arXiv preprint arXiv:1810.05237","author":"Yu Tao","year":"2018","unstructured":"Tao Yu, Michihiro Yasunaga, Kai Yang, Rui Zhang, Dongxu Wang, Zifan Li, and Dragomir Radev. 2018a. Syntaxsqlnet: Syntax tree networks for complex and cross-domaintext-to-sql task. arXiv preprint arXiv:1810.05237 (2018)."},{"key":"e_1_2_1_44_1","volume-title":"Spider: A large-scale human-labeled dataset for complex and cross-domain semantic parsing and text-to-sql task. arXiv preprint arXiv:1809.08887","author":"Yu Tao","year":"2018","unstructured":"Tao Yu, Rui Zhang, Kai Yang, Michihiro Yasunaga, Dongxu Wang, Zifan Li, James Ma, Irene Li, Qingning Yao, Shanelle Roman, et al. 2018b. Spider: A large-scale human-labeled dataset for complex and cross-domain semantic parsing and text-to-sql task. arXiv preprint arXiv:1809.08887 (2018)."},{"key":"e_1_2_1_45_1","volume-title":"Generate rather than retrieve: Large language models are strong context generators. arXiv preprint arXiv:2209.10063","author":"Yu Wenhao","year":"2022","unstructured":"Wenhao Yu, Dan Iter, Shuohang Wang, Yichong Xu, Mingxuan Ju, Soumya Sanyal, Chenguang Zhu, Michael Zeng, and Meng Jiang. 2022. Generate rather than retrieve: Large language models are strong context generators. arXiv preprint arXiv:2209.10063 (2022)."},{"key":"e_1_2_1_46_1","unstructured":"Yue Zhang Yafu Li Leyang Cui Deng Cai Lemao Liu Tingchen Fu Xinting Huang Enbo Zhao Yu Zhang Yulong Chen et al. 2023. Siren's song in the AI ocean: a survey on hallucination in large language models. arXiv preprint arXiv:2309.01219 (2023)."},{"key":"e_1_2_1_47_1","volume-title":"Semantic Evaluation for Text-to-SQL with Distilled Test Suites. arxiv","author":"Zhong Ruiqi","year":"2010","unstructured":"Ruiqi Zhong, Tao Yu, and Dan Klein. 2020. Semantic Evaluation for Text-to-SQL with Distilled Test Suites. arxiv: 2010.02840 [cs.CL]"},{"key":"e_1_2_1_48_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)."}],"container-title":["Proceedings of the ACM on Management of Data"],"original-title":[],"language":"en","link":[{"URL":"https:\/\/dl.acm.org\/doi\/pdf\/10.1145\/3725331","content-type":"unspecified","content-version":"vor","intended-application":"similarity-checking"}],"deposited":{"date-parts":[[2026,3,31]],"date-time":"2026-03-31T18:51:55Z","timestamp":1774983115000},"score":1,"resource":{"primary":{"URL":"https:\/\/dl.acm.org\/doi\/10.1145\/3725331"}},"subtitle":[],"short-title":[],"issued":{"date-parts":[[2025,6,17]]},"references-count":48,"journal-issue":{"issue":"3","published-print":{"date-parts":[[2025,6,17]]}},"alternative-id":["10.1145\/3725331"],"URL":"https:\/\/doi.org\/10.1145\/3725331","relation":{},"ISSN":["2836-6573"],"issn-type":[{"value":"2836-6573","type":"electronic"}],"subject":[],"published":{"date-parts":[[2025,6,17]]}}}