{"status":"ok","message-type":"work","message-version":"1.0.0","message":{"indexed":{"date-parts":[[2025,10,22]],"date-time":"2025-10-22T20:35:22Z","timestamp":1761165322723,"version":"build-2065373602"},"reference-count":13,"publisher":"Sociedade Brasileira de Computa\u00e7\u00e3o - SBC","content-domain":{"domain":[],"crossmark-restriction":false},"short-container-title":[],"abstract":"<jats:p>Text-to-SQL has gained increasing attention with Large Language Models (LLMs). While existing architectures have demonstrated the potential of multi-agent systems there remains significant room for improvement. In this work, we extend the CHESS framework by integrating In-Context Learning (ICL) techniques into the Candidate Generator module, evaluating three strategies: Zero-Shot, Few-Shot Learning, and Retrieval-Augmented Generation (RAG). We implement the system using GPT-4o, and perform experiments on the financial dataset from BIRD-SQL. Results show that Few-Shot Learning and RAG significantly outperform the standard approach. Compared to Zero-Shot (59.31% Execution Accuracy (EX), 0.412 ROUGE-1), RAG significantly boosted performance, increasing EX to 69.48% and ROUGE-1 to 0.652.<\/jats:p>","DOI":"10.5753\/sbbd.2025.247172","type":"proceedings-article","created":{"date-parts":[[2025,10,21]],"date-time":"2025-10-21T19:26:36Z","timestamp":1761074796000},"page":"739-745","source":"Crossref","is-referenced-by-count":0,"title":["Enhancing Text-to-SQL with In-Context Learning: A Multi-Agent Approach Based on CHESS"],"prefix":"10.5753","author":[{"ORCID":"https:\/\/orcid.org\/0000-0002-7279-4546","authenticated-orcid":false,"given":"Renato O.","family":"Miyaji","sequence":"first","affiliation":[],"role":[{"role":"author","vocabulary":"crossref"}]},{"given":"Rafael M.","family":"Fernandes","sequence":"additional","affiliation":[],"role":[{"role":"author","vocabulary":"crossref"}]},{"given":"Krysthian F.","family":"Martins","sequence":"additional","affiliation":[],"role":[{"role":"author","vocabulary":"crossref"}]},{"given":"Jorge","family":"Melegati","sequence":"additional","affiliation":[],"role":[{"role":"author","vocabulary":"crossref"}]},{"ORCID":"https:\/\/orcid.org\/0000-0002-8743-4244","authenticated-orcid":false,"given":"Pedro L. P.","family":"Corr\u00eaa","sequence":"additional","affiliation":[],"role":[{"role":"author","vocabulary":"crossref"}]}],"member":"3742","published-online":{"date-parts":[[2025,9,29]]},"reference":[{"key":"1","unstructured":"Dong, X., Zhang, C., Ge, Y., Mao, Y., Gao, Y., Chen, I., Lin, J., and Lou, D. (2023). C3: Zero-shot text-to-sql with chatgpt. ArXiv."},{"key":"2","doi-asserted-by":"crossref","unstructured":"Hong, Z., Yuan, Z., Zhang, Q., Chen, H., Dong, J., Huang, F., and Huang, X. (2024). Next-generation database interfaces: A survey of llm-based text-to-sql. ArXiv.","DOI":"10.1109\/TKDE.2025.3609486"},{"key":"3","doi-asserted-by":"crossref","unstructured":"Katsogiannis-Meimarakis, G. and Koutrika, G. (2023). A survey on deep learning approaches for text-to-sql. The VLDB Journal, 32:905\u2014-936.","DOI":"10.1007\/s00778-022-00776-8"},{"key":"4","unstructured":"Lewis, P., Perez, E., Piktus, A., Petroni, F., and Karpukhin, V. (2020). Retrieval-augmented generation for knowledge-intensive nlp tasks. In Proceedings of the 34th International Conference on Neural Information Processing Systems, NIPS \u201920, Red Hook, NY, USA. Curran Associates Inc."},{"key":"5","doi-asserted-by":"crossref","unstructured":"Li, J., Hui, B., Cheng, R., Qin, B., and Ma, C. (2023). Graphix-t5: mixing pre-trained transformers with graph-aware layers for text-to-sql parsing. In Proceedings of the Thirty-Seventh AAAI Conference on Artificial Intelligence. AAAI Press.","DOI":"10.1609\/aaai.v37i11.26536"},{"key":"6","unstructured":"Li, J., Hui, B., Qu, G., Yang, J., Li, B., Li, B., Wang, B., Qin, B., Geng, R., Huo, N., 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."},{"key":"7","doi-asserted-by":"crossref","unstructured":"Nascimento, E. and Casanova, M. A. (2024). Querying databases with natural language: The use of large language models for text-to-sql tasks. In Anais Estendidos do XXXIX Simp\u00f3sio Brasileiro de Bancos de Dados, pages 196\u2013201, Porto Alegre, RS, Brasil. SBC.","DOI":"10.5753\/sbbd_estendido.2024.240552"},{"key":"8","unstructured":"OpenAI (2025). Gpt-4o. Available on: <a href=\"https:\/\/platform.openai.com\/docs\/models\/gpt-4o\"target=\"_blank\">[link]<\/a>. Accessed on 21 April 2025."},{"key":"9","unstructured":"Pourreza, M. and Rafiei, D. (2023). Din-sql: decomposed in-context learning of text-to-sql with self-correction. In Proceedings of the 37th International Conference on Neural Information Processing Systems, NIPS \u201923, Red Hook, NY, USA. Curran Associates Inc."},{"key":"10","unstructured":"Talaei, S., Pourreza, M., Chang, Y., Mirhoseini, A., and Saberi, A. (2024). Chess: Contextual harnessing for efficient sql synthesis. ArXiv."},{"key":"11","unstructured":"Wei, J., Wang, X., Schuurmans, D., Bosma, M., Ichter, B., Xia, F., Chi, E. H., Le, Q. V., and Zhou, D. (2022). Chain-of-thought prompting elicits reasoning in large language models. In Proceedings of the 36th International Conference on Neural Information Processing Systems, NIPS \u201922, Red Hook, NY, USA. Curran Associates Inc."},{"key":"12","doi-asserted-by":"crossref","unstructured":"Yin, P., Neubig, G., Yih, W., and Riedel, S. (2020). Tabert: Pretraining for joint understanding of textual and tabular data. In Proceeding of the 58th Annual Meeting of the Association for Computational Linguistics.","DOI":"10.18653\/v1\/2020.acl-main.745"},{"key":"13","doi-asserted-by":"crossref","unstructured":"Yu, T., Zhang, R., Yang, K., Yasunaga, M., and Wang, D. (2018). Spider: A large-scale human-labeled dataset for complex and cross-domain semantic parsing and text-to-SQL task. In Riloff, E., editor, Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 3911\u20133921, Brussels, Belgium. Association for Computational Linguistics.","DOI":"10.18653\/v1\/D18-1425"}],"event":{"name":"Simp\u00f3sio Brasileiro de Banco de Dados","number":"40","location":"Brasil","acronym":"SBBD 2025"},"container-title":["Anais do XL Simp\u00f3sio Brasileiro de Banco de Dados (SBBD 2025)"],"original-title":[],"link":[{"URL":"https:\/\/sol.sbc.org.br\/index.php\/sbbd\/article\/download\/37278\/37061","content-type":"application\/pdf","content-version":"vor","intended-application":"text-mining"},{"URL":"https:\/\/sol.sbc.org.br\/index.php\/sbbd\/article\/download\/37278\/37061","content-type":"unspecified","content-version":"vor","intended-application":"similarity-checking"}],"deposited":{"date-parts":[[2025,10,21]],"date-time":"2025-10-21T19:28:25Z","timestamp":1761074905000},"score":1,"resource":{"primary":{"URL":"https:\/\/sol.sbc.org.br\/index.php\/sbbd\/article\/view\/37278"}},"subtitle":[],"short-title":[],"issued":{"date-parts":[[2025,9,29]]},"references-count":13,"URL":"https:\/\/doi.org\/10.5753\/sbbd.2025.247172","relation":{},"subject":[],"published":{"date-parts":[[2025,9,29]]}}}