Enhancing Text-to-SQL Capabilities of Large Language Models by intermediate representations and Chain of Thought
Abstract
While large language models with in-context learning have dramatically improved the performance of text-to-SQL tasks, the semantic gay between natural language and SQL queries has not yet been bridged. Although some intermediate representations are designed to reduce the difficulty of SQL query generation, the dilemma of problem decomposition is not effectively alleviated in complex scenarios. Our proposed solution is intended to address both of these issues. First of all, we use NatSQL as the intermediate representation to implement the task of Text-to-NatSQL. Secondly, we use samples with Chain-of-Thought information to fine-tune small and medium-scale LLMs to enhance their task decomposition and reasoning capabilities in complex scenarios. Experiment results demonstrate that our model achieves performance similar to or better than several competitive baselines on public datasets Spider.