CPTuning: Contrastive Prompt Tuning for Generative Relation Extraction

Jiaxin Duan, Fengyu Lu, Junfei Liu
1/4/2025
cs.CLcs.AI

No confident code implementation found for this paper.

Abstract

Generative relation extraction (RE) commonly involves first reformulating RE as a linguistic modeling problem easily tackled with pre-trained language models (PLM) and then fine-tuning a PLM with supervised cross-entropy loss. Although having achieved promising performance, existing approaches assume only one deterministic relation between each pair of entities without considering real scenarios where multiple relations may be valid, i.e., entity pair overlap, causing their limited applications. To address this problem, we introduce a novel contrastive prompt tuning method for RE, CPTuning, which learns to associate a candidate relation between two in-context entities with a probability mass above or below a threshold, corresponding to whether the relation exists. Beyond learning schema, CPTuning also organizes RE as a verbalized relation generation task and uses Trie-constrained decoding to ensure a model generates valid relations. It adaptively picks out the generated candidate relations with a high estimated likelihood in inference, thereby achieving multi-relation extraction. We conduct extensive experiments on four widely used datasets to validate our method. Results show that T5-large fine-tuned with CPTuning significantly outperforms previous methods, regardless of single or multiple relations extraction.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{duan2025cptuning,
  title  = {CPTuning: Contrastive Prompt Tuning for Generative Relation Extraction},
  author = {Jiaxin Duan and Fengyu Lu and Junfei Liu},
  year   = {2025},
  eprint = {2501.02196},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2501.02196v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2501.02196.svg)](https://codeofpaper.com/paper/2501.02196)

Discussion