Compositional Generalization in Multilingual Semantic Parsing over Wikidata

Ruixiang Cui, Rahul Aralikatte, Heather C. Lent, Daniel Hershcovich · OpenReview

Abstract

Semantic parsing (SP) allows humans to leverage vast knowledge resources through natural interaction. However, parsers are mostly designed for and evaluated on English resources, such as CFQ, the current standard benchmark based on English data generated from grammar rules and oriented towards Freebase, an outdated knowledge base. We propose a method for creating a multilingual, parallel dataset of question-query pairs, grounded in Wikidata. We introduce such a dataset, which we call Multilingual Compositional Wikidata Questions (MCWQ), and use it to analyze the compositional generalization of semantic parsers in Hebrew, Kannada, Chinese and English. While within-language generalization is comparable across languages, experiments on zero-shot cross-lingual transfer demonstrate that cross-lingual compositional generalization fails, even with state-of-the-art pretrained multilingual encoders. Furthermore, our methodology, dataset and results will facilitate future research on SP in more realistic and diverse settings than has been possible with existing resources.

Introduction: The Challenge of Compositional Generalization

Semantic parsing is the critical task of converting natural language (e.g., "Who did Lohengrin's actor marry?") into machine-readable code, such as a SPARQL query. For these systems to be truly effective, they must exhibit compositional generalization—the ability to interpret and execute novel combinations of known concepts. For instance, if a model understands the components of "who directed X" and "who acted in Y," it should logically be able to parse "who directed a movie that Y acted in," even if that specific query was never encountered during training.

Historically, the CFQ (Compositional Freebase Questions) dataset has served as the gold standard for evaluating this capability. However, CFQ is limited by being English-only and grounded in Freebase, a knowledge base that has been defunct for years. This research introduces MCWQ (Multilingual Compositional Wikidata Questions) to address these limitations, providing a modern, multilingual benchmark for testing semantic parsers across typologically diverse languages like Hebrew, Kannada, and Chinese.

Methodology: Building a Modern Multilingual Benchmark

The researchers developed a sophisticated pipeline to migrate the logical structure of CFQ into the contemporary Wikidata ecosystem. This process involved several key stages:

  1. Property Mapping: Outdated Freebase properties were mapped to modern Wikidata "P-codes" (e.g., mapping a gender property to P21).
  2. Entity Substitution: Original Freebase entities were replaced with valid Wikidata "Q-codes," ensuring that the resulting SPARQL queries return actual data from the live knowledge base.
  3. Multilingual Expansion: The English questions were translated into Hebrew, Kannada, and Chinese using Google Cloud Translation.
  4. Validation: To ensure the synthetic data remained fluent and accurate, the team created a "Gold Test Set" manually translated by native speakers, allowing them to verify the quality of the machine-translated corpus.

Dataset Characteristics

The resulting MCWQ dataset contains 124,187 question-query pairs across four languages. To test generalization, the authors utilized "Maximum Compound Divergence" (MCD) splits. These splits are intentionally designed to be difficult: the test set contains logical combinations (compounds) that are absent from the training set, even though the individual components (atoms) are present.

A comparison of the question complexity distributions between the original CFQ dataset and the new MCWQ dataset.

As shown in the complexity distribution analysis, MCWQ is a "leaner" and more rigorous dataset than CFQ. It features less redundancy and a higher variety of unique query patterns, making it a more challenging benchmark for modern AI models.

Key Results and the "Cross-Lingual Wall"

The study evaluated several sequence-to-sequence architectures, including mBERT and mT5. The results revealed a stark contrast between monolingual success and cross-lingual failure.

Monolingual Performance

On the challenging MCD splits, the best-performing model (mT5-base) achieved mean accuracies between 29.6% and 38.3% across the four languages. While this indicates that models can learn to generalize compositionally within a single language, it leaves significant room for improvement compared to non-compositional tasks where accuracy often nears 100%.

The performance (quantity of correct parses) of the mT5-base model across English (En), Hebrew (He), Kannada (Kn), and Chinese (Zh) as a function of question complexity.

The Failure of Zero-Shot Transfer

The most significant finding is the near-total failure of zero-shot cross-lingual transfer. When a model was trained on English logic and then tested on another language (e.g., Hebrew) without additional training, exact match accuracy plummeted to between 0.2% and 1.5%. This suggests that while current multilingual embeddings like those in mT5 are excellent at capturing surface-level semantics, they struggle to transfer deep, structural logical patterns across language boundaries.

Interestingly, the researchers noted that translation might act as a form of regularization. In some instances, models performed slightly better on high-complexity questions in non-English languages, suggesting that the translation process might help the parser focus on structural patterns rather than idiosyncratic word choices.

Limitations and Future Directions

While MCWQ represents a major step forward, it remains a rule-based dataset. This allows for precise control over logical complexity but can result in questions that feel less "natural" than human-authored speech. Additionally, the current dataset is primarily focused on the cinematography domain.

Future research will aim to move beyond rule-based templates toward "native" multilingual questions sourced directly from human speakers. Understanding why state-of-the-art models fail to bridge the cross-lingual logical gap remains a primary challenge for the development of truly global, multilingual AI assistants.

Summary updated

BibTeX
@article{cui2021compositional,
  author = {Ruixiang Cui and Rahul Aralikatte and Heather C. Lent and Daniel Hershcovich},
  title = {{Compositional Generalization in Multilingual Semantic Parsing over Wikidata}},
  journal = {Trans. Assoc. Comput. Linguistics},
  year = {2021},
  url = {https://openreview.net/forum?id=mSEbxxZSwh_},
}
Figure