Open Set Relation Extraction via Unknown-Aware Training

Jun Zhao, Xin Zhao, WenYu Zhan, Qi Zhang, Tao Gui, Zhongyu Wei, Yun Wen Chen, Xiang Gao, Xuanjing Huang

Abstract

Standard relation extraction (RE) models typically operate under a closed-set assumption, where all test-time relations are assumed to belong to a predefined set of training categories. In real-world scenarios, however, models frequently encounter "unknown" relations, often leading to overconfident misclassifications. This paper presents an unknown-aware training framework that dynamically synthesizes challenging negative examples to regularize decision boundaries. By combining linguistic rules with gradient-based attribution, the method generates "hard" negatives that teach the model to distinguish between known relations and out-of-distribution instances. Experimental results on FewRel and TACRED benchmarks demonstrate that this approach significantly improves "None-Of-The-Above" (NOTA) detection without compromising performance on known relations.

Introduction

Relation Extraction (RE) is a fundamental task in information extraction, identifying semantic connections between entities in text. While deep learning has advanced RE significantly, most existing models struggle with the "open-set" nature of real-world data. When presented with a relation not seen during training, standard models tend to assign it to a known category with high confidence—a phenomenon known as being "confidently wrong."

The core challenge lies in defining the boundaries of "known" space. Without exposure to negative or unknown examples during training, the model's decision regions expand to fill the entire feature space. To address this, we need a way to model the "None-Of-The-Above" (NOTA) category effectively.

Conceptual comparison of standard closed-set classification (left) vs. the proposed unknown-aware approach with synthesized negative data (right).

Methodology

The proposed framework utilizes a two-step iterative training loop designed to refine decision boundaries by introducing synthesized "hard" negative instances.

1. The Synthesis Step

To provide a strong supervision signal for the NOTA category, the model generates difficult negative examples. Unlike random noise, which is easily distinguished, these "hard negatives" are designed to trick the model.

  • Key Token Identification: The system identifies tokens most responsible for a relation's classification using gradient-based attribution and linguistic features (TF-IDF and dependency paths).
  • Token Substitution: These key tokens are replaced with misleading alternatives that maintain the sentence structure but alter or obscure the original relational meaning.

2. The Learning Step

The model is trained with a dual-objective loss function:

  • Relation Classification ($\mathcal{L}_{cls}$): A standard cross-entropy loss ensures high accuracy on known relations.
  • NOTA Detection ($\mathcal{L}_{NOTA}$): The model employs a free energy-based scoring function. Energy scores, derived from the model's logits, provide a more robust measure of "out-of-distribution" status than standard softmax probabilities. By minimizing energy for known instances and maximizing it for synthesized negatives, the model learns compact decision boundaries.
The two-step iterative process: (1) Synthesis Step using linguistic rules and gradient analysis, and (2) Learning Step with dual tasks for classification and NOTA detection.

Experimental Setup

The method was evaluated on two major benchmarks adapted for open-set evaluation:

  • FewRel: 80 relations total; 40 used for training, 20 for validation, and 20 held out as "unknowns" for testing.
  • TACRED: 41 relations; the top 21 were treated as known, while the remaining 20 served as unknowns.

Crucially, the "unknown" relations used in the final evaluation were completely withheld during the training and validation phases to simulate a true open-set environment.

Results and Discussion

The "Unknown-Aware" approach consistently outperformed baselines, including MixUp and GAN-based synthesis methods.

  • Detection Performance: The model achieved an Area Under the Receiver Operating Characteristic (AUROC) of 88.73% on FewRel and 91.02% on TACRED.
  • Error Reduction: At a 95% true positive rate for known relations, the model only misclassified unknowns as knowns 30.27% of the time on TACRED, a significant improvement over the ~43% baseline.
  • Stability: Importantly, the focus on unknown detection did not degrade the model's ability to classify known relations, maintaining high accuracy across the board.

Conclusion

By integrating linguistic insights with gradient analysis, this work demonstrates that synthesizing "hard" negatives is a powerful strategy for open-set relation extraction. The use of energy-based scores further enhances the model's ability to flag unknown relations. Future work will explore dynamic substitution ratios and methods to handle relations expressed implicitly through context rather than explicit key tokens.

Summary updated

BibTeX
@inproceedings{zhao2023open,
  author = {Jun Zhao and Xin Zhao and WenYu Zhan and Qi Zhang and Tao Gui and Zhongyu Wei and Yun Wen Chen and Xiang Gao and Xuanjing Huang},
  title = {{Open Set Relation Extraction via Unknown-Aware Training}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2023},
  doi = {10.18653/v1/2023.acl-long.525},
}
Figure