SmBoP: Semi-autoregressive Bottom-up Semantic Parsing

Ohad Rubin, Jonathan Berant

TL;DR

This paper introduces SmBoP, a novel semi-autoregressive bottom-up semantic parser that constructs abstract syntax trees for natural language to SQL queries. SmBoP achieves significant speedups in both training and decoding compared to traditional top-down autoregressive methods, while also establishing a new state-of-the-art in denotation accuracy on the challenging SPIDER benchmark.

What Problem Does This Paper Address?

Semantic parsing, the task of converting natural language into structured queries like SQL, has largely relied on autoregressive, top-down decoding of abstract syntax trees. While effective, this approach can be computationally expensive, particularly during training and for complex queries. The decoder generates the program step-by-step, creating partial trees that often lack clear semantic meaning. This paper addresses the inefficiency and semantic ambiguity of existing top-down decoding methods by proposing a bottom-up, semi-autoregressive approach.

Methods

The core innovation is the Semi-autoregressive Bottom-up Parser (SMBOP). Unlike top-down methods that build trees from the root downwards, SMBOP constructs trees from the leaves upwards. At each decoding step, it generates multiple candidate sub-trees of a certain height in parallel. This "bottom-up" construction allows for more efficient processing.

Key aspects of the SMBOP method include:

  • Semi-autoregressive Decoding: Instead of generating one token at a time, SMBOP generates multiple sub-trees of a specific height in parallel at each step. This is akin to beam search but applied to tree construction.
  • Bottom-up Construction: The parser builds up the abstract syntax tree by combining smaller, semantically meaningful sub-trees. This contrasts with top-down methods where intermediate states might represent semantically vacuous partial trees.
  • RAT-SQL Encoder: The paper leverages the state-of-the-art RAT-SQL encoder to jointly represent the input utterance and database schema, providing rich contextual information.
  • Tree Balancing: To ensure consistent tree heights for parallel processing, a "KEEP" operation is introduced to balance trees, ensuring all constants and values are at height 0.
  • Scoring and Representation: SMBOP uses cross-attention to contextualize sub-trees with the input question and employs feed-forward networks to score potential new trees. It then generates vector representations for these new trees.
  • Beam Initialization: The initial beam is populated with top-scoring schema constants and detected database values from the input question.

Datasets

The primary dataset used for training and evaluation is SPIDER. SPIDER is a large-scale, challenging dataset for text-to-SQL parsing, known for its complex SQL queries and a realistic zero-shot setup where test-time schemas differ from training-time schemas. The paper does not introduce a new benchmark.

Key Insights and Ideas

  • Bottom-up is Efficient: The core insight is that constructing trees from the bottom up, especially in a semi-autoregressive manner, leads to significant computational gains. This is because sub-trees of a certain height can be processed in parallel, resulting in logarithmic runtime complexity with respect to tree size, rather than linear.
  • Semantically Rich Intermediate Representations: By building from smaller, meaningful units (sub-trees), SMBOP learns representations for executable sub-programs at each step. This is a significant advantage over top-down methods where intermediate states might not have clear semantic interpretations.
  • Parallelism is Key: The semi-autoregressive nature allows for parallel computation of candidate sub-trees at each decoding step, directly contributing to faster decoding and training times.
  • DB Value Handling: The model's ability to directly handle and predict database values (rather than just anonymized placeholders) leads to improved denotation accuracy, which is a more direct measure of query correctness.

Key Results

  • Decoding Speedup: SMBOP achieves an average speedup of 2.2x in decoding time compared to autoregressive methods. For long SQL queries, this speedup can reach 4x-6x.
  • Training Speedup: SMBOP demonstrates a substantial training speedup of approximately 5x. It converges much faster than baseline models, processing significantly more examples per second.
  • State-of-the-Art Performance: SMBOP achieves a denotation accuracy of 71.1% on SPIDER, establishing a new state-of-the-art. Its exact match (EM) accuracy is 69.5%, comparable to top models.
  • Improved Denotation Accuracy: It surpasses an ensemble of BRIDGE+BERT models by 2.9 denotation accuracy points.

Limitations and Future Work

  • DB Value Generation Limitation: A current limitation is that SMBOP cannot generate DB values that do not appear in the input question. The authors suggest that mechanisms like "BRIDGE" could address this.
  • Potential for Full Autoregression: While SMBOP is semi-autoregressive, it could potentially be modified to be fully autoregressive by decoding one tree at a time. The authors suggest re-examining this given recent architectural advances.
  • Execution-Guided Parsing: The paper notes that bottom-up parsing could benefit from executing sub-queries during parsing to guide the search, a direction not explored here due to training slowdowns.
  • Further Representation Learning: Future work could leverage advancements in learning tree representations to further enhance parser performance.

Summary updated

BibTeX
@inproceedings{rubin2021smbop,
  author = {Ohad Rubin and Jonathan Berant},
  title = {{SmBoP: Semi-autoregressive Bottom-up Semantic Parsing}},
  booktitle = {Conference of the North American Chapter of the Association for Computational Linguistics},
  year = {2021},
  doi = {10.18653/v1/2021.naacl-main.29},
}
Figure