Structure Guided Large Language Model for SQL Generation (2402.13284v2)
Abstract: Generating accurate Structured Querying Language (SQL) is a long-standing problem, especially in matching users' semantic queries with structured databases and then generating structured SQL. Existing models typically input queries and database schemas into the LLM and rely on the LLM to perform semantic-structure matching and generate structured SQL. However, such solutions overlook the structural information within user queries and databases, which can be utilized to enhance the generation of structured SQL. This oversight can lead to inaccurate or unexecutable SQL generation. To fully exploit the structure, we propose a structure-to-SQL framework, which leverages the inherent structure information to improve the SQL generation of LLMs. Specifically, we introduce our Structure Guided SQL~(SGU-SQL) generation model. SGU-SQL first links user queries and databases in a structure-enhanced manner. It then decomposes complicated linked structures with grammar trees to guide the LLM to generate the SQL step by step. Extensive experiments on two benchmark datasets illustrate that SGU-SQL can outperform sixteen SQL generation baselines.
- Palm 2 technical report. arXiv preprint arXiv:2305.10403.
- Lgesql: line graph enhanced text-to-sql model with mixed local and non-local relations. arXiv preprint arXiv:2106.01093.
- Neighbor enhanced graph convolutional networks for node classification and recommendation. Knowledge-Based Systems, 246:108594.
- Label-aware graph convolutional networks. In Proceedings of the 29th ACM International Conference on Information & Knowledge Management, page 1977–1980.
- Evaluating large language models trained on code. arXiv preprint arXiv:2107.03374.
- Hierarchy-aware multi-hop question answering over knowledge graphs. In Proceedings of the ACM Web Conference 2023, pages 2519–2527.
- C3: Zero-shot text-to-sql with chatgpt.
- Text-to-sql empowered by large language models: A benchmark evaluation. arXiv preprint arXiv:2308.15363.
- A case-based reasoning framework for adaptive prompting in cross-domain text-to-sql. arXiv preprint arXiv:2304.13301.
- S22{}^{2}start_FLOATSUPERSCRIPT 2 end_FLOATSUPERSCRIPTsql: Injecting syntax to question-schema interaction graph encoder for text-to-sql parsers.
- Rohit Kate. 2008. Transforming meaning representation grammars to improve semantic parsing. In CoNLL 2008: Proceedings of the Twelfth Conference on Computational Natural Language Learning, pages 33–40.
- Dan Klein and Christopher D Manning. 2003. Accurate unlexicalized parsing. In Proceedings of the 41st annual meeting of the association for computational linguistics, pages 423–430.
- Resdsql: Decoupling schema linking and skeleton parsing for text-to-sql. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 37, pages 13067–13075.
- Graphix-t5: Mixing pre-trained transformers with graph-aware layers for text-to-sql parsing. arXiv preprint arXiv:2301.07507.
- Can llm already serve as a database interface? a big bench for large-scale database grounded text-to-sqls. arXiv preprint arXiv:2305.03111.
- A comprehensive evaluation of chatgpt’s zero-shot text-to-sql capability. arXiv preprint arXiv:2303.13547.
- What makes good in-context examples for gpt-3333? arXiv preprint arXiv:2101.06804.
- Demonstration of insightpilot: An llm-empowered automated data exploration system. arXiv preprint arXiv:2304.00477.
- Enhancing few-shot text-to-sql capabilities of large language models: A study on prompt design strategies. arXiv preprint arXiv:2305.12586.
- OpenAI. 2023. Gpt-4 technical report.
- Mohammadreza Pourreza and Davood Rafiei. 2023. Din-sql: Decomposed in-context learning of text-to-sql with self-correction. arXiv preprint arXiv:2304.11015.
- Rasat: Integrating relational structures into pretrained seq2seq model for text-to-sql. arXiv preprint arXiv:2205.06983.
- Exploring the limits of transfer learning with a unified text-to-text transformer. The Journal of Machine Learning Research, 21(1):5485–5551.
- Code llama: Open foundation models for code. arXiv preprint arXiv:2308.12950.
- Picard: Parsing incrementally for constrained auto-regressive decoding from language models. arXiv preprint arXiv:2109.05093.
- Differentiable neuro-symbolic reasoning on large-scale knowledge graphs. Advances in Neural Information Processing Systems, 36.
- Sql-palm: Improved large language modeladaptation for text-to-sql. arXiv preprint arXiv:2306.00739.
- Immanuel Trummer. 2022. Codexdb: Synthesizing code for query processing from natural language instructions using gpt-3 codex. Proceedings of the VLDB Endowment, 15(11):2921–2928.
- Rat-sql: Relation-aware schema encoding and linking for text-to-sql parsers. arXiv preprint arXiv:1911.04942.
- Chain-of-thought prompting elicits reasoning in large language models. Advances in Neural Information Processing Systems, 35:24824–24837.
- Spider: A large-scale human-labeled dataset for complex and cross-domain semantic parsing and text-to-sql task.
- Knowgpt: Black-box knowledge injection for large language models. arXiv preprint arXiv:2312.06185.
- Contrastive knowledge graph error detection. In Proceedings of the 31st ACM International Conference on Information & Knowledge Management, pages 2590–2599.
- Integrating entity attributes for error-aware knowledge graph embedding. IEEE Transactions on Knowledge and Data Engineering.
- Qinggang Zhang (19 papers)
- Junnan Dong (14 papers)
- Hao Chen (1007 papers)
- Wentao Li (40 papers)
- Feiran Huang (32 papers)
- Xiao Huang (112 papers)