Semantics as a Foreign Language

Gabriel Stanovsky, Ido Dagan

Abstract

Semantic Dependency Parsing (SDP) is typically treated as a specialized graph-parsing problem due to the complex nature of semantic representations, which often take the form of directed acyclic graphs (DAGs). This paper proposes a paradigm shift by reimagining SDP as a machine translation task. Through a novel, lossless graph linearization method and a multilingual neural machine translation (NMT) framework, the authors demonstrate that standard sequence-to-sequence models can achieve results competitive with or superior to state-of-the-art specialized parsers across multiple semantic formalisms.

Introduction: The Complexity of Semantic Graphs

Semantic Dependency Parsing aims to identify the underlying predicate-argument structure of a sentence—essentially determining "who did what to whom." Unlike syntactic dependency trees, semantic representations are frequently directed acyclic graphs (DAGs). These graphs allow for "reentrancy," where a single node has multiple parents (e.g., a subject shared by two verbs), and may contain non-connected components.

Comparison of DM, PAS, and PSD semantic dependency formalisms for a single sentence.

Traditionally, parsing these structures required complex, hand-engineered algorithms tailored to specific graph properties. Moreover, different linguistic traditions have produced various semantic formalisms, such as DELPH-IN MRS (DM), Enju Predicate-Argument Structures (PAS), and Prague Semantic Dependencies (PSD). Learning from these diverse datasets simultaneously is challenging for traditional parsers unless the data is perfectly parallel.

Methodology: Linearization and Translation

The authors address these challenges by converting graph parsing into a sequence-to-sequence problem.

Lossless Graph Linearization

To process graphs with a standard seq2seq model, they must first be "flattened" into a linear sequence. The authors utilize a Depth-First Search (DFS) traversal enhanced with three key mechanisms to ensure the process is deterministic and lossless:

  1. Artificial "SHIFT" Edges: To bridge disconnected components, hidden edges are added between consecutive words, ensuring the DFS can traverse the entire graph.
  2. Backtracking Edges: To represent reentrancy and cycles, the system encodes "BACK" tokens that point to previously visited nodes.
  3. Smaller-First Traversal: The order of neighbor visitation is optimized by prioritizing subgraphs with fewer nodes, which creates shorter dependencies for the neural model to learn.
Example of a linearized semantic sequence showing SHIFT and BACK tokens used to represent graph structure.

Multilingual Semantic Parsing

By treating DM, PAS, and PSD as different "target languages," the authors employ a shared encoder-decoder architecture. The model is trained on nine tasks simultaneously: primary parsing tasks (English to each formalism) and auxiliary translation tasks (e.g., DM to PSD). This multi-task approach forces the model to learn a robust, shared internal representation of semantics.

Datasets and Evaluation

The study utilizes the Broad-Coverage Semantic Dependency Parsing (SDP) corpus from SemEval 2015. This dataset contains over 30,000 sentences from the Wall Street Journal, annotated in parallel across the DM, PAS, and PSD formalisms.

Key Results and Insights

The proposed model achieved an average labeled F1 score of 86.2%, placing it within 1% of the specialized graph-parsing state-of-the-art (SOTA) at the time of publication. Notably, the model established a new SOTA on the PSD task, which is widely considered the most difficult of the three formalisms.

Key insights include:

  • Linearization as a Proxy: A deterministic, lossless linearization function allows simple seq2seq models to match the performance of complex graph-aware architectures.
  • Inter-representation Benefits: Teaching the model to translate between semantic formats significantly improves its ability to parse from raw text, suggesting that these formalisms share substantial underlying structural information.
  • Robustness: Unlike previous joint models, this MT-style approach is resilient even when training data for different formalisms is disjoint.

Conclusion and Future Work

While the model occasionally generates "illegal" sequences during inference—requiring deterministic overrides—it proves that "semantics as a foreign language" is a powerful and flexible framework. Future research may extend this approach to other graph-based structures like Universal Dependencies or Abstract Meaning Representation (AMR), potentially serving as a pre-processing step for downstream tasks like Question Answering.

Summary updated

BibTeX
@inproceedings{stanovsky2018semantics,
  author = {Gabriel Stanovsky and Ido Dagan},
  title = {{Semantics as a Foreign Language}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2018},
  doi = {10.18653/v1/d18-1263},
}
Figure