[Paper Review] C3: Zero-shot Text-to-SQL with ChatGPT
C3 is a ChatGPT-based zero-shot Text-to-SQL method that achieves 82.3% execution accuracy on Spider holdout and sets a new state-of-the-art for zero-shot Text-to-SQL on Spider, using about 1,000 tokens per query.
This paper proposes a ChatGPT-based zero-shot Text-to-SQL method, dubbed C3, which achieves 82.3\% in terms of execution accuracy on the holdout test set of Spider and becomes the state-of-the-art zero-shot Text-to-SQL method on the Spider Challenge. C3 consists of three key components: Clear Prompting (CP), Calibration with Hints (CH), and Consistent Output (CO), which are corresponding to the model input, model bias and model output respectively. It provides a systematic treatment for zero-shot Text-to-SQL. Extensive experiments have been conducted to verify the effectiveness and efficiency of our proposed method.
Motivation & Objective
- Motivate zero-shot Text-to-SQL due to high labeling costs and transferability concerns in fine-tuning.
- Develop a systematic zero-shot approach leveraging ChatGPT with minimal in-context resources.
- Mitigate model biases and output variability to improve SQL generation reliability.
Proposed method
- Propose Clear Prompting (CP) to optimize input layout and schema-relevant context.
- Introduce Calibration with Hints (CH) to mitigate ChatGPT biases in column selection and join usage.
- Apply Consistency Output (CO) via self-consistency-inspired sampling and execution-based voting to stabilize outputs.
Experimental results
Research questions
- RQ1Can zero-shot ChatGPT achieve competitive Text-to-SQL performance without demonstrations or fine-tuning?
- RQ2Do prompt layout, schema linking, and bias calibration improve zero-shot Text-to-SQL quality?
- RQ3Can output consistency strategies improve accuracy given LLM randomness?
Key findings
- C3 achieves 82.3% execution accuracy on Spider holdout, surpassing fine-tuning baselines in the reported setting.
- Clear prompt layout yields 7.0 percentage points higher execution accuracy than a complicated layout.
- Ablation shows recalling tables/columns and specifying foreign keys materially improves performance; calibration further reduces bias-related errors.
- Self-consistency-inspired sampling (CO) provides modest additional gains by selecting the most execution-consistent SQL among multiple samples.
- C3 uses roughly 1,000 tokens per query, offering a budget-friendly alternative to few-shot or GPT-4-based approaches.
- Compared to ChatGPT-SQL, C3 improves dev-set execution accuracy by about 9.5 percentage points in zero-shot settings.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.