Contrastive Triple Extraction with Generative Transformer

Hongbin Ye, Ningyu Zhang, Shumin Deng, Mosha Chen, Chuanqi Tan, Fei Huang, Huajun Chen

Introduction

Triple extraction is a fundamental task in information extraction, aimed at transforming unstructured text into structured (subject, relation, object) triplets. While traditional pipeline methods suffer from error propagation between entity recognition and relation classification, recent joint models using encoder-decoder architectures have emerged. However, these models often rely on Recurrent Neural Networks (RNNs) which struggle with long-range dependencies and are prone to "hallucinating" triples not present in the source text.

Methodology

Researchers from Zhejiang University and Alibaba propose Contrastive Triple Extraction with Generative Transformer (CGT). Unlike standard encoder-decoder models, CGT utilizes a single shared Transformer architecture (based on UniLM) to perform both encoding and generation.

The CGT architecture featuring a shared Transformer for encoding and generation, alongside a Triplet Contrastive Learning module.

Key Innovations

  • Shared Transformer with Partial Causal Masking: By using a single model for both tasks, CGT maintains parameter efficiency. Partial causal masking allows the encoder to attend to the full input while the decoder generates triples token-by-token.
  • Triplet Contrastive Learning (TCL): To mitigate hallucinations, the model is trained to distinguish between "gold" triples and "corrupted" negative triples. This binary classification objective forces the model to verify the faithfulness of generated content.
  • Batch-wise Dynamic Attention Masking: This mechanism prevents label leakage during training by randomly assigning instances to either the generation or contrastive task within a single batch.
  • Triple-wise Calibration: During inference, the contrastive classifier scores each generated triple, filtering out low-confidence outputs to ensure high precision.

Experimental Evaluation

The model was rigorously tested on three benchmarks:

  • NYT (New York Times): A large-scale dataset with over 100,000 triples.
  • WebNLG: A dataset focused on natural language generation.
  • MIE (Medical Information Extraction): A challenging Chinese dialogue dataset.

Results and Discussion

CGT demonstrates significant improvements over previous state-of-the-art models. On the NYT dataset, it achieved a 10.2 F1 score improvement over PNDec and a 27.0 F1 improvement over CopyMTL. A critical finding is the model's robustness to sentence length.

F1 performance vs. sentence length across NYT, WebNLG, and MIE datasets, comparing CGT against baseline models like CopyRE and MIE-multi.

As shown in the evaluation across datasets, CGT maintains stable performance even as sentence length increases, whereas RNN-based models like CopyRE experience a sharp decline. Ablation studies further confirmed that the Triplet Contrastive Learning component is vital for maintaining high precision and reducing hallucinations.

Conclusion

CGT effectively addresses the dual challenges of long-term dependencies and unfaithfulness in generative triple extraction. By leveraging a shared Transformer and a contrastive learning objective, the model achieves superior performance and robustness. Future work will explore document-level extraction using architectures like Longformer and the integration of formal knowledge ontologies.

Summary updated

BibTeX
@inproceedings{ye2021contrastive,
  author = {Hongbin Ye and Ningyu Zhang and Shumin Deng and Mosha Chen and Chuanqi Tan and Fei Huang and Huajun Chen},
  title = {{Contrastive Triple Extraction with Generative Transformer}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2021},
  doi = {10.1609/aaai.v35i16.17677},
}
Figure