GCRE-GPT: A Generative Model for Comparative Relation Extraction

Yequan Wang, Hengran Zhang, Aixin Sun, Xuying Meng · DOI

Introduction

Comparative Relation Extraction (CRE) is the task of identifying which entities are being compared and the specific aspect of their comparison. For example, in the sentence "The D80 has better battery life than the D70," a model must extract the tuple: (D80, D70, battery life).

Traditionally, CRE is treated as a sequence labeling task. Existing pipelines typically identify individual elements (targets and aspects) first, then use a secondary step—often a Cartesian product—to pair them into relations. This "extract-then-combine" approach faces two major challenges:

  1. Combinatorial Explosion: Sentences with multiple entities can generate numerous incorrect permutations.
  2. Complexity in Long Text: In reviews where multiple distinct comparisons occur, the logic for linking elements becomes increasingly brittle.

Methodology: GCRE-GPT

The researchers propose GCRE-GPT, a model built on the GPT-2 architecture that frames CRE as a direct text generation problem. Instead of labeling sequences, the model "reads" the input and "writes" the relations directly.

Architecture of GCRE-GPT featuring an encoder with prompt words and a comparative-aware decoder with a filter layer.

The architecture introduces two primary innovations:

  • Encoder with Prompt Words: To guide the generation process, a "prompt span" ($t_p$) is injected at the end of the input sentence. This signals the model to transition from understanding the input to generating a specific output format.
  • Comparative Aware Decoder & Filter Layer: The model is trained to generate strings in the format t1 vs. t2 in a. To prevent "hallucinations"—where the model might generate words not present in the source—a Filter Layer is employed. This layer discards any generated relation if its elements do not exist in the original input sentence.

Datasets and Evaluation

GCRE-GPT was evaluated on two primary benchmarks:

  • CameraReview: A manually annotated dataset of camera reviews containing 1,279 comparative sentences and 1,780 relations. Notably, nearly 25% of these sentences contain more than one relation.
  • CompSent-08: A smaller dataset of 628 sentences containing both comparative and non-comparative text.

Key Results

GCRE-GPT outperformed strong baselines, including BERT-CRF and vanilla GPT-2, across both datasets.

Performance comparison of GCRE-GPT against baselines on CameraReview and CompSent-08 datasets.

On the CameraReview dataset, GCRE-GPT achieved an $F_1$ score of 0.368, surpassing the best BERT-based pipeline (0.345). The performance gap was even more significant on CompSent-08, where GCRE-GPT achieved an $F_1$ of 0.248, more than doubling the performance of the BERT-CRF baseline (0.110).

Handling Multi-Relation Sentences

A standout feature of GCRE-GPT is its robustness in complex scenarios. On sentences with two or more relations, GCRE-GPT maintained high precision (reported at 0.402), whereas traditional BERT-based models often saw their precision drop significantly (cratering to ~0.11 in some instances) due to the explosion of errors in the Cartesian product phase.

Conclusion and Future Work

By generating tuples as strings, GCRE-GPT implicitly learns the relationships between elements, bypassing the limitations of traditional pipeline architectures. While the model sets a new state-of-the-art, the authors note that future work could address "implicit comparisons" (e.g., "The iPhone 13 is the best") and explore continuous prompt optimization to further refine the generative process.

Summary updated

BibTeX
@misc{wang2023gcre,
  author = {Yequan Wang and Hengran Zhang and Aixin Sun and Xuying Meng},
  title = {{GCRE-GPT: A Generative Model for Comparative Relation Extraction}},
  year = {2023},
  eprint = {2303.08601},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2303.08601},
}
Figure