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 ranMethod as code

In Syntology View this paper on Syntology, its page in Syntology's graph. That page adds which of its functions are also present in other papers' code Syntology holds, with dates, and its dated run record as JSON and a README badge. It also lists the repositories linked to the paper, the abstract and the calls for agents.

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

For agents, on Syntology's MCP service (how to connect):

Code

Syntology 26 code samples harvested from 2 repositories linked to this paper: 15 ran (of which 1 constructed an object rather than computing a result; 7 with no instrument failure: 4 honoured, 0 violated, 3 with no contract checked; 8 where Syntology's instrument failed) · 11 unverified. Where Syntology's instrument failed: 3 where our contract draft was wrong; 5 where the contract check could not run; failures of Syntology's instrument, not of the code.

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

Levels written between 2026-09-22 and 2026-09-24 (UTC): the dates Syntology's graph wrote each sample's verification level, not when the code executed.

declare-lab/relationprompt officialmentioned in papermentioned on GitHubpytorchMITSyntology: 10 samples, 4 ran (1 instrument-failed) · 6 unverified report
declare-lab/hyperred mentioned on GitHubpytorchSyntology: 16 samples, 11 ran (7 instrument-failed) · 5 unverified 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 (of which 1 constructed an object rather than computing a result; 7 with no instrument failure: 4 honoured, 0 violated, 3 with no contract checked; 8 where Syntology's instrument failed) · 11 unverified. “Where Syntology's instrument failed” counts failures of Syntology's instrument, not of the code. Syntology's record for this page has not changed since , the first build that kept a record date for it; when this build read Syntology's graph is in the build record. That date is not when the samples ran.

4ran · honoured contract
3ran · our draft was wrong
5ran; the contract check could not run
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; the list below is grouped by repository, each group headed by its name and what it is to the paper. “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. A line beginning “fixture:” under a sample that ran gives the arguments Syntology's fixture called the sample with, each as name:type/rank/element kind (? where none was recorded), and the type of what the fixture's run returned, exactly as the harness recorded them; the arguments and the returned type were recorded by two separate runs of the same fixture. No output value is shown, and a returned type says nothing about whether the output was right. “Level recorded” gives the UTC date when Syntology's graph wrote the sample's verification level, not when the code executed; where the level was written before Syntology's graph kept that date, the row says “level recorded, date not recorded”. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself. “Our draft was wrong” and “the contract check could not run” are failures of Syntology's instrument, not of the code: the sample ran on Syntology's synthesized input, and then the drafted contract did not describe it, or the check itself raised an error (RAISES), lacked a dependency (DEP_MISSING) or ran out of time (TIMEOUT); hover the label for which. A metamorphic tier, where shown, is evidence of the output's shape, not that the sample implements the method.

Each sample ends with its code_sha256. A sample's code_sha256 is Syntology's identity for that exact code. It is printed in full (16 hexadecimal characters for every sample in this build), and get_code(code_sha256="…") takes it exactly as printed. An agent calls it on Syntology's MCP service (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 are grouped by repository: a repository marked official first, then by how directly the repository is tied to the paper, then in the archive's order; never by how many ran. 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 six 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; the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar); this paper's copy was not located, so its licence is not recorded; or this paper's copy is cleared, but the stored copy of the same code that Syntology serves is not. 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.

A function or class name links to its page when the name occurs in the harvested code of at least 5 papers; the name is a string, not an identity. A census tag appears when Syntology's census ran implementations with that name on one shared input per bucket: it gives how many were compared, from how many papers, and how many distinct outputs they produced, and names this sample's bucket when this sample was one of them.

declare-lab/relationprompt official repository 10 samples, 4 ran (1 instrument-failed) · 6 unverified
RelationSentence generation.py ran MIT (permissive) · 1bf96a550bc9db35 · report fixture: signature text:str/0/str, head:str/0/str, tail:str/0/str, label:str/0/str, strict:bool/0/bool · returned RelationSentence · level recorded 2026-09-24
align_span_to_tokens generation.py ran · honoured contract MIT (permissive) · 46b3836cd0547e98 · report fixture: signature span:str/0/str, tokens:list/1/str · returned tuple · level recorded 2026-09-22
find_span generation.py ran · honoured contract fingerprinted MIT (permissive) · 48a2b26807165ecf · report fixture: signature span:str/0/str, tokens:list/1/str · returned list · level recorded 2026-09-22
find_sublist_index generation.py ran; the contract check could not run (RAISES) fingerprinted MIT (permissive) · 97a3eca137c3440e · report fixture: signature items:list/1/int, query:list/1/int · returned int · level recorded 2026-09-22
DynamicModel generation.py unverified MIT (permissive) · 1f6ddb84b665fb98 · report
Encoder in 278 papers generation.py unverified MIT (permissive) · b4e5d615275044cf · report
ExtractEncoder generation.py unverified MIT (permissive) · 43f13b65e230563d · report
LabelConstraint generation.py unverified MIT (permissive) · ea519177ab88447d · report
TextGenerator generation.py unverified MIT (permissive) · c5312c4d166f9950 · report
TripletSearchDecoder generation.py unverified MIT (permissive) · 1ad6a72afada7941 · report
declare-lab/hyperred community (archive-listed) 16 samples, 11 ran (7 instrument-failed) · 5 unverified
BertLayerNorm modeling.py ran · metamorphic tier: invariant no licence file found · pointer only · f24a08472067dcf7 · report fixture: signature x:Tensor/3/float · returned Tensor · level recorded 2026-09-22
BertLinear modeling.py ran · metamorphic tier: invariant fingerprinted no licence file found · pointer only · 28a82cb66563a20d · report fixture: signature x:Tensor/2/float · returned Tensor · level recorded 2026-09-22
batched_index_select in 44 papers modeling.py ran · our draft was wrong no licence file found · pointer only · 8e14a5ff3ee5597f · report fixture: signature target:Tensor/3/float, indices:Tensor/2/int, flattened_indices:NoneType/0/? · returned Tensor · level recorded 2026-09-22
check_adjacent modeling.py ran; the contract check could not run (RAISES) no licence file found · pointer only · eb611ef75d9aa110 · report fixture: signature i:int/0/int, j:int/0/int, k:int/0/int, bounds:tuple/1/int · returned bool · level recorded 2026-09-22
decode_nonzero_cuboids modeling.py ran; the contract check could not run (RAISES) no licence file found · pointer only · 4c70a6becf27ff53 · report fixture: signature x:Tensor/3/float · returned list · level recorded 2026-09-22
flatten_and_batch_shift_indices modeling.py ran · our draft was wrong fingerprinted no licence file found · pointer only · 27e54a4cbd7d001d · report fixture: signature indices:Tensor/2/int, sequence_length:int/0/int · returned Tensor · level recorded 2026-09-22
gelu in 308 papers
census: 43 implementations from 74 papers, 6 distinct outputs on one shared input this sample: bucket 1 of 1, arg 1: rank 2, kind float, dtype float32
modeling.py ran · honoured contract fingerprinted no licence file found · pointer only · e650dcdf9e8a559f · report fixture: signature x:Tensor/2/float · returned Tensor · level recorded 2026-09-22
get_device_of modeling.py ran · our draft was wrong fingerprinted no licence file found · pointer only · 5ea35802d5e71352 · report fixture: signature tensor:Tensor/2/float · returned int · level recorded 2026-09-22
get_range_vector modeling.py ran · honoured contract no licence file found · pointer only · 2b70d9c14170a263 · report fixture: signature size:int/0/int, device:int/0/int · returned Tensor · level recorded 2026-09-22
prune_matrix modeling.py ran; the contract check could not run (RAISES) no licence file found · pointer only · 439cdde1774200fe · report fixture: signature x:Tensor/4/float, indices:Tensor/2/int · returned Tensor · level recorded 2026-09-22
update_bounds modeling.py ran; the contract check could not run (RAISES) no licence file found · pointer only · d61d313e081aa624 · report fixture: signature i:int/0/int, j:int/0/int, k:int/0/int, bounds:tuple/1/int · returned tuple · level recorded 2026-09-22
BertEmbedModel modeling.py unverified no licence file found · pointer only · 4534173317cad377 · report
BertEncoder in 20 papers modeling.py unverified no licence file found · pointer only · e3af493846de2812 · report
CubeRE modeling.py unverified no licence file found · pointer only · 2e36d81e1a7ea466 · report
PretrainedEmbedModel modeling.py unverified no licence file found · pointer only · dc5e765561b30b13 · report
PretrainedEncoder modeling.py unverified no licence file found · pointer only · ee228a910e7ecb91 · report

Method as code Syntology

What Syntology's graph records as this paper's claimed method, lifted into code: each assembly names its bricks (functions and classes), each with its own role and its own verification level. An assembly is not a check that the code implements the method correctly or reproduces the paper's results. Levels are each brick's own verification level in Syntology's graph (level 0: no recorded run), listed brick by brick and never combined into one level; “ran” means the brick executed on a synthesized input, not that its output is correct, and the instrument figure counts failures of Syntology's instrument, not of the code. Where a model read the code against the paper's claim, each assembly's label verdict is one model's judgement, kept in this page's JSON twin; it is not calibrated, so no card prints it.

2 assemblies on this paper: 2 harvested, 0 generated.

harvested Assembly for Zero-Shot Relation Triplet Extraction (ZeroRTE) (graph method: Zero-Shot Relation Triplet Extraction (ZeroRTE)). 16 bricks; individually on a fixture: 11 ran (of which 0 constructed an object rather than computing a result; 4 with no instrument failure: 2 honoured, 0 violated, 2 with no contract checked; 7 where Syntology's instrument failed) · 5 unverified. The assembly has not been run end-to-end.

  1. CubeRE entry · level 0 · unverified · 2e36d81e1a7ea466
  2. BertEmbedModel helper · level 0 · unverified · 4534173317cad377
  3. BertLinear helper · level 1 · ran · 28a82cb66563a20d
  4. PretrainedEmbedModel helper · level 0 · unverified · dc5e765561b30b13
  5. batched_index_select helper · level 1 · ran · our draft was wrong · 8e14a5ff3ee5597f
  6. decode_nonzero_cuboids helper · level 1 · ran; the contract check could not run (RAISES) · 4c70a6becf27ff53
  7. prune_matrix helper · level 1 · ran; the contract check could not run (RAISES) · 439cdde1774200fe
  8. BertEncoder helper · level 0 · unverified · e3af493846de2812
  9. gelu helper · level 1 · ran · honoured contract · e650dcdf9e8a559f
  10. BertLayerNorm helper · level 1 · ran · f24a08472067dcf7
  11. PretrainedEncoder helper · level 0 · unverified · ee228a910e7ecb91
  12. flatten_and_batch_shift_indices helper · level 1 · ran · our draft was wrong · 27e54a4cbd7d001d
  13. check_adjacent helper · level 1 · ran; the contract check could not run (RAISES) · eb611ef75d9aa110
  14. update_bounds helper · level 1 · ran; the contract check could not run (RAISES) · d61d313e081aa624
  15. get_device_of helper · level 1 · ran · our draft was wrong · 5ea35802d5e71352
  16. get_range_vector helper · level 1 · ran · honoured contract · 2b70d9c14170a263

harvested Assembly for Triplet Search Decoding (graph method: Triplet Search Decoding). 10 bricks; individually on a fixture: 4 ran (of which 1 constructed an object rather than computing a result; 3 with no instrument failure: 2 honoured, 0 violated, 1 with no contract checked; 1 where Syntology's instrument failed) · 6 unverified. The assembly has not been run end-to-end.

  1. TripletSearchDecoder entry · level 0 · unverified · 1ad6a72afada7941
  2. DynamicModel helper · level 0 · unverified · 1f6ddb84b665fb98
  3. ExtractEncoder data_transform · level 0 · unverified · 43f13b65e230563d
  4. LabelConstraint helper · level 0 · unverified · ea519177ab88447d
  5. RelationSentence helper · level 1 · ran · 1bf96a550bc9db35
  6. TextGenerator model · level 0 · unverified · c5312c4d166f9950
  7. find_sublist_index helper · level 1 · ran; the contract check could not run (RAISES) · 97a3eca137c3440e
  8. Encoder helper · level 0 · unverified · b4e5d615275044cf
  9. find_span helper · level 1 · ran · honoured contract · 48a2b26807165ecf
  10. align_span_to_tokens helper · level 1 · ran · honoured contract · 46b3836cd0547e98

Each brick ends with its code_sha256, Syntology's identity for that exact code; click one to copy the get_code call that returns it. For agents, on Syntology's MCP service: assembly(arxiv_id="2203.09101") returns these assemblies with each brick's role and wiring (how to connect).

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