Relation Extraction as Open-book Examination: Retrieval-enhanced Prompt Tuning

Xiang Chen, Lei Li, Ningyu Zhang, Chuanqi Tan, Fei Huang +2 more
5/4/2022
cs.CLcs.AIcs.IR
lora-peft-merging

Official code: zjunlp/PromptKG (736 stars, Python, MIT, PyTorch, last commit 2024-03-22).

Abstract

Pre-trained language models have contributed significantly to relation extraction by demonstrating remarkable few-shot learning abilities. However, prompt tuning methods for relation extraction may still fail to generalize to those rare or hard patterns.

Show full abstract

Note that the previous parametric learning paradigm can be viewed as memorization regarding training data as a book and inference as the close-book test. Those long-tailed or hard patterns can hardly be memorized in parameters given few-shot instances. To this end, we regard RE as an open-book examination and propose a new semiparametric paradigm of retrieval-enhanced prompt tuning for relation extraction. We construct an open-book datastore for retrieval regarding prompt-based instance representations and corresponding relation labels as memorized key-value pairs. During inference, the model can infer relations by linearly interpolating the base output of PLM with the non-parametric nearest neighbor distribution over the datastore. In this way, our model not only infers relation through knowledge stored in the weights during training but also assists decision-making by unwinding and querying examples in the open-book datastore. Extensive experiments on benchmark datasets show that our method can achieve state-of-the-art in both standard supervised and few-shot settings. Code are available in https://github.com/zjunlp/PromptKG/tree/main/research/RetrievalRE.

View on arXivView PDF

Code Implementations(1)

zjunlp/PromptKGOfficial100%
PyTorchMIT

PromptKG Family: a Gallery of Prompt Learning & KG-related research works, toolkits, and paper-list.

73676Python, ShellDec 18, 20212 years agoMIT
awsome-listdemo-tuningdialoguegenkgcknowledge-graph+15 more

Similar Papers

Cite this paper

@article{chen2022relation,
  title  = {Relation Extraction as Open-book Examination: Retrieval-enhanced Prompt Tuning},
  author = {Xiang Chen and Lei Li and Ningyu Zhang and Chuanqi Tan and Fei Huang and Luo Si and Huajun Chen},
  year   = {2022},
  eprint = {2205.02355},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2205.02355}
}

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/2205.02355.svg)](https://codeofpaper.com/paper/2205.02355)

Discussion