Introduction
Semantic parsing—the task of translating natural language into machine-readable code—traditionally faced a divide. Graph-based methods represent meaning as subgraphs of a knowledge base (KB), offering high accuracy but requiring hand-crafted grammars. Conversely, Sequence-to-Sequence (Seq2Seq) models are powerful and end-to-end but treat logical forms as flat strings, often ignoring underlying data structures and producing "hallucinated" logic.
The "Sequence-to-Action" framework bridges this gap by training an RNN to generate a sequence of graph-building actions rather than a linearized string. This approach produces semantic representations that are compact, structurally sound, and tightly coupled with the KB.
The Sequence-to-Action Framework
Instead of predicting a linearized logical form, the model predicts a series of "construction steps" to build a semantic graph directly. This process is illustrated in the overall pipeline below:
The authors define six types of actions that serve as building blocks:
- add_variable / add_entity: Create nodes in the graph.
- add_type: Assign a category (e.g., "state") to a node.
- add_edge: Create a relationship (e.g., "next_to") between nodes.
- operation / end_operation: Handle complex logic like
argmax,count, orsum. - argument: Specify which nodes an edge or operation should connect to.
This action-based representation is significantly more compact; for instance, action sequences are 35.5% shorter than linearized logical forms on the GEO dataset. Shorter sequences are easier for RNNs to learn, mitigating vanishing gradient issues.
Neural Architecture and Constraints
The model employs a bidirectional RNN encoder with an attention-based decoder. A key innovation is the Action Embedding, which splits the representation into a structural part (the action type) and a semantic part (the specific KB entity or relation).
To ensure the model generates valid graphs, a Controller filters out illegal actions during decoding based on:
- Structural Constraints: Ensuring the graph remains connected and acyclic.
- Semantic Constraints: Using the KB schema to ensure relations have appropriate argument types (e.g., preventing a "border" relationship between a "city" and a "flight number").
Evaluation and Results
The framework was evaluated on three classic benchmarks: GEO (US geography), ATIS (airline reservations), and OVERNIGHT (multi-domain queries).
- State-of-the-Art: The model achieved a record average accuracy of 79.0% on the OVERNIGHT dataset.
- Competitive Performance: It performed comparably to top existing systems on GEO (88.9%) and ATIS (85.5%), without requiring hand-crafted lexicons.
- Constraint Impact: Adding semantic constraints consistently improved accuracy across all datasets, proving that the KB schema is a powerful signal for the decoder.
Conclusion
Sequence-to-Action demonstrates that generating structured graphs via action sequences is a robust alternative to string-based semantic parsing. By combining the end-to-end learning of RNNs with the structural rigor of graph-based methods, the model achieves high accuracy and efficiency. Future work will explore weakly supervised learning to reduce the need for expensive labeled data and interactive interfaces for easier graph annotation.
Summary updated