A Multi-label Multi-hop Relation Detection Model based on Relation-aware Sequence Generation

Linhai Zhang, Deyu Zhou, Chao Lin, Yulan He

Presented at EMNLP 2021, this research introduces a novel approach to Knowledge Base Question Answering (KBQA) by reframing relation detection as a sequence generation problem. The proposed model, the Relation-aware Sequence Generation Model (RSGM), treats multi-hop relation detection as a multi-label sequence generation task, allowing for more flexible and accurate pathfinding in complex knowledge graphs.

The Challenge: Multi-hop and Multi-label Complexity

In KBQA, relation detection is the critical process of finding the path from a topic entity (e.g., a person) to the answer node (e.g., a city) within a massive graph like Freebase. Most existing methods face two major hurdles:

  1. The Multi-hop Challenge: Many questions require traversing multiple edges (hops) in the graph. Traditional models often struggle when the number of hops is unknown or exceeds two.
  2. The Multi-label Challenge: Complex questions often have multiple valid paths to the same answer. For example, the question "Which city hosted the 1900 Olympics?" might be answered via a time/event path or an olympic/host_city path.

Most current systems treat this as a single-label classification task, aiming to find the "one best path." This paper argues that a robust system should be able to identify all valid paths to improve accuracy and reliability.

The RSGM Architecture

The authors introduce the Relation-aware Sequence Generation Model (RSGM). Instead of classifying a question into a fixed set of relations, they formulate the output as a sequence of tokens. This allows the model to handle an arbitrary number of paths and hops by generating a sequence like {path_1, [SEP], path_2, [END]}.

The RSGM architecture featuring a BERT-based encoder and a GRU-based decoder with relation-aware attention.

Key Components:

  • Encoder: A pre-trained BERT model creates context-aware representations of the question tokens.
  • Decoder: A Gated Recurrent Unit (GRU) generates the relation tokens one by one.
  • Relation-aware Attention: The decoder uses a specific attention mechanism that allows it to "look back" at the question tokens. This helps the model focus on specific words (like "Pierce Brosnan" vs. "007") when predicting different parts of a relation path.
  • Constraint-Learning Strategy: To prevent the model from getting stuck in loops or repeating the same path, the authors implement a constraint during beam search that adds an infinite penalty to any relation path that has already been generated.

Datasets and Evaluation

The model was evaluated on FreebaseQA, a large-scale KBQA dataset. Unlike older datasets, FreebaseQA contains linguistically sophisticated questions that often map to multiple multi-hop paths in the Freebase knowledge graph. The dataset consists of 20,358 training instances, 3,994 development instances, and 3,996 test instances.

Key Results

The RSGM model significantly outperformed several strong baselines, including CNNs, Hierarchical Attention Networks (HAN), and a BERT-enhanced version of the Sequence Generation Model (SGM-BERT).

Comparison of RSGM against baseline methods on the FreebaseQA test set.

On the FreebaseQA test set, RSGM achieved a Micro F1 score of 0.5945, a substantial jump over SGM-BERT (0.5056). When tested on the full end-to-end question-answering task, RSGM achieved an accuracy of 38.1%, surpassing the previous state-of-the-art model, FOFE-net (37.0%).

Insights and Interpretability

One of the most significant "aha moments" of this research is treating a set of paths as a single sequence. This elegantly solves the problem of not knowing how many labels (paths) or hops (steps) are required for a given question. Furthermore, by treating relations as sequences of words (e.g., film/actor/film), RSGM leverages semantic meaning, helping it handle "zero-shot" scenarios where it encounters rare relations.

Visualization of the attention weights confirmed that the model correctly shifts its focus to different parts of the question when generating different relation paths, proving that the relation-aware attention mechanism effectively captures the necessary context for complex queries.

Limitations and Future Work

While RSGM represents a significant step forward, some challenges remain. The final QA performance is still heavily dependent on the quality of the initial entity linking step. Additionally, like all sequence-to-sequence models, RSGM may suffer from exposure bias where errors accumulate during generation. Future work may involve exploring more efficient architectures to reduce the computational overhead of using BERT and GRU decoders for real-time applications.

Summary updated

BibTeX
@inproceedings{zhang2021multi,
  author = {Linhai Zhang and Deyu Zhou and Chao Lin and Yulan He},
  title = {{A Multi-label Multi-hop Relation Detection Model based on Relation-aware Sequence Generation}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2021},
  doi = {10.18653/v1/2021.findings-emnlp.404},
}
Figure