SmBoP: Semi-autoregressive Bottom-up Semantic Parsing

Ohad Rubin, Jonathan Berant

Abstract

Semantic parsing, the translation of natural language into machine-executable code like SQL, has long been dominated by top-down, autoregressive decoders. This paper introduces SmBoP (Semi-autoregressive Bottom-up Parser), a novel approach that constructs program trees from the bottom up. By building all sub-trees of a specific height in parallel at each step, SmBoP achieves a 2.2x speedup in decoding and a 5x speedup in training. On the SPIDER benchmark, SmBoP sets a new state-of-the-art in denotation accuracy, proving that bottom-up decoding can outperform traditional sequential methods in both efficiency and accuracy.

Introduction

Traditional semantic parsers typically generate Abstract Syntax Trees (ASTs) node-by-node using a depth-first, top-down traversal. While effective, this approach suffers from linear decoding complexity relative to program size and relies on intermediate hidden states that lack clear semantic meaning until a branch is fully formed. Researchers from Tel Aviv University and the Allen Institute for AI propose SmBoP to address these issues by shifting to a bottom-up strategy, where the model builds meaningful, executable sub-programs first and combines them into larger structures.

Methodology: Bottom-Up Construction

SmBoP utilizes a standard relation-aware encoder (RAT-SQL) paired with a novel semi-autoregressive decoder. Instead of generating tokens sequentially, the decoder operates in discrete steps based on tree height.

The SmBoP architecture illustrating the bottom-up decoding process, from cross-attention to the scoring and pruning of the frontier.

Relational Algebra and Tree Balancing

To facilitate bottom-up construction, the model parses natural language into Relational Algebra rather than raw SQL. This representation is more naturally aligned with tree-based structures. A key innovation is the introduction of a unary KEEP operation. This operation allows the model to "carry over" a sub-tree to the next height level without altering its semantics, effectively balancing the trees so that all leaves reside at the same distance from the root.

The Frontier Mechanism

At each step $t$, the model identifies the top-$K$ sub-trees of height $\le t$. It then considers a "frontier"—the set of all possible trees of height $t+1$ that can be constructed using the current beam and the grammar. Using cross-attention to contextualize these trees with the input question, the model scores and prunes the frontier back to the top-$K$ candidates.

Key Insights: Complexity and Parallelism

SmBoP's bottom-up approach offers several theoretical and practical advantages:

  • Logarithmic Complexity: By building by height rather than node count, the runtime complexity is logarithmic relative to tree size. While SQL queries may contain dozens of nodes, their relational algebra trees rarely exceed a height of 10.
  • Semantic Intermediates: Every vector in the beam represents a valid, executable sub-program, enhancing interpretability.
  • Parallelism: Scoring the entire frontier at once allows SmBoP to leverage GPU parallelism far more effectively than sequential models.

Results and Performance

SmBoP achieved 71.1% denotation accuracy on the SPIDER benchmark, a state-of-the-art result at the time of publication. It also matched the exact match (EM) performance of top-tier autoregressive models like RAT-SQL+GRAPPA at 69.5%.

Training convergence comparison: SmBoP-GraPPa reaches high EM scores significantly faster than RATSQL-based models.

The efficiency gains are substantial: the model demonstrated a 2.2x average speedup in decoding (increasing to 5x-6x for long queries) and a 5x speedup in training time. As shown in the convergence analysis, SmBoP reaches high accuracy levels much earlier in the training process than its autoregressive counterparts.

Conclusion and Future Work

SmBoP demonstrates that bottom-up, semi-autoregressive decoding is a powerful alternative for semantic parsing. While the current model struggles with database values not present in the question, future work involving "BRIDGE" mechanisms or dedicated re-rankers could further improve performance. Additionally, the bottom-up nature of the model provides a foundation for "execution-guided" decoding, where sub-queries are executed during the search process to prune invalid paths.

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