Relation Extraction as Two-way Span-Prediction

Amir David Nissan Cohen, Shachar Rosenman, Yoav GoldbergarXiv 2020

Abstract

Traditional Relation Classification (RC) models often rely on shallow heuristics, such as entity types, rather than a deep semantic understanding of the context. This paper proposes a paradigm shift by reframing RC as a "two-way span-prediction" task. By treating the problem as a Question Answering (QA) challenge—where the model must locate one entity given the other and a relation-based query—the proposed method achieves state-of-the-art results on major benchmarks like TACRED and SemEval, while demonstrating significantly improved robustness against common dataset biases.

Introduction

In standard Relation Classification, a model is presented with a sentence and two marked entities (e.g., "John" and "1976") and tasked with selecting the correct relationship from a predefined list (e.g., per:date_of_death). The authors argue that this "classification-view" is fundamentally flawed. Models often compress the entire relationship into a single vector embedding, losing nuanced semantic links. Furthermore, this setup allows models to "cheat" by relying on entity-type correlations (e.g., guessing a date-related relation simply because one entity is a "Date") rather than processing the actual context.

Methodology: From Classification to Span-Prediction

The core innovation of this work is the reduction of RC to a Span-Prediction (SP) task. Instead of classifying a pair, the model is asked to find a specific "span" in the text that answers a natural language question derived from the relation.

Two-Way (Bidirectional) Queries

For every potential relation, the system generates two directional questions. For example, for the relation died_at and entities $e_1$ (John) and $e_2$ (October 1976), the model processes:

  1. Query 1: "When did [John] die?" (Targeting $e_2$)
  2. Query 2: "Who died in [October 1976]?" (Targeting $e_1$)
Comparison between traditional classification-based RC and the proposed two-way span-prediction approach.

Training and Inference

Unlike previous zero-shot QA approaches, this model is trained directly on converted RC datasets using natural language templates. At inference time, the model employs "OR" logic: a relation is considered present if either of the two directional questions successfully returns a span that matches the expected entity. This bidirectional approach provides a critical performance boost, as some relations are easier to identify from one direction than the other.

Key Insights

  • Attention Specialization: By including the relation and one entity in the input query, the transformer backbone (such as BERT or ALBERT) can use its self-attention mechanism to specialize on that specific relation from the very first layer.
  • Harder Training Objective: Span prediction is a more demanding task than N-way classification. The model must identify exact start and end indices, forcing it to learn more robust features and reducing its reliance on shallow heuristics.
  • Semantic Sharing: Natural language prompts allow the model to share knowledge across different relations that involve similar entity types, improving generalization.

Experimental Results

The span-prediction approach consistently outperformed traditional embedding-based classifiers across several key datasets:

  • TACRED: Achieved a new state-of-the-art $F_1$ score, surpassing previous top models like KEPLER by 2.3 points when using an ALBERT backbone.
  • SemEval 2010 Task 8: Improved the state-of-the-art by 0.9 $F_1$ points.
  • Challenge Relation Extraction (CRE): On this dataset specifically designed to expose shallow heuristics, the span-prediction model showed massive improvements, proving its superior semantic understanding.
  • Ablation Study: Removing the bidirectional component led to a 2.4% drop in $F_1$, confirming that the "two-way" perspective is vital for accuracy.

Conclusion and Future Work

Reframing relation extraction as a span-prediction task addresses the inherent weaknesses of the classification-view. While the method introduces a moderate computational cost—requiring separate forward passes for different potential relations—the gains in accuracy and robustness are substantial. Future research will likely focus on optimizing inference efficiency to make this high-performance approach more practical for large-scale production environments.

Summary updated

BibTeX
@misc{cohen2020relation,
  author = {Amir David Nissan Cohen and Shachar Rosenman and Yoav Goldberg},
  title = {{Relation Extraction as Two-way Span-Prediction}},
  year = {2020},
  eprint = {2010.04829},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2010.04829},
}
Figure