How Knowledge Graph and Attention Help? A Quantitative Analysis into Bag-level Relation Extraction

Zikun Hu, Yixin Cao, Lifu Huang, Tat-Seng Chua · DOI

Abstract

Knowledge Graph (KG) and attention mechanism have been demonstrated effective in introducing and selecting useful information for weakly supervised methods. However, only qualitative analysis and ablation study are provided as evidence. In this paper, we contribute a dataset and propose a paradigm to quantitatively evaluate the effect of attention and KG on bag-level relation extraction (RE). We find that (1) higher attention accuracy may lead to worse performance as it may harm the model's ability to extract entity mention features; (2) the performance of attention is largely influenced by various noise distribution patterns; (3) KG-enhanced attention indeed improves RE performance, while not through enhanced attention but by incorporating entity prior; and (4) attention mechanism may exacerbate the issue of insufficient training data. Based on these findings, we show that a straightforward variant of RE model (BRE+CE) can achieve significant improvements on real-world datasets.

Introduction

In Natural Language Processing (NLP), Distant Supervision is a common technique for training relation extraction models without manual labeling. By aligning a Knowledge Graph (KG)—e.g., "Paris is the capital of France"—with a corpus, any sentence containing "Paris" and "France" is assumed to express the "capital" relationship. However, this assumption introduces significant noise, as many such sentences may not explicitly describe the relation. To mitigate this, researchers typically employ Attention Mechanisms to select valid sentences within a "bag" and KG Embeddings to provide external context.

Despite their popularity, the actual mechanisms by which attention and KGs improve performance have remained largely unquantified. This paper provides a deep dive into these components, challenging common assumptions about their roles.

Methodology

The authors propose a new evaluation paradigm using a controlled environment with synthesized noise. This allows for precise measurement of attention accuracy and the impact of noise distribution patterns.

Datasets

  • BagRel-Wiki73K: A new benchmark derived from FewRel and Wikidata, designed for quantitative analysis. Every sentence has a ground-truth "valid/noise" label.
  • NYT-FB60K & GIDS-FB8K: Standard real-world datasets used for validation.
  • KG-73K: A Knowledge Graph constructed from Wikidata to provide entity priors.

The BRE+CE Model

The researchers introduced BRE+CE (BERT-based Relation Extraction + Concatenated Embeddings). This model avoids complex attention layers. Instead, it:

  1. Encodes sentences using BERT.
  2. Concatenates KG entity embeddings (TransE) directly to the sentence representation.
  3. Averages predictions across the bag.

Key Findings

The Attention Paradox

A counter-intuitive finding is that higher attention accuracy—the ability to pick the "correct" sentence—does not always improve performance. As shown in Figure 4, when the model is forced to put high weights on valid sentences, its performance on noisy bags (AUCN) can actually degrade. This suggests that models with high attention accuracy may become "lazy," over-relying on sentence context while ignoring essential entity features, making them less robust to noise.

The Attention Paradox: High attention weight on valid sentences (AUCV) can lead to a drop in robustness on noisy sentences (AUCN).

KGs as Entity Priors

The study reveals that KGs improve performance not by making attention "smarter," but by providing a strong "entity prior." In some tests, adding KG information actually decreased attention accuracy while increasing overall RE performance. The KG allows the model to make correct predictions even when sentence context is missing or misleading.

Data Sparsity and Noise Patterns

Attention mechanisms can exacerbate data sparsity issues by effectively discarding information from down-weighted sentences. Furthermore, the performance of attention is highly sensitive to noise distribution patterns, such as "disturbing bags" where all sentences are either valid or noisy.

Results

The simple BRE+CE model, which uses averaging instead of complex in-bag attention, achieved state-of-the-art results on real-world datasets. On NYT-FB60K, it reached an AUC of 0.630, significantly outperforming complex baselines like SeG (0.451) and RELE (0.497).

Precision-Recall curves on the NYT-FB60K dataset, showing the superior performance of the BRE+CE model.

On GIDS-FB8K, BRE+CE achieved an AUC of 0.917, proving its effectiveness across different data distributions.

Conclusion

This research demonstrates that simple concatenation of KG embeddings is highly effective for relation extraction, often outperforming complex attention-based models. The findings suggest that future work should focus on more robust ways to incorporate KG knowledge and develop attention mechanisms that can handle "disturbing bags" and low-data scenarios without sacrificing robustness.

Summary updated

Abstract

Knowledge Graph (KG) and attention mechanism have been demonstrated effective in introducing and selecting useful information for weakly supervised methods. However, only qualitative analysis and ablation study are provided as evidence. In this paper, we contribute a dataset and propose a paradigm to quantitatively evaluate the effect of attention and KG on bag-level relation extraction (RE). We find that (1) higher attention accuracy may lead to worse performance as it may harm the model's ability to extract entity mention features; (2) the performance of attention is largely influenced by various noise distribution patterns, which is closely related to real-world datasets; (3) KG-enhanced attention indeed improves RE performance, while not through enhanced attention but by incorporating entity prior; and (4) attention mechanism may exacerbate the issue of insufficient training data. Based on these findings, we show that a straightforward variant of RE model can achieve significant improvements (6% AUC on average) on two real-world datasets as compared with three state-of-the-art baselines. Our codes and datasets are available at https://github.com/zig-kwin-hu/how-KG-ATT-help.
BibTeX
@inproceedings{hu2021how,
  author = {Zikun Hu and Yixin Cao and Lifu Huang and Tat-Seng Chua},
  title = {{How Knowledge Graph and Attention Help? A Quantitative Analysis into Bag-level Relation Extraction}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2021},
  doi = {10.18653/v1/2021.acl-long.359},
}
Figure