Hybrid Ranking Network for Text-to-SQL
Abstract
In this paper, we study how to leverage pre-trained language models in Text-to-SQL. We argue that previous approaches under utilize the base language models by concatenating all columns together with the NL question and feeding them into the base language model in the encoding stage. We propose a neat approach called Hybrid Ranking Network (HydraNet) which breaks down the problem into column-wise ranking and decoding and finally assembles the column-wise outputs into a SQL query by straightforward rules. In this approach, the encoder is given a NL question and one individual column, which perfectly aligns with the original tasks BERT/RoBERTa is trained on, and hence we avoid any ad-hoc pooling or additional encoding layers which are necessary in prior approaches. Experiments on the WikiSQL dataset show that the proposed approach is very effective, achieving the top place on the leaderboard.
Empirical ResultsBrowse all benchmarks →
| Benchmark | Method | Metric | Score | Protocol / Evidence |
|---|---|---|---|---|
| WikiSQL | HydraNet + EG (RoBERTa-Large) | logical form accuracy | 86.5% | split: test · backbone=RoBERTa-Large · decoding=execution-guidedSource quoteL189: HydraNet + EG │ RoBERTa-Large │ 86.6, 92.4 │ 86.5, 92.2 |
| WikiSQL | HydraNet + EG (RoBERTa-Large) | execution accuracy | 92.2%+0.4 vs baseline | split: test · backbone=RoBERTa-Large · decoding=execution-guidedSource quoteL189: HydraNet + EG │ RoBERTa-Large │ 86.6, 92.4 │ 86.5, 92.2 |
| WikiSQL | HydraNet (RoBERTa-Large) | logical form accuracy | 83.8% | split: test · backbone=RoBERTa-Large · decoding=without execution-guided decodingSource quoteL184: HydraNet │ RoBERTa-Large │ 83.6, 89.1 │ 83.8, 89.2 |
| WikiSQL | HydraNet (RoBERTa-Large) | execution accuracy | 89.2% | split: test · backbone=RoBERTa-Large · decoding=without execution-guided decodingSource quoteL184: HydraNet │ RoBERTa-Large │ 83.6, 89.1 │ 83.8, 89.2 |
Reported baseline / comparator measurements (2)
| Benchmark | Method | Metric | Score | Protocol / Evidence |
|---|---|---|---|---|
| WikiSQL | X-SQL + EG (MT-DNN) baseline | logical form accuracy | 86.0% | split: test · backbone=MT-DNN · decoding=execution-guidedSource quoteL187: X-SQL + EG │ MT-DNN │ 86.2, 92.3 │ 86.0, 91.8 |
| WikiSQL | X-SQL + EG (MT-DNN) baseline | execution accuracy | 91.8% | split: test · backbone=MT-DNN · decoding=execution-guidedSource quoteL187: X-SQL + EG │ MT-DNN │ 86.2, 92.3 │ 86.0, 91.8 |
BibTeX
@misc{lyu2020hybrid,
author = {Qin Lyu and Kaushik Chakrabarti and Shobhit Hathi and Souvik Kundu and Jianwen Zhang and Zheng Chen},
title = {{Hybrid Ranking Network for Text-to-SQL}},
year = {2020},
eprint = {2008.04759},
archivePrefix = {arXiv},
url = {https://arxiv.org/abs/2008.04759},
}Ask Althea to put this paper to the test.