Papers › RelationPrompt: Leveraging Prompts to Generate Synthetic Data for Zero-Shot Relation...

RelationPrompt: Leveraging Prompts to Generate Synthetic Data for Zero-Shot Relation Triplet Extraction

17 Mar 2022Findings (ACL) 2022 5arXiv:2203.09101archive 2025-07-28

Yew Ken Chia, Lidong Bing, Soujanya Poria, Luo Si

Despite the importance of relation extraction in building and representing knowledge, less research is focused on generalizing to unseen relations types. We introduce the task setting of Zero-Shot Relation Triplet Extraction (ZeroRTE) to encourage further research in low-resource relation extraction methods. Given an input sentence, each extracted triplet consists of the head entity, relation label, and tail entity where the relation label is not seen at the training stage. To solve ZeroRTE, we propose to synthesize relation examples by prompting language models to generate structured texts. Concretely, we unify language model prompts and structured text approaches to design a structured prompt template for generating synthetic relation samples when conditioning on relation label prompts (RelationPrompt). To overcome the limitation for extracting multiple relation triplets in a sentence, we design a novel Triplet Search Decoding method. Experiments on FewRel and Wiki-ZSL datasets show the efficacy of RelationPrompt for the ZeroRTE task and zero-shot relation classification. Our code and data are available at github.com/declare-lab/RelationPrompt.

PaperPDFConference PDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2203.09101")

Code

Syntology Ran 15 of 26 code samples harvested from 2 repositories linked to this paper; 11 have no recorded run. Of those that ran: 4 ran · honoured contract; 3 ran · our draft was wrong; 5 ran · fixture could not drive it; 3 ran with no contract checked.

By repository: official repository: 10 samples from 1 repository, 4 ran; community (archive-listed): 16 samples from 1 repository, 11 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

declare-lab/relationprompt officialmentioned in papermentioned on GitHubpytorchMIT report
declare-lab/hyperred mentioned on GitHubpytorch report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

26 samples harvested; 15 ran; 4 honoured the contract we drafted; 11 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

4ran · honoured contract
3ran · our draft was wrong
5ran · fixture could not drive it
3ran
11unverified

Licence: 16 of the 26 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from 2 repositories linked to this paper, official or community; each sample names its own and says which. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

RelationSentence declare-lab/RelationPrompt/generation.py official repository ran MIT (permissive) · 1bf96a550bc9db35 · report
align_span_to_tokens declare-lab/RelationPrompt/generation.py official repository ran · honoured contract MIT (permissive) · 46b3836cd0547e98 · report
find_span declare-lab/RelationPrompt/generation.py official repository ran · honoured contract fingerprinted MIT (permissive) · 48a2b26807165ecf · report
find_sublist_index declare-lab/RelationPrompt/generation.py official repository ran · fixture could not drive it fingerprinted MIT (permissive) · 97a3eca137c3440e · report
DynamicModel declare-lab/RelationPrompt/generation.py official repository unverified MIT (permissive) · 1f6ddb84b665fb98 · report
Encoder declare-lab/RelationPrompt/generation.py official repository unverified MIT (permissive) · b4e5d615275044cf · report
ExtractEncoder declare-lab/RelationPrompt/generation.py official repository unverified MIT (permissive) · 43f13b65e230563d · report
LabelConstraint declare-lab/RelationPrompt/generation.py official repository unverified MIT (permissive) · ea519177ab88447d · report
TextGenerator declare-lab/RelationPrompt/generation.py official repository unverified MIT (permissive) · c5312c4d166f9950 · report
TripletSearchDecoder declare-lab/RelationPrompt/generation.py official repository unverified MIT (permissive) · 1ad6a72afada7941 · report
BertLayerNorm declare-lab/hyperred/modeling.py community (archive-listed) ran · metamorphic tier: invariant no licence file found · pointer only · f24a08472067dcf7 · report
BertLinear declare-lab/hyperred/modeling.py community (archive-listed) ran · metamorphic tier: invariant fingerprinted no licence file found · pointer only · 28a82cb66563a20d · report
batched_index_select declare-lab/hyperred/modeling.py community (archive-listed) ran · our draft was wrong no licence file found · pointer only · 8e14a5ff3ee5597f · report
check_adjacent declare-lab/hyperred/modeling.py community (archive-listed) ran · fixture could not drive it no licence file found · pointer only · eb611ef75d9aa110 · report
decode_nonzero_cuboids declare-lab/hyperred/modeling.py community (archive-listed) ran · fixture could not drive it no licence file found · pointer only · 4c70a6becf27ff53 · report
flatten_and_batch_shift_indices declare-lab/hyperred/modeling.py community (archive-listed) ran · our draft was wrong no licence file found · pointer only · 27e54a4cbd7d001d · report
gelu declare-lab/hyperred/modeling.py community (archive-listed) ran · honoured contract fingerprinted no licence file found · pointer only · e650dcdf9e8a559f · report
get_device_of declare-lab/hyperred/modeling.py community (archive-listed) ran · our draft was wrong fingerprinted no licence file found · pointer only · 5ea35802d5e71352 · report
get_range_vector declare-lab/hyperred/modeling.py community (archive-listed) ran · honoured contract no licence file found · pointer only · 2b70d9c14170a263 · report
prune_matrix declare-lab/hyperred/modeling.py community (archive-listed) ran · fixture could not drive it no licence file found · pointer only · 439cdde1774200fe · report
update_bounds declare-lab/hyperred/modeling.py community (archive-listed) ran · fixture could not drive it no licence file found · pointer only · d61d313e081aa624 · report
BertEmbedModel declare-lab/hyperred/modeling.py community (archive-listed) unverified no licence file found · pointer only · 4534173317cad377 · report
BertEncoder declare-lab/hyperred/modeling.py community (archive-listed) unverified no licence file found · pointer only · e3af493846de2812 · report
CubeRE declare-lab/hyperred/modeling.py community (archive-listed) unverified no licence file found · pointer only · 2e36d81e1a7ea466 · report
PretrainedEmbedModel declare-lab/hyperred/modeling.py community (archive-listed) unverified no licence file found · pointer only · dc5e765561b30b13 · report
PretrainedEncoder declare-lab/hyperred/modeling.py community (archive-listed) unverified no licence file found · pointer only · ee228a910e7ecb91 · report

Tasks

Language ModelingLanguage ModellingRelation ClassificationRelation ExtractionSentenceZero-shot Relation ClassificationZero-shot Relation Triplet Extraction

2 archive task tags without a task page not shown.

Results from the paper archive 2025-07-28

TaskDatasetModelMetricValueRank at snapshotLeaderboardReport
Zero-shot Relation Triplet Extraction FewRel RelationPrompt Avg. F1 24.61 #2 of 3 Archive leaderboard report
Zero-shot Relation Triplet Extraction Wiki-ZSL RelationPrompt Avg. F1 31.19 #1 of 2 Archive leaderboard report

Ranks are positions in the archive's leaderboards as they stood at the 2025-07-28 snapshot. Results published since then are not among these rows, so a rank here is not a current standing.

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections