Skip to main content
QUICK REVIEW

[Paper Review] Hybrid Ranking Network for Text-to-SQL

Qin Lyu, Kaushik Chakrabarti|arXiv (Cornell University)|Aug 11, 2020
Topic ModelingComputer Science14 references50 citations
TL;DR

HydraNet uses a column-wise hybrid ranking approach with BERT/RoBERTa as encoder, enabling execution-guided decoding to achieve state-of-the-art results on WikiSQL.

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.

Motivation & Objective

  • Motivate better utilization of pre-trained language models for Text-to-SQL.
  • Propose a column-wise encoder-decoder architecture that aligns with base LM training objectives.
  • Introduce a column ranking mechanism and multi-task objectives for SQL clause components.
  • Apply execution-guided decoding to ensure executable SQL and mitigate invalid predictions.
  • Demonstrate state-of-the-art performance on WikiSQL and analyze components of the approach.

Proposed method

  • Form input as NL question paired with individual table column (column-question pair) to align with BERT/RoBERTa training.
  • Represent SQL as a set of global objects (select_num, where_num) and column-associated objects (agg, operator, value spans) and model them as multi-task predictions.
  • Perform three column ranking tasks: SELECT-column ranking, WHERE-column ranking, and overall relevance ranking (SELECT/WHERE/RELEVANCE).
  • Fine-tune a Transformer encoder (BERT/RoBERTa) on the column-question pairs using task-specific classifiers and QA-style start/end predictions for values.
  • Assemble final SQL via straightforward rules using top-ranked columns and predicted operators/values, with an execution-guided decoding (EG) loop to validate and adjust results against the database.
  • Input representation uses per-column text: (column type, table name, column name) concatenated and paired with the NL question.

Experimental results

Research questions

  • RQ1Can a column-wise encoding paired with pre-trained language models outperform full-table encodings for Text-to-SQL on WikiSQL?
  • RQ2Does a hybrid ranking approach (SELECT/WHERE/RELEVANCE) improve column selection and SQL correctness compared to column-aggregate methods?
  • RQ3Can execution-guided decoding improve robustness and accuracy by validating predictions against runtime database results?

Key findings

  • HydraNet variants achieve top performance on WikiSQL dev/test in logical form and execution metrics.
  • With RoBERTa-Large, HydraNet achieves 83.8% LF accuracy and 89.2% execution accuracy on the test set (no EG), and 86.5% LF and 92.2% execution with EG.
  • HydraNet plus EG using RoBERTa-Large yields the strongest test results among reported configurations: 86.5% LF and 92.2% execution accuracy.
  • Compared to SQLova and X-SQL baselines, HydraNet (especially with EG) consistently improves both LF and execution metrics on WikiSQL.
  • Column-question pairing with a simple decoder and execution-guided decoding can match or surpass models that use full-column inputs and more complex pooling/decoding.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.