**Abstract:**
The paper introduces CHESS, an end-to-end text-to-SQL system designed for complex, real-world databases. CHESS addresses the challenge of transforming natural language questions into efficient SQL queries by incorporating data catalogs and database values. The system consists of three main components: entity and context retrieval, schema selection, and SQL generation. The entity and context retrieval module uses keyword detection, locality-sensitive hashing, and vector databases to efficiently retrieve relevant database values and contextual information. The schema selection module narrows down the initial schema to a minimal yet sufficient subset of columns. The SQL generation module uses a fine-tuned SQL generator model and a revision step to produce accurate SQL queries. CHESS achieves state-of-the-art performance on the challenging BIRD dataset, ranking first among all disclosed methodologies. The method generalizes to both proprietary models like GPT-4 and open-source models such as Llama-3-70B. Ablation studies demonstrate the effectiveness of each component in guiding LLMs to generate accurate SQL queries.
**Introduction:**
Text-to-SQL translation is a long-standing research problem, particularly challenging when applied to complex databases with extensive schemas, values, and catalogs. Current methods often fall short of human performance, with a significant accuracy gap. CHESS aims to bridge this gap by integrating contextual data from database catalogs and values into the text-to-SQL pipeline.
**Methodology:**
CHESS's pipeline includes:
1. **Entity and Context Retrieval:** Extracts keywords from the question, retrieves relevant database values, and extracts contextual information from catalogs.
2. **Schema Selection:** Narrow down the initial schema to a minimal set of necessary tables and columns.
3. **SQL Generation:** Uses a fine-tuned SQL generator model and a revision step to generate and refine SQL queries.
**Experiments:**
- **Datasets and Metrics:** Evaluates performance on the BIRD dataset, which features 12,751 unique question-SQL pairs across 95 large databases.
- **Results:** CHESS achieves state-of-the-art execution accuracy on both the BIRD development and test sets, ranking second among all methods on the BIRD leaderboard.
- **Ablation Studies:** Demonstrates the critical role of each component in the pipeline, with significant improvements in execution accuracy.
**Discussion and Limitations:**
CHESS's approach enhances text-to-SQL capabilities but aims to further automate the database querying process. Future work should focus on closing the gap with human performance and improving schema selection methodologies. The paper also provides detailed implementation details and prompt templates for each sub-module.**Abstract:**
The paper introduces CHESS, an end-to-end text-to-SQL system designed for complex, real-world databases. CHESS addresses the challenge of transforming natural language questions into efficient SQL queries by incorporating data catalogs and database values. The system consists of three main components: entity and context retrieval, schema selection, and SQL generation. The entity and context retrieval module uses keyword detection, locality-sensitive hashing, and vector databases to efficiently retrieve relevant database values and contextual information. The schema selection module narrows down the initial schema to a minimal yet sufficient subset of columns. The SQL generation module uses a fine-tuned SQL generator model and a revision step to produce accurate SQL queries. CHESS achieves state-of-the-art performance on the challenging BIRD dataset, ranking first among all disclosed methodologies. The method generalizes to both proprietary models like GPT-4 and open-source models such as Llama-3-70B. Ablation studies demonstrate the effectiveness of each component in guiding LLMs to generate accurate SQL queries.
**Introduction:**
Text-to-SQL translation is a long-standing research problem, particularly challenging when applied to complex databases with extensive schemas, values, and catalogs. Current methods often fall short of human performance, with a significant accuracy gap. CHESS aims to bridge this gap by integrating contextual data from database catalogs and values into the text-to-SQL pipeline.
**Methodology:**
CHESS's pipeline includes:
1. **Entity and Context Retrieval:** Extracts keywords from the question, retrieves relevant database values, and extracts contextual information from catalogs.
2. **Schema Selection:** Narrow down the initial schema to a minimal set of necessary tables and columns.
3. **SQL Generation:** Uses a fine-tuned SQL generator model and a revision step to generate and refine SQL queries.
**Experiments:**
- **Datasets and Metrics:** Evaluates performance on the BIRD dataset, which features 12,751 unique question-SQL pairs across 95 large databases.
- **Results:** CHESS achieves state-of-the-art execution accuracy on both the BIRD development and test sets, ranking second among all methods on the BIRD leaderboard.
- **Ablation Studies:** Demonstrates the critical role of each component in the pipeline, with significant improvements in execution accuracy.
**Discussion and Limitations:**
CHESS's approach enhances text-to-SQL capabilities but aims to further automate the database querying process. Future work should focus on closing the gap with human performance and improving schema selection methodologies. The paper also provides detailed implementation details and prompt templates for each sub-module.