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.
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%.
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