NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Generative Prompt Tuning for Relation Classification

Jiale Han, Shuai Zhao, Bo Cheng, Shengkun Ma, Wei Lu

Introduction

Relation Classification (RC) is a fundamental task in Information Extraction, requiring models to identify the semantic relationship between two entities within a sentence. For instance, given the sentence "Christina is the WN Opera's director," a model must determine that the relationship between "Christina" and "WN Opera" is org:top_members/employees.

Recent advancements in adapting Pre-trained Language Models (PLMs) have centered on "prompt tuning." Most existing methods utilize a Masked Language Modeling (MLM) objective, reformulating RC as a "cloze" test (e.g., "The relation is [MASK]"). However, this approach typically restricts the model to mapping labels to single tokens. This "rigid prompt restriction" is problematic for RC, where labels are often semantically complex and multi-word (e.g., per:alternate_names). Forcing these into a single-token verbalizer discards significant semantic information and prevents models from fully leveraging their pre-trained knowledge.

Methodology: From MLM to Text Infilling

To overcome these limitations, we introduce GenPT (Generative Prompt Tuning). GenPT shifts the paradigm from rigid MLM to a more flexible Text Infilling objective, mirroring the pre-training of generative models like T5 and BART.

Comparison of MLM, Text Infilling, and the proposed Generative Prompt Tuning (GenPT) architecture.

Core Components of GenPT

  1. Text Infilling Reformulation: Instead of predicting a single [MASK] token, GenPT generates spans of arbitrary length. This allows the model to produce the full, natural language name of a relation label.
  2. Entity-Oriented Continuous Prompts: Rather than relying on handcrafted text, the system uses learnable "continuous" embeddings as prompt templates. These templates include specific placeholders for the head entity, tail entity, and the target relation.
  3. Entity-Guided Decoding: To optimize inference, the model utilizes known entity types (e.g., "organization" and "person") as a preamble. This guides the autoregressive decoder, effectively pruning the search space to only those relations that are semantically plausible for the given entity types.
  4. Discriminative Relation Scoring: To convert generative output into a classification score, we calculate the probability of each possible relation verbalization, normalized by its length. This ensures a fair comparison between labels of varying lengths, such as "founder" versus "top members or employees."

Experimental Results

GenPT was evaluated on four major RC benchmarks: TACRED, TACREV, Re-TACRED, and Wiki80. The model was tested in both fully supervised and low-resource (few-shot) settings.

State-of-the-Art Performance

GenPT achieved new state-of-the-art (SOTA) results on the TACRED and TACREV benchmarks. Notably, on TACRED, GenPT outperformed the previous leading generative model, TANL, by 3.2 F1 points. The model's ability to leverage the full semantic name of a relation proved to be a significantly stronger signal than the arbitrary numeric IDs or shortened labels used in traditional discriminative approaches.

Low-Resource Dominance

The most striking gains were observed in few-shot scenarios. In an 8-shot setting (only 8 examples per class), GenPT (using RoBERTa) achieved an F1 score of 35.7 on TACRED, vastly outperforming the standard SpanBERT baseline, which scored only 8.4.

Performance comparison on TACREV across high, mid, and low data regimes, highlighting GenPT's superiority in low-resource settings.

As shown in the figure above, while GenPT maintains a competitive edge in high-resource settings, its advantage becomes increasingly pronounced as training data decreases. This suggests that the generative approach is far more efficient at extracting utility from limited supervision by relying on the semantic priors of the relation labels.

Conclusion and Future Work

GenPT demonstrates that reformulating Relation Classification as a generative text-infilling task allows models to "breathe," utilizing the full semantic richness of relation labels and entity types. While the autoregressive nature of the model introduces a trade-off in inference speed compared to simple discriminative heads, the gains in accuracy—particularly for rare relations and low-data regimes—are substantial. Future research will focus on optimizing inference efficiency and extending this generative framework to other complex tasks with large, structured label spaces.

Summary updated

BibTeX
@inproceedings{han2022generative,
  author = {Jiale Han and Shuai Zhao and Bo Cheng and Shengkun Ma and Wei Lu},
  title = {{Generative Prompt Tuning for Relation Classification}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2022},
  doi = {10.18653/v1/2022.findings-emnlp.231},
}
Figure