Skip to main content
QUICK REVIEW

[Paper Review] TRANX: A Transition-based Neural Abstract Syntax Parser for Semantic Parsing and Code Generation

Pengcheng Yin, Graham Neubig|arXiv (Cornell University)|Oct 5, 2018
Natural Language Processing TechniquesComputer Science20 references19 citations
TL;DR

Tranx is a transition-based neural abstract syntax parser that maps natural language utterances to formal meaning representations using a task-agnostic abstract syntax description language (ASDL) grammar. By decoupling the parser architecture from domain-specific grammars, Tranx achieves strong performance across semantic parsing and code generation tasks, outperforming existing neural models on three of four benchmarks, including state-of-the-art results on WikiSQL with simple extensions.

ABSTRACT

We present TRANX, a transition-based neural semantic parser that maps natural language (NL) utterances into formal meaning representations (MRs). TRANX uses a transition system based on the abstract syntax description language for the target MR, which gives it two major advantages: (1) it is highly accurate, using information from the syntax of the target MR to constrain the output space and model the information flow, and (2) it is highly generalizable, and can easily be applied to new types of MR by just writing a new abstract syntax description corresponding to the allowable structures in the MR. Experiments on four different semantic parsing and code generation tasks show that our system is generalizable, extensible, and effective, registering strong results compared to existing neural semantic parsers.

Motivation & Objective

  • To develop a generalizable and extensible neural semantic parser that can be adapted to diverse meaning representation formalisms without architectural re-design.
  • To address the limitation of existing neural parsers that are tightly coupled to specific grammars by decoupling the model from domain-specific syntax through external ASDL grammar specification.
  • To improve performance in semantic parsing and code generation by leveraging structured, transition-based parsing guided by abstract syntax trees (ASTs) and ASDL-defined grammars.
  • To demonstrate that minimal architectural modifications—such as adding pointer networks or answer pruning—can yield significant performance gains on complex benchmarks like WikiSQL.

Proposed method

  • Tranx employs a transition system that incrementally constructs an abstract syntax tree (AST) from natural language input using a sequence of tree-construction actions.
  • The parser uses a neural network to score each action in the transition sequence, with the final AST converted to a meaning representation via a user-defined AST_to_MR function.
  • Domain-specific grammars are encoded using the Abstract Syntax Description Language (ASDL), which defines valid AST structures and guides the parsing process without modifying the model architecture.
  • The system supports extensibility through a modular design: new grammars are added by defining new ASDL rules, and new actions (e.g., GenToken for column selection) can be integrated with minimal code changes.
  • For code generation tasks like WikiSQL, Tranx incorporates a pointer network over column encodings to generate column references, improving accuracy without complex architectural redesign.
  • The model supports both parent feeding (incorporating parent node representations) and answer pruning (executing candidate outputs to filter invalid ones), enhancing performance on table-based tasks.

Experimental results

Research questions

  • RQ1Can a single neural parser architecture generalize across diverse semantic parsing and code generation tasks by decoupling from task-specific grammars?
  • RQ2How effective is a transition-based parsing approach guided by ASDL-grammar constraints in improving accuracy and generalization in semantic parsing?
  • RQ3To what extent can minimal architectural extensions—such as pointer networks or answer pruning—improve performance on complex, table-based code generation tasks?
  • RQ4Does modeling parent node information in the AST construction process enhance performance on complex grammars like Python or SQL?

Key findings

  • Tranx outperforms existing neural semantic parsers on the Geo and Atis datasets, achieving 88.2% and 86.2% accuracy respectively, even without parent feeding.
  • On the Django code generation benchmark, Tranx achieves 73.7% accuracy, surpassing prior neural models and demonstrating strong effectiveness in program synthesis.
  • On WikiSQL, Tranx achieves 68.6% exact match and 78.6% execution accuracy with answer pruning, outperforming many task-specific models that use complex, table-aware neural architectures.
  • The addition of parent feeding improves performance on complex grammars like Python (Django), suggesting that modeling parent-child relationships enhances parsing accuracy in deep ASTs.
  • Even with minimal modifications—such as adding a pointer network for column selection and a simple answer pruning strategy—Tranx achieves state-of-the-art results on WikiSQL, demonstrating high extensibility.
  • The model’s performance remains strong without using table contents during inference, and gains are significantly boosted when answer pruning is applied, highlighting the value of lightweight, post-hoc filtering.

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.