Venue: NAACL 2024

# DuRE: Dual Contrastive Self Training for

Semi-Supervised Relation Extraction

Yuxi Feng\({}^{1}\) and Laks V.S. Lakshmanan\({}^{1}\)

\({}^{1}\)The University of British Columbia, Vancouver, Canada

{fyx14, laks}@cs.ubc.ca

###### Abstract

Document-level Relation Extraction (RE) aims to extract relation triples from documents. Existing document-RE models typically rely on supervised learning which requires substantial labeled data. To alleviate the amount of human supervision, Self-training (ST) has prospered again in language understanding by augmenting the fine-tuning of big pre-trained models whenever labeled data is insufficient. However, existing ST methods in RE fail to tackle the challenge of _long-tail relations_. In this work, we propose DuRE, a novel ST framework to tackle these problems. DuRE jointly models RE classification and text generation as a dual process. In this way, our model could construct and utilize both pseudo text generated from given labels and pseudo labels predicted from available unlabeled text, which are gradually refined during the ST phase. We proposed a contrastive loss to leverage the signal of the RE classifier to improve generation quality. In addition, we propose a self-adaptive way to sample pseudo text from different relation classes. Experiments on two document-level RE tasks show that DuRE significantly boosts recall and F1 score with comparable precision, especially for long-tail relations against several strong baselines.

+
Footnote †: _Proceedings of the 2024 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies (Volume 1: Long Papers)_, pages 540–555

June 16-21, 2024 02024 Association for Computational Linguistics

## 1 Introduction

Relation Extraction (RE) from unstructured data sources is a key component of building large-scale knowledge graphs (KG) [38, 7]. Among all the RE tasks, Document-level RE [9] extracts subject-relation-object triples from documents, which remains daunting due to the significant challenges in modeling long text spans and obtaining high-quality supervision signals. Current document-level relation extraction methods [9, 10] can discover the semantic relation that holds between two entities under supervised learning. However, these methods typically require lots of manually labeled data for model training, which could be labor-intensive to obtain.

On the other hand, since a large amount of incoming text is usually accessible, we can tackle document-level RE using semi-supervised learning [1]. There has been substantial work on exploring how to alleviate the amount of human supervision required for RE. mintz2009multitask makes use of distant supervision which leverages external knowledge bases to obtain annotated triples. Since distant supervision makes a strong assumption that the relation between entity pairs should not depend on the context, it usually leads to context-agnostic label noises and sparse matching results.

Alternatively, self-training (ST) [13, 14], a classic semi-supervised learning paradigm, has been proposed in relation extraction [11, 12, 13]. ST minimizes the prohibitively expensive human labeling by iteratively pseudo-annotating unlabeled data with a classifier which is then retrained with the augmented labels. In this way, ST benefits from a vast number of unlabeled instances and extends the generalization bound [15].

Figure 1: Testing set performance (Precision, Recall, F1, and # of examples in training set) of baseline ATLOP [9] trained on Re-DocRED [11] dataset.



2012; Zhang et al., 2022).

A significant challenge of ST is inadequate training data for long-tail relations. As shown in Fig. 1, current document-level RE systems Zhou et al. (2021) do not perform well on long-tail relations, which hardly appear in the training data. For example, the F1-score for class _located in_ is 83.02 while _ethnic group_ is only 6.45. The reason could be that the amount of training data is vastly different (20k vs. 155). Assuming that training data and unlabeled data have the same distribution, we cannot expect these long-tail relations to appear sufficiently often in the unlabeled text corpus. To address this, Tan et al. (2023) propose to re-sample training set and to assign more weight to the classes that have high precision and low recall. However, this method does not bring new information to the relation classifier. As a result, these self-training methods might not be able to improve the RE performance on these rare relations.

In order to solve the above issue of long-tail relations, we propose a novel method - Dual contrastive self training for semi-supervised Relation Extraction (DuRE). Unlike previous ST methods Hu et al. (2021); Tan et al. (2023), we simultaneously train a controllable text generator, generating diverse outputs given specific relation triples. To improve the controllability of the generator, we leverage the signal of the trained RE classifier to label positive and negative generated sequences, and then apply a ranking calibration loss Zhao et al. (2023) to contrast the positive and negative sequences to improve generation quality. In addition, we propose a self-adaptive way to sample pseudo text from different relation classes. We add noise by increasing generation temperature for relations with higher precision, which introduces diversity to the training set and helps reduce overfitting. Besides, we sample more examples from relations with lower recall. Since long-tail relations usually have a low recall (Fig. 1), they are more likely to be sampled, and thus their recall can be increased through training.

The contributions of this work are as follows:

* We dig into the problem of document-level extraction of long-tail relations and propose to simultaneously train a controllable text generator to address the limitation of previous self-training methods Tan et al. (2023) that only leverage pseudo-labeling.
* We propose a contrastive loss to control the quality of generated pseudo text, improving the generation quality and thus helping to enhance the classification performance of the relation classifier.
* Comprehensive experiments show that our model significantly improves F1-score in different RE benchmarks on general and biomedical domains, especially on long-tail relations.

## 2 Related Work

Relation Extraction:Deep neural models have proven to be successful in sentence-level and document-level relation extraction. Zhang et al. (2017) proposed position-aware attention to improve sentence-level RE and published TACRED, which became a widely used RE dataset. Yamada et al. (2020) developed LUKE, which further improved the SOTA performance with entity pre-training and entity-aware attention. Papanikolaou and Pierleoni (2020) proposed to use GPT-2 to generate pseudo data for improving sentence-level RE performance. However, most relations in real-world data can only be extracted based on inter-sentence information. To extract relations across sentence boundaries, recent studies began to explore document-level RE. As previously mentioned, Yao et al. (2019) proposed the popular benchmark dataset DocRED for document-level RE. To address the multilabel problem of Document-level RE, Zhou et al. (2021) proposed using adaptive thresholds to extract all relations of a given entity pair. Zhang et al. (2021) developed the DocUNET model to reformulate document-level RE as a semantic segmentation task and used a U-shaped network architecture to improve the performance of DocRE. Tan et al. (2022) proposed the use of knowledge distillation and focal loss to denoise the distantly supervised data for DocRE. Wang et al. (2022) proposed a positive-unlabeled learning algorithm under incomplete annotation scenario. However, _the methods above were not designed to tackle the challenge of long-tail relations._

Self-training:Recently, Self-training has flourished again by iteratively generating pseudo labels and augmenting the tuning of data-hungry language models, showing great advantages in further enhancing NLU Meng et al. (2020); Vu et al. (2021); Du et al. (2021); Bhat et al. (2021); Chen et al. (2021) and Relation Extraction (RE) Hu et al. (2021); Yu et al. (2022); Xu et al. (2023), where massive un 

labeled input text exists. To tackle the issue of confirmation bias in self-training, Wei et al. (2021) re-samples pseudo-labels based on the frequencies of training examples. Tan et al. (2023) samples different numbers of pseudo-labeled data based on the development set performance. However, it ignores the relations where both precision and recall are low. _All the above ST methods for RE apply ST only in generating pseudo-labels_. Feng et al. (2023b) were the first to propose dual self-training to improve controllable text generation by introducing two kinds of noise. However, they do not study the effectiveness of dual self-training in classification problems (such as relation extraction), and in fact the strategy of adding noise sometimes harms the classification performance.

Unlike all the above ST methods, we are the first to apply dual self-training on document-level relation extraction, generating both **pseudo-labeled data** using RE classifier and **pseudo texts** given specific relation triples using a text generator. The design of contrastive loss and self-adaptive generation for different relation classes further improves the performance, especially on long-tail relations.

## 3 Method

### Problem Formulation

Document-level relation extractionGiven a document \(x\) and a set of entities \({\bf e}=\{e_{j}\}_{j=1}^{m}\), the task of document-level relation extraction is to predict a subset of relations from \(\mathcal{R}\cup\{N_{A}\}\) between entity pairs \((e_{h},e_{t})_{h,t=1...m,h\neq t}\), where \(\mathcal{R}\) is a pre-defined set of relations, \(N_{A}\) represents no relations between given entities, and \(e_{h}\), \(e_{t}\) are identified as head and tail entities, respectively. At the test time, the model needs to predict the labels of all entity pairs in document \(x\).

Semi-supervised document-level relation extractionLet \(\mathbf{x}\) be the text, \(\mathbf{e}\) be the entities mentioned in \(\mathbf{x}\), and \(\mathbf{y}=\{e_{h_{j}},r_{j},e_{t_{j}}\}_{j=0}^{n_{x}}\) be the existing relations in \(\mathbf{x}\), \(D_{L}\!=\!\{\mathbf{x}_{i},\mathbf{y}_{i},\mathbf{e}_{i}\}\) be a labeled dataset with paired text and its corresponding relation sets, and \(D_{U}=\{\mathbf{x}_{i},\mathbf{e}_{i}\}\) be an unlabeled dataset from the same domain. In reality, we do not obtain \(\mathbf{e}_{i}\) for unlabeled text corpus. However, we can use tools of name entity recognition (NER) and coreference resolution (CR) to get the entity list in advance. Since we focus on relation extraction only, we assume we have already obtained the entity list for simplicity.

Controllable text generation given relation triples Given relation triples \(\mathbf{y}=\{e_{h_{j}},r_{j},e_{t_{j}}\}_{j=1}^{n_{x}}\), where \(n_{x}\) is the number of relations, the task is to generate document \(x\) that contains these relation triples.

### Methodology

We aim to jointly learn an attribute-controllable generator \(\mathcal{G}=P_{\theta}(\mathbf{x}|\mathbf{y})\) parameterized by \(\theta\) (_e.g._, a large PLM) to generate, in an auto-regressive manner, high-quality text \(\mathbf{x}\sim P_{\theta}(\mathbf{x}|\mathbf{y})\) containing the given relations \(\mathbf{y}\). We also endow our model with the ability to produce pseudo extractions for \(\{\mathbf{x}_{i},\mathbf{e}_{i}\}\in D_{U}\) through jointly learning a Document-RE classifier \(\mathcal{C}\!=\!P_{\phi}(\mathbf{y}|\mathbf{x},\mathbf{e})\). We simultaneously model and optimize \(\mathcal{G}\) and \(\mathcal{C}\) with a shared PLM as a dual process.

We train our relation classifier using Adaptive Thresholding (AT) loss Zhou et al. (2021). AT loss aims to learn a threshold class (TH), which are entities-dependent threshold values. The definition of AT loss is as follows:

\[\begin{split}&\mathcal{L}_{P}=-\sum_{r\in\mathcal{P}_{\mathbf{a}}} \log\left(\frac{e^{\text{logit}_{r}}}{\sum_{r^{\prime}\in\mathcal{P}_{\Theta} \cup\{\text{TH}\}}e^{\text{logit}_{r^{\prime}}}}\right),\\ &\mathcal{L}_{N}=-\log\left(\frac{e^{\text{logit}_{\text{PH}}}}{ \sum_{r^{\prime}\in\mathcal{N}_{\Theta}\cup\{\text{TH}\}}e^{\text{logit}_{r^{ \prime}}}}\right),\\ &\mathcal{L}_{C}=\mathcal{L}_{P}+\mathcal{L}_{N}\end{split} \tag{1}\]

where positive classes \(\mathcal{P}_{\mathbf{c}}\subseteq\mathcal{R}\) are the relations that exist between the entities in \(\mathbf{e}\), negative classes \(\mathcal{N}_{\mathbf{c}}\subseteq\mathcal{R}\) are the relations that do not exist between the entities, logit\({}_{r}\) and logit\({}_{TH}\) are the predicted logits for class \(r\) or threshold \(TH\) by classifier \(\mathcal{C}\). AT loss is a sum of losses of two parts. The first part \(\mathcal{L}_{P}\) pushes the logits of all positive classes to be higher than the TH class. The second part \(\mathcal{L}_{N}\) is a categorical cross-entropy loss with TH class being the true label and pushes the logits of negative classes to be lower than the TH class.

For the generation side, we use cross-entropy loss for auto-regressive generation.

\[\mathcal{L}_{G}=-\frac{1}{N}\sum_{(\mathbf{x},y)\in D}[\sum_{j=1}^{L}\log P_{ \theta}(\mathbf{x}^{j}|\mathbf{x}^{<j},y)], \tag{2}\]

where \(\mathbf{x}^{j}\) means the \(j\)-th token in \(\mathbf{x}\), \(L\) is the length of \(\mathbf{x}\), \(D\) is the training set with \(N\) samples. We will show later how to construct \(D\) for different training phases. Finally, we compute a weighted sum of 

classification and generation loss, where \(\lambda_{C}\) and \(\lambda_{G}\) are tunable hyperparameters.

\[\mathcal{L}=\lambda_{C}\mathcal{L}_{C}+\lambda_{G}\mathcal{L}_{G}. \tag{3}\]

### Self-adaptive pseudo text generation

The full DuRE method is described in Alg. 1. Following the practice of self-training in NLU Vu et al. (2021), we start ST from a strong base model tuned on \(D_{L}\) and use the full unlabeled \(D_{U}\) to produce pseudo labels, rather than select part of the data with certain criteria as in Tan et al. (2023). In addition to pseudo-labeled data, we also use our generator to generate pseudo-text given entity-relation triples. To better improve the RE performance, we propose to use Contrastive Loss (CL) and Self-Adaptive Generation (SAG) methods, which are illustrated below.

Contrastive Loss (CL)Following Zhao et al. (2023), we use Sequence Likelihood Calibration (SLiC) to align a language model's sequence likelihood, \(P_{\theta}(x|y)\), over decoded sequences according to their similarity to reference sequences. Given \(\mathbf{y}_{j}=\{e_{h_{j}},r_{j},e_{t_{j}}\}\), we generate a batch of \(m\) generations \(x^{k}_{j}=\mathcal{G}(\mathbf{y}_{j})\). Then the ranking calibration loss contrasts a positive sequence \(x^{+}\) and a negative sequence \(x^{-}\), encouraging the model to assign more probability mass to positive compared to negative sequences, and thus enhancing generation quality. Thanks to the dual learning framework, we can use the classifier \(\mathcal{C}\) to evaluate the confidence of whether generation \(x\) contains relation triple \(\{e\}\). More specifically, \(x^{+}=\textrm{argmax}_{i}logit_{r_{j}}^{i}\), and \(x^{-}=\textrm{argmin}_{i}logit_{r_{j}}^{i}\). Thus the contrastive loss is computed as follows:

\[\mathcal{L}_{G}=\max\big{(}0,\beta-\log P_{\theta}(x^{+}|y)+\log P_{\theta}(x^ {-}|y)\big{)} \tag{4}\]

where \(\beta>0\) is a hyperparameter to control the margin between positive and negative examples.

Self-Adaptive Generation (SAG)Another advantage of using pseudo text is that we can tune the distribution of relations and generate more pseudo texts for long-tail relations. Compared to traditional methods like bootstrapping Dupret and Koda (2001) and class-rebalanced self-training Wei et al. (2021) where duplicated samples are chosen for a specific class, the generator can produce more diverse training examples.

Here we propose a self-adaptive pseudo-text generation strategy. For different relation classes with different development set performances, we generate pseudo text accordingly. For a relation class \(r\), if its recall \(R_{r}\) is low, then we should improve the recall by generating more pseudo examples. If its precision \(P_{r}\) is high, we believe this class is well-predicted. Then the purpose of pseudo-text generation is to augment the training set with noisy data to enhance generalization. A good way to add noise is to generate data with higher temperature Feng et al. (2023b). Otherwise, if \(P_{r}\) is low, we use a lower temperature to sample a more certain output to ensure the generation quality. In summary, we define the sampling probability \(\phi_{r}\) and generation temperature temp\({}_{r}\) for relation \(r\) as fol 

lows.

\[\phi_{r} \sim(1-R_{r}),\] \[\text{temp}_{r} =\alpha+P_{r}. \tag{5}\]

where \(\alpha>0\) is a hyperparameter to control the noise level of generation.

Our SAG method has the following major differences from Tan et al. (2023). (1) Data resampled: Tan et al. (2023) resample the training set while we sample generated pseudo text to generate diverse outputs given specific relation triples. (2) Sampling Strategy: Tan et al. (2023) resample the training set with probability \(P_{r}(1-R_{r})\) , which causes relations with low precision to be ignored. On the other hand, we resample with probability \((1-R_{r})\), and encourage the classes with higher precision to generate more diverse outputs (sampling with high temperature). For the relations with low precision, we sample with low temperature to ensure its faithfulness.

## 4 Experiments

### Datasets

We experimented with our method on two datasets. For general-domain document level RE, we use Re-DocRED Tan et al. (2022b), a high quality dataset. We use the distantly-labeled set of RecDBCB as unlabeled set, only keeping named entities information and coreference information but ignoring the distant labels. As a second dataset, we tested our method on the biomedical document-level RE dataset ChemDisGene (CDG) Zhang et al. (2022a). Since there is no unlabeled set in CDG, we only leveraged part (e.g., 5%) of training set as labeled data and kept aside the rest as unlabeled data. Our models are evaluated on the test sets of Re-DocRED and CDG. Both of the test sets are human-annotated and have high quality. The statistics of the datasets can be found in Table 1.

### Experimental Settings

We use ATLOP Zhou et al. (2021) as our base RE classifier and an encoder-decoder framework as our pseudo text generator. Following Feng et al. (2023b), we share the encoder part of RE classifier and pseudo text generator to save the total number of training parameters. For Re-DocRED dataset, we use Flan-T5-base Chung et al. (2022) as the base encoder-decoder model. For CDG dataset, we use a version of Flan-T5-base that is pretrained on Pubmed dataset1. We use AdamW Loshchilov and Hutter (2019) with learning rate = 5e-5, warm-up rate = 0.06, \(\lambda_{g}=1\), \(\lambda_{c}=5\), \(\alpha=0.7\) , \(\beta=0.3\), and batch size = 8 for optimization across all tasks. As is common practice Holtzman et al. (2019), we use the top-\(p\) sampling method with \(p=0.9\) for decoding. For the generation task, we add a prompt sentence at the beginning of the input: _Generate text given the following relation triples_. The number of pseudo text is the same as the number of labeled data, i.e., 3053 for RecDBCB and 3847 for CDG. More implementation details are provided in the Appendix.

Footnote 1: The model can be found at [https://huggingface.co/gburatz/ssc-flan-t5-base-pubmed](https://huggingface.co/gburatz/ssc-flan-t5-base-pubmed).

### Evaluation Metrices

Following Tan et al. (2023), we used micro-averaged F1 score as the evaluation metric. We also evaluate the F1 score for frequent classes and long-tail classes, denoted as Freq_F1 and LT_F1, respectively. For the Re-DocRED dataset, the frequent classes include the top 10 most popular relation types in the label space; the rest of the classes are categorized as long-tail classes. We also use an additional metric Ign_F1 on the DocRE task. This metric represents the F1 score, calculated for the triples that do not appear in the training data.

### Baselines

We compare our model with the following strong document-level RE baselines, including both supervised and semi-supervised.

**Supervised Approaches** (1) **ATLOP**Zhou et al. (2021) A vanilla baseline model for document-level RE. (2) **ATLOP-Flan** Only use Flan-T5

\begin{table}
\begin{tabular}{l r r r r} \hline \hline
**Dataset** & **Train** & **Dev** & **Test** & **Unlabeled** \\ \hline
* \\ Avg. \# Sentences & 7.9 & 8.2 & 7.9 & 8.0 \\ \# NA rate & 94.3\% & 93.1\% & 93.1\% &
- \\ \hline
* \\ Avg. \# Sentences & 12.6 & 14.0 & 13.2 & 12.6 \\ \# NA rate & 96.8\% & 97.7\% & 93.8\% &
- \\ \hline \hline \end{tabular}
\end{table}
Table 1: Dataset statistics.
 

(Chung et al., 2022) Encoder to train the RE classifier without generator. (3) **ATLOP-Dual** Simultaneously train RE classifier given input documents and text generator given relation triples but without self-training. (4) **Negative Sampling (NS)**(Li et al., 2021): randomly select partial negative samples in training to alleviate the detrimental effect of the false negative problem.

Semi-supervised ApproachesAll the baselines below leverage ATLOP as their backbone. (1) **Vanilla Self-Training (VST)**(Peng et al., 2019; Jie et al., 2019): a variant of simple self-training where models are trained with \(N\) folds, and all pseudo-labels are directly combined with the original labels. (2) **SSR Positive Unlabeled Learning (SSR-PU)**(Wang et al., 2022): SSR-PU utilizes positive unlabeled learning and a shift-and-squared ranking (SSR) loss to accommodate the distribution shifts for the unlabeled examples. (3) **Class Re-balancing Self-Training (CREST)**(Wei et al., 2021): This algorithm re-samples the pseudo-labels generated by models based on the frequencies of the training samples. (4) **Class-Adaptive Self-Training (CAST)**(Tan et al., 2023): this method calculates the precision and recall scores of each class on the development set and uses the calculated scores to compute the sampling probability of each class to alleviate confirmation bias caused by erroneous pseudo labels.

### Results

The experimental results on the test set of RecDocRED (Table 2) demonstrate that our DuRE achieves consistent performance improvements in terms of F1 scores over all baselines. The F1 difference between the best baseline CAST and our DuRE is 2.17 (76.84 vs. 74.67). We also found that simply adding an additional RE-controlled generation task does not improve the relation classification performance (ATLOP-Flan vs. ATLOP-Dual), where F1 scores decreased slightly (72.05 vs. 71.72). In addition, training on an encoder-decoder framework (Flan-T5-base) does not outperform a single encoder framework (Bert-base) in document-level RE tasks. However, we notice that the gap between CAST and ATLOP(bert) is 2.06, while the gap between ATLOP-DuRE and ATLOP-Dual is 5.12. This indicates that our proposed dual self-training method improves the RE classification quality significantly more compared to the backbone model. We also notice a considerable improvement (+3.54 F1) especially in long-tail relations, showing that self-training on a rebalanced pseudo text is better than simply doing bootstrap

\begin{table}
\begin{tabular}{l c c c c c c} \hline \hline
**Model** & **P** & **R** & **F1** & **Ign_F1** & **Freq_F1** & **LT\_F1** \\ \hline \multicolumn{6}{l}{_Bert-base-cased_} \\ ATLOP\({}^{\dagger}\) & **86.70** & 62.46 & 72.61 & 71.86 & 75.92 & 67.46 \\ NS\({}^{\dagger}\) & 77.63 & 69.17 & 73.16 & 72.92 & 77.28 & 67.59 \\ VST\({}^{\dagger}\) & 72.77 & **75.55** & 74.14 & 72.48 & 78.47 & 68.13 \\ SSR-PU & 76.78 & 71.46 & 74.33 & 72.91 & 78.41 & 68.32 \\ CREST\({}^{\dagger}\) & 75.94 & 72.47 & 74.17 & 72.77 & 77.93 & 68.68 \\ CAST\({}^{\dagger}\) & 76.59 & 72.84 & 74.67 & 73.32 & 78.53 & 69.34 \\ \hline \multicolumn{6}{l}{_Flan-T5-base_} \\ ATLOP-Flan & 86.40 & 61.78 & 72.05 & 71.32 & 76.15 & 65.45 \\ ATLOP-Dual & 85.17 & 61.93 & 71.72 & 70.95 & 76.07 & 64.70 \\ DuRE & 79.01 & 73.84 & **76.84** & **75.32** & **79.81** & **72.88** \\ \hline \hline \end{tabular}
\end{table}
Table 2: Relation classification results on Re-DoCRED dataset. \({}^{\dagger}\)Results are obtained from Tan et al. (2023).

\begin{table}
\begin{tabular}{l c c c} \hline \hline
**Model** & **P** & **R** & **F1** \\ \hline \multicolumn{6}{l}{_PubMedBERT on CDG (100%)_} \\ ATLOP \({}^{\dagger}\) & **76.17** & 29.70 & 42.73 \\ NS \({}^{\dagger}\) & 71.54 & 35.52 & 47.47 \\ SSR-PU & 54.27 & 43.93 & 48.56 \\ CREST \({}^{\dagger}\) & 59.42 & 42.12 & 49.28 \\ CAST \({}^{\dagger}\) & 66.68 & 45.48 & 54.03 \\ \hline \multicolumn{6}{l}{_Flan-T5-base on CDG (5%)_} \\ ATLOP-Dual & 46.40 & 21.78 & 32.05 \\ DuRE & 52.01 & 48.84 & 50.38 \\ \hline \multicolumn{6}{l}{_Flan-T5-base on CDG (50%)_} \\ ATLOP-Dual & 47.67 & 51.24 & 49.39 \\ DuRE & 54.91 & **59.43** & **57.08** \\ \hline \hline \end{tabular}
\end{table}
Table 3: Results on CDG dataset. \({}^{\dagger}\)Results are obtained from Tan et al. (2023).

 

ping in the existing training set. The reason is that our trained generator can generate more diverse examples, which helps reduce overfitting on training data.

Table 3 presents the experiments on biomedical RE (CDG dataset). Our DuRE model achieves a performance comparable to the baselines with only 5% of the training data. When trained with 50% of the training data, we get the best performance, outperforming the CAST baseline with +3.05 F1. Based on the results of RE experiments in general and biomedical domains, self-training-based methods aim to improve recall and consistently improve overall performance. However, our DuRE maintains a better balance between increasing recall and maintaining high precision.

### Ablation Study

We conduct an ablation study on the Re-DocRED dataset. As shown in Table 4, we can see that (i) Self-Adaptive Generation benefits the F1 score for both frequent and long-tail relations; (ii) Contrastive loss further enhances all F1 scores in relation extraction; and (iii) Self-training on pseudo-labeled text leads to an improvement in recall but has relatively low precision, which shows that self-training is able to balance precision and recall. This observation is also consistent with Tan et al. (2023). Full version of Table 4 is included in the Appendix.

### Analysis

Effect of Self-TrainingWe compare our model with a variant (\(-\textbf{Dual}\)) where we use the base generation model \(\mathcal{G}_{0}\) to generate pseudo text and do not update it through self-training. As depicted in Fig. 2, classification F1 reaches its maximum quickly and then stops increasing. On the other hand, thanks to the simultaneously optimized generator, DuRE keeps improving generation quality and refining pseudo labels, and thus iteratively improves the quality of the relation classifier.

Number of labeled dataWe also assess our model with varying numbers of labeled training instances, with the remaining instances treated as unlabeled data. We observe consistent superiority of DuRE to ATLOP-Dual model. Indeed, even DuRE (50%) outperforms ATLOP-Dual (100%), showing that our method can work with scenarios with fewer training data. However, we notice a drop in DuRE (100%). We conjecture that the reason is that the training set of CDG itself is distantly labeled, which is noisy and incomplete. Through self-training on pseudo-labeled data, the model can figure out incompletely labeled relations. However, as for training on the full distantly-labeled dataset, DuRE only benefits from generated pseudo texts compared to ATLOP-Dual, which limits the improvement of the classification model on pseudo-labeled data. Notice that the generated pesudo texts might still have higher quality than simply distantly labeled data.

 

Performance of relations with different frequencyWe sorted the relations by their frequency of appearance in the training set from low to high and grouped them into five groups by their percentile. Fig. 4 plots the development set performance of relations with different frequencies. We can see that original ATLOP tends to have much higher precision than recall, while our DuRE consistently improves recall and F1 scores over relations across all frequency groups, at the price of a modest drop in precision. We also notice a tendency that our method improves F1 score more for less frequent relations thanks to the self-adaptive generation, indicating the effectiveness of our methods on long-tail relations.

Improvement on rare relationsWe plot the precision and recall scores of DuRE and CAST for different relation classes in Fig. 5, where the experimental results are obtained by training with the Re-DocRED dataset. We found that DuRE significantly improves the recall scores of long-tail classes (_producer_, _replaced by_, and _ethnic group_) and thus improves F1 scores, while maintaining the F1 scores of frequent classes (_located in_). We also notice that the improvements in recall scores are accompanied by a decline in precision scores for frequent classes due to our strategy of learning from noisy pseudo texts for frequent classes. Learning from these augmented noisy texts would decrease the threshold and thus improve recall but decrease precision.

Further analysis of contrastive lossTable 5 illustrates a case study of how contrastive loss improves generation quality and thus improves re

Figure 4: Precision, recall, and F1 score on the development set over different percentile of appearances in the Re-DocRED training set.

\begin{table}
\begin{tabular}{l|p{398.2pt}} Input & * The Invisible Man*, lyrics by, * Roger Taylor*. \\ \hline Positive & ”* The Invisible Man*” is a rock song originally **written by** * Roger Taylor* and * Mark Smith* in * 1942*. \\  & The song was sung at the * Royal Academy of Music* ( Royal Academy of Music ) in * 1952*. The lyrics and compositions of ”The Invisible Man" were originally a single with “Taylor“s voice in a voodoo voice, a version of * Ralph Ellis’s” * The Man Who Walks Away*”. The medicy is a ballad, and is not a traditional ballad. ”* The Invisible Man*” is often performed in ” England* and ”France”, but it was originally recorded as a concert song for the * Royal Academy of Music*, in * 1936*, and in ’Japan’ ( including the final song ). \\ \hline Negative & ‘* The Invisible Man* is the sixth **album by** * Roger Taylor*. It was released in October 1966. The album features a different version of ”* The Man In the Sun* ” and a different theme. * **The Man In the Sun*** is set in a mystical ( and heavily symbolic ) future. It was composed by** * Roger Taylor*. The album is very similar to the * The Black Swan* album. It is not necessarily a remake of the album, but rather a remastered version of the earlier album. The album contained a new riff and a new orchestration which was intended to provide additional background music for the final section of the album.

\end{table}
Table 5: Example of generation on Re-DocRED dataset.

Figure 5: Comparison of testing set performance of baseline ATLOP (light) and DuRE (dark) trained on Re-DocRED dataset.

 

lation classification. Both positive and negative examples are generated under the same decoding strategy. We can see that the negative example does not entail the relation (_The Invisible Man, lyrics by, Roger Taylor_), given that there are similar relations (_The Invisible Man, album by, Roger Taylor_) and (_The Man In the Sun, composed by, Roger Taylor_). This example shows that our learned text generator could sometimes generate text that does not entail the given prompt. Thanks to the contrastive loss, the learned text generator could learn from the signal from the RE classifier, maximize the margin of positive and negative samples, and be more faithful to the given prompt. Detailed analysis of generation quality can be found in Appendix.

## 5 Conclusion and Future Work

We propose a novel DuRE method to apply Self-training to semi-supervised document-level relation extraction. DuRE (1) jointly optimizes generation and classification via a dual learning framework to leverage both pseudo text and pseudo labels, (2) incorporates contrastive loss to improve the quality of pseudo texts, and (3) applies self-adaptive generation to reduce overfitting of well-predicted relation classes and to improve the performance of long-tail relations. Given that the pseudo data is generated in an auto-regressive manner, which takes longer training time, we plan to explore ways to accelerate the self-training process in the future.

## 6 Limitations

Though DuRE works well, it has the following limitations:

* Decelerated training process. Like all other Self-training methods, DuRE also needs to reproduce pseudo labels and pseudo text at each ST iteration. Since the pseudo text is generated in an auto-regressive manner, which is hard to be done in parallel, it takes longer training time. Feng et al. (2023) proposed to use a non-autoregressive generator in self-training, which could be possibly used to accelerate the training speed of DuRE.
* Bias introduced. Bias can be introduced by various forms of supervision, including human annotators or machine synthetic data. We acknowledge that potential bias exists in the pseudo text generated by our DuRE method since DuRE shifts the distribution of training data based on the performance (precision and recall) on the development set. Analyzing the impact of bias found in semi-supervised learning algorithms (like self-training) is an interesting study for future work.
* Reliance on unlabeled in-domain text. As we discussed in Sec. 4, though our proposed contrastive loss and self-adaptive generation bring non-trivial improvement, the overall performance of all ST methods still relies on pseudo labels from unlabeled text. When unlabeled text is extremely inadequate or even unavailable (e.g., low-resource scenarios), how to better utilize pseudo text for further improvement is an open challenge.
* Task generalization and scalability. We mainly investigate document-level RE in this work, in which ST actually acts as a kind of regularization and smoothing. How to apply this paradigm to super large language models (_e.g._, LLaMa-2 Touvron et al., 2023) and GPT4 OpenAI (2023)) and for tasks beyond RE is also an open question.

## 7 Ethics Statement

The generative part of our model may be utilized to generate fake information when the input triples are not factual, which could possibly be utilized to produce and propagate disinformation. Also, the generated pseudo-text may contain some socially biased, offensive, or politically sensitive expressions. However, these generated texts are designed to be used as pseudo data in data augmentation to improve the robustness of the relation extraction model and to improve the performance of long-tail relations.

## Acknowledgement

Lakshmanan's research was supported in part by a grant from NSERC (Canada) and Feng's research was supported in part by a grant from UBC Data Science Institute.

## References

* Bhat et al. [2021] Meghana Moorthy Bhat, Alessandro Sordoni, and Subhabrata Mukherjee. 2021. Self-training with few-shot rationalization. In _Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing_, pages 10702-10712, Online and Punta Cana 

Dominant Republic. Association for Computational Linguistics, External Links: Link Cited by: SS2.
* O. Chapelle, B. Scholkopf, and A. Zien (2006) Semi-supervised learning. IEEE Transactions on Neural Networks20. Cited by: SS1.
* Y. Chen, Y. Zhang, C. Zhang, G. Lee, R. Cheng, and H. Li (2021) Revisiting self-training for few-shot learning of language model. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, Online and Punta Cana, Dominican Republic, pp. 9125-9135. External Links: Document, ISSN 1478-0226, Link Cited by: SS1.
* J. Devlin, M. Chang, K. Lee, and K. Toutanova (2019) BERT: pre-training of deep bidirectional transformers for language understanding. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers), Minneapolis, Minnesota, pp. 4171-4186. External Links: ISBN 978-3-319-1422-1, Link, Document Cited by: SS1.
* J. Du, E. Grave, B. Gunel, V. Chaudhary, O. Celebi, M. Auli, V. Stoyanov, and A. Conneau (2021) Self-training improves pre-training for natural language understanding. In Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Online, pp. 5408-5418. External Links: Document, Link Cited by: SS1.
* G. Dupret and M. Koda (2001) Bootstrap re-sampling for unbalanced data in supervised learning. European Journal of Operational Research134 (1), pp. 141-156. External Links: Document, ISSN 1556-1221, Link Cited by: SS1.
* Y. Feng, X. Yi, L. V.S. Lakshmanan, and X. Xie (2023) Kest: kernel distance based efficient self-training for improving controllable text generation. In Proceedings of the Thirty-Second International Joint Conference on Artificial Intelligence, IJCAI-23, Vol. , pp. 5049-5057. External Links: Document, ISSN 1556-1221, Link Cited by: SS1.
* Y. Feng, S. Yi, X. Wang, L. Lakshmanan, V.S., and X. Xie (2023) DuNST: dual noisy self training for semi-supervised controllable text generation. In Proceedings of the 61st Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), Toronto, Canada, pp. 8760-8785. External Links: Document, Link Cited by: SS1.
* Yu et al. (2021) Domain-specific language model pretraining for biomedical natural language processing. ACM Trans. Comput. Healthcare3 (1). Cited by: SS1.
* A. Holtzman, J. Buys, L. Du, M. Forbes, and Y. Choi (2019) The curious case of neural text degeneration. In International Conference on Learning Representations, Cited by: SS1.
* X. Hu, C. Zhang, F. Ma, C. Liu, L. Wen, and P. S. Yu (2021) Semi-supervised relation extraction via incremental meta self-training. In Findings of the Association for Computational Linguistics: EMNLP 2021, Punta Cana, Dominican Republic, pp. 487-496. External Links: Document, Link Cited by: SS1.
* Z. Jie, P. Xie, W. Lu, R. Ding, and L. Li (2019) Better modeling of incomplete annotations for named entity recognition. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers), Minneapolis, Minnesota, pp. 729-734. External Links: Document, Link Cited by: SS1.
* J. Lehmann, R. Isele, M. Jakob, A. Jentzsch, D. Kontokostas, P. N. Mendes, S. Hellmann, M. Morsey, P. Van Kleef, S. Auer, et al. (2015) DBpedia-a large-scale, multilingual knowledge base extracted from wikipedia. Semantic Web6 (2), pp. 167-195. External Links: Document, ISSN 1556-1221, Link Cited by: SS1.
* J. Li, M. Galley, C. Brockett, J. Gao, and B. Dolan (2016) A diversity-promoting objective function for neural conversation models. In Proceedings of the 2016 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, San Diego, California, pp. 110-119. External Links: Document, Link Cited by: SS1.
* Y. Li, l. liu, and S. Shi (2021) Empirical analysis of unlabeled entity problem in named entity recognition. In International Conference on Learning Representations, Cited by: SS1.
* I. Loshchilov and F. Hutter (2019) Decoupled weight decay regularization. In ICLR, Cited by: SS1.
* Y. Meng, Y. Zhang, J. Huang, C. Xiong, H. Ji, C. Zhang, and J. Han (2020) Text classification using label names only: a language model self-training approach. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), Online, pp. 9006-9017. External Links: Document, Link Cited by: SS1.

 

Mike Mintz, Steven Bills, Rion Snow, and Daniel Jurafsky. 2009. Distant supervision for relation extraction without labeled data. In _Proceedings of the Joint Conference of the 47th Annual Meeting of the ACL and the 4th International Joint Conference on Natural Language Processing of the AFNLP_, pages 1003-1011, Suntec, Singapore. Association for Computational Linguistics.
* Noy et al. (2019)Natasha Noy, Yuqing Gao, Anshu Jain, Anant Narayanan, Alan Patterson, and Jamie Taylor. 2019. Industry-scale knowledge graphs: Lessons and challenges. _Communications of the ACM_, 62 (8):36-43.
* OpenAI (2023)OpenAI. 2023. Gpt-4 technical report.
* Papanikolaou and Pierleoni (2020)Yannis Papanikolaou and Andrea Pierleoni. 2020. Dare: Data augmented relation extraction with gpt-2. _arXiv preprint arXiv:2004.13845_.
* Peng et al. (2019) Minlong Peng, Xiaoyu Xing, Qi Zhang, Jinlan Fu, and Xuanjing Huang. 2019. Distantly supervised named entity recognition using positive-unlabeled learning. In _Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics_, pages 2409-2419, Florence, Italy. Association for Computational Linguistics.
* Radford et al. (2019)Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, Ilya Sutskever, et al. 2019. Language models are unsupervised multitask learners. _OpenAI blog_, 1(8):9.
* Ru et al. (2021) Dongyu Ru, Changzhi Sun, Jiangtao Feng, Lin Qiu, Hao Zhou, Weinan Zhang, Yong Yu, and Lei Li. 2021. Learning logic rules for document-level relation extraction. In _Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing_, pages 1239-1250, Online and Punta Cana, Dominican Republic. Association for Computational Linguistics.
* Scudder (1965)Henry Scudder. 1965. Probability of error of some adaptive pattern-recognition machines. _IEEE Transactions on Information Theory_, 11(3):363-371.
* Tan et al. (2022a) Qingyu Tan, Raidan He, Lidong Bing, and Hwee Tou Ng. 2022a. Document-level relation extraction with adaptive focal loss and knowledge distillation. In _Findings of the Association for Computational Linguistics: ACL 2022_, pages 1672-1681, Dublin, Ireland. Association for Computational Linguistics.
* Tan et al. (2023)Qingyu Tan, Lu Xu, Lidong Bing, and Hwee Tou Ng. 2023. Class-adaptive self-training for relation extraction with incompletely annotated training data. In _Findings of the Association for Computational Linguistics: ACL 2023_, pages 8630-8643, Toronto, Canada. Association for Computational Linguistics.
* addressing the false negative problem in relation extraction. In _Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing_, pages 8472-8487, Abu Dhabi, United Arab Emirates. Association for Computational Linguistics.
* Touvron et al. (2021)Hugo Touvron, Louis Martin, Kevin Stone, Peter Albert, Amjad Almhairi, Yasmine Babaei, Nikolay Bashlykov, Soumya Batra, Prajwal Bhargava, Shruti Bhosale, Dan Bikel, Lukas Blecher, Cristian Canton Ferrer, Moya Chen, Guillem Cucurull, David Esibou, Jude Fernandes, Jeremy Fu, Wenyin Fu, Brian Fuller, Cynthia Gao, Vedany Goswami, Naman Goyal, Anthony Hartshorn, Saghar Hosseini, Rui Hou, Hakan Inanc, Marcin Kardas, Viktor Kerkez, Madian Khabsa, Isabel Kloumann, Artem Korenev, Punit Singh Koura, Marie-Anne Lachaux, Thibaut Lavril, Jenya Lee,iana Liskovich, Yinghai Lu, Yuning Mao, Xavier Martinet, Todor Mihalyo, Pushkar Mishra, Igor Molbyg, Yixin Nie, Andrew Poulton, Jeremy Reizenstein, Rashi Rungtu, Kalyan Saladi, Alan Schelten, Ruan Silva, Eric Michael Smith, Ranjan Subramanian, Xiaoqing Ellen Tan, Binh Tang, Ross Taylor, Adina Williams, Jian Xiang Kuan, Purxin Xu, Zheng Yan, Iliyan Zarov, Yuchen Zhang, Angela Fan, Melanie Lambadur, Sharan Narang, Aurelien Rodriguez, Robert Stojnic, Sergey Edunov, and Thomas Sciandom. 2023. Llama 2: Open foundation and fine-tuned chat models.
* Vu et al. (2021)Tu Vu, Minh-Thang Luong, Quoc Le, Grady Simon, and Mohit Iyyer. 2021. STraTA: Self-training with task augmentation for better few-shot learning. In _Proceeds of the 2021 Conference on Empirical Methods in Natural Language Processing_, pages 5715-5731, Online and Punta Cana, Dominican Republic. Association for Computational Linguistics.
* Wang et al. (2022) Ye Wang, Xinxin Liu, Wenzn Hu, and Tao Zhang. 2022. A unified positive-unlabeled learning framework for document-level relation extraction with different levels of labeling. In _Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing_, pages 4123-4135, Abu Dhabi, United Arab Emirates. Association for Computational Linguistics.
* Wei et al. (2021) Colin Wei, Kendrick Shen, Yining Chen, and Tengyu Ma. 2021. Theoretical analysis of self-training with deep networks on unlabeled data. In _International Conference on Learning Representations_.
* Wolf et al. (2020)Thomas Wolf, Lysandre Debut, Victor Sanh, Julien Chaumond, Clement Delangue, Anthony Moi, Pieric Cistac, Tim Rault, Remi Louf, Morgan Funtowicz, Joe Davison, Sam Sheifer, Patrick von Platen, Clara Ma, Yacine Jernite, Julien Phu, Canwen Xu, Teven Le Scao, Sylvain Gugger, Mariama Drame, Quentin Lhoest, and Alexander M. Rush. 2020. Transformers: State-of-the-art natural language processing. In _Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing: System Demonstrations_, pages 38-45, Online. Association for Computational Linguistics.
* Xu et al. (2023)Benfeng Xu, Quan Wang, Yajuan Lyu, Dai Dai, Yongdong Zhang, and Zhendong Mao. 2023. S2ynRE: 

Two-stage self-training with synthetic data for low-resource relation extraction. In Proceedings of the 61st Annual Meeting of the Association for Computational Linguistics, Toronto, Canada, pp. 8186-8207. External Links: Link Cited by: SS4.
* I. Yamada, A. Asai, H. Shindo, H. Takeda, and Y. Matsumoto (2020)LUKE: deep contextualized entity representations with entity-aware self-attention. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), Online, pp. 6442-6454. External Links: Link, Document Cited by: SS3.
* Y. Yao, D. Ye, P. Li, X. Han, Y. Lin, Z. Liu, Z. Liu, L. Huang, J. Zhou, and M. Sun (2019)DocRED: a large-scale document-level relation extraction dataset. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, Florence, Italy, pp. 764-777. External Links: Link, Document Cited by: SS4.
* D. Yarowsky (1995)Unsupervised word sense disambiguation rivaling supervised methods. In 33rd annual meeting of the association for computational linguistics, pp. 189-196. Cited by: SS4.
* Junjie Yu, X. Wang, J. Zhao, C. Yang, and W. Chen (2022)STAD: self-training with ambiguous data for low-resource relation extraction. In Proceedings of the 29th International Conference on Computational Linguistics, Gyeongju, Republic, pp. 2044-2054. External Links: Link, Document Cited by: SS4.
* Dongxu Zhang, S. Mohan, M. Torkar, and A. McCallum (2022a)A distant supervision corpus for extracting biomedical relationships between chemicals, diseases and genes. In Proceedings of The 13th Language Resources and Evaluation Conference, Marseille, France, pp. 220-223. External Links: Link, Document Cited by: SS4.
* N. Zhang, X. Chen, X. Xie, S. Deng, C. Tan, M. Chen, F. Huang, L. Si, and H. Chen (2021)Document-level relation extraction as semantic segmentation. In Proceedings of the Thirtieth International Joint Conference on Artificial Intelligence, IJCAI-21, pp. 3999-4006. External Links: Link, Document Cited by: SS4.
* S. Zhang, M. Wang, S. Liu, P. Chen, and J. Xiong (2022b)How unlabeled data improve generalization in self-training? a one-hidden-layer theoretical analysis. In International Conference on Learning Representations, Cited by: SS4.
* Y. Zhang, V. Zhong, D. Chen, G. Angeli, and C. D. Manning (2017)Position-aware attention and supervised data improve slot filling. In Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing, Copenhagen, Denmark, pp. 35-45. External Links: Link, Document Cited by: SS4.
* Y. Zhao, M. Khalman, R. Joshi, S. Narayan, M. Saleh, and P. J. Liu (2023)Calibrating sequence likelihood improves conditional language generation. In The Eleventh International Conference on Learning Representations, Cited by: SS4.
* W. Zhou, K. Huang, T. Ma, and J. Huang (2021)Document-level relation extraction with adaptive thresholding and localized context pooling. In Proceedings of the AAAI Conference on Artificial Intelligence, 

Detailed Setting

### Implementation Details

We use pre-trained Flan-T5-base Chung et al. (2022) as the encoder and decoder of our DuRE model, more suitable for our joint classification and generation schema.

We tuned all hyperparameters only on the held-out development set. In self-training phase, we tuned \(\lambda_{c}\in\{1,5,10\}\), \(\alpha\in\{0.5,0.7,1.0\}\), and \(\beta\in\{0.1,0.3,0.5\}\) in Re-DocRED dataset to obtain the reported results. Finally, we set \(\lambda_{c}=5\) and \(\lambda_{g}=1\) in base-model training phase, while \(\lambda_{c}=5\), \(\lambda_{g}=1\), \(\alpha=0.7\), and \(\beta=0.3\) in the self-training phase. We tuned the hyperparameters in Re-DocRED dataset and applied them to all tasks. We use AdamW Loshchilov and Hutter (2019) as an optimizer. The training batch size is 8, and the learning rate is \(5e-5\). We apply linear warmup to the optimizer, and the warmup ratio is 0.06.

We implement DuRE on Huggingface Transformers Wolf et al. (2020) library of v4.31.1 and use four NVIDIA Tesla V100 nodes to train our model. The total number of training hours is around 39.62h for Re-DocRED and 34.54h for CDG(5%). The number of parameters of our model is 242.91M. In the generation phase, we use top-\(p\) sampling (\(p=0.9\)) as the decoding method. Other configuration of the generator includes a length penalty to be 1.0 and a repetition penalty to be 1.0 for all baselines. All experimental results are trained and tested in a single run with fixed random seeds.

For the number of pseudo text generated, following Feng et al. (2023b), we choose the same number as the labeled training set. The prompt for generation is _Generate text given the following relation triples_. An example of generation input could be _Generate text given the following relation triples. * The Invisible Man*, lyrics by, * Roger Taylor*_. For each input triple, we sample 8 sentences and apply the RE classifier to select positive and negative pseudo texts among these samples.

### Generation Evaluation Metric Details

We set the minimum generation length to 100. We evaluate NLG quality on the following metrics:

**Fluency:** We evaluate generation fluency by the perplexity of generated text measured by GPT2-XL Radford et al. (2019), _i.e._, **Output PPL**.

**Controllability:** We evaluate the control accuracy through classification performance (accuracy (Acc) ) on the generated text by our DuRE RE classifier.

**Diversity:** To evaluate the diversity of generated text, we consider **Dist-n**Li et al. (2016): the percentage of distinct n-grams on generated samples. We evaluate on \(n=1,2,3,4\) and compute the geometric mean as **Dist. Dist** emphasizes the amount of novel n-grams within every generation.

Among all the above metrics, F1 and Dist-n are reported as 100 times their original value for convenience.

### Baseline Details

We compare our model with the following strong document-level RE baselines, including both supervised and semi-supervised.

AtlopZhou et al. (2021) A vanilla baseline model for document-level RE. We use bert-basedDevlin et al. (2019) encoder in Re-DocRED dataset and Pubmed-Bert-baseGu et al. (2021) encoder in CDG dataset.

ATlop-FlanOnly use Flan-T5Chung et al. (2022) Encoder to train the RE classifier without generator.

ATlop-DualSimultaneously train RE classifier given input documents and text generator given relation triples but without self-training.

Negative Sampling (NS)Li et al. (2021) This method tackles the incomplete annotation problem through negative sampling. To alleviate the effects of false negatives, this method randomly selects partial negative samples for training. Such an approach can help to alleviate the detrimental effect of the false negative problem.

Vanilla Self-Training (VST)Peng et al. (2019); Jie et al. (2019) VST is a variant of simple self-training. In this approach, models are trained with \(N\) folds, and all pseudo-labels are directly combined with the original labels. Then, a new model is trained on the dataset with combined labels.

SSR Positive Unlabeled Learning (SSR-PU) Wang et al. (2022) This method applies a positive unlabeled learning algorithm for document-level RE under the incomplete annotation scenario. SSR-PU utilizes a shift-and-squared ranking (SSR) loss to accommodate the distribution shifts for the unlabeled examples 



### Class Re-balancing Self-Training (CREST)

Wei et al. (2021) This algorithm re-samples the pseudo-labels generated by models based on the frequencies of the training samples.

#### Class-Adaptive Self-Training(CAST)

Tan et al. (2023) This method calculates the precision and recall scores of each class on the development set and uses the calculated scores to compute the sampling probability of each class to alleviate confirmation bias caused by erroneous pseudo labels.

## Appendix B Additional experimental results

### Performance of Generation Model

To evaluate the quality of generated pseudo text, we measure generation fluency (perplexity, PPL), faithfulness (accuracy of generated text followed by given prompts, Acc), and diversity (number of distinct n-grams, DIST). Details of generation metrics are described in the appendix. We measured different types of samples: random, positive, and negative. The result is shown in Table B1. We found that our generator improves all metrics through dual self-training. Also, the generation fluency is comparable to the testing set. Besides, the diversity of DuRE also improves thanks to the use of more unlabeled text. However, the diversity of generation is still worse than the testing set due to the restricted model size.

### Full Ablation Study Results

Full table of ablation study at Tab. B2.

## Appendix C More Examples of Generation

We sample some generated texts given long-tail relations in Re-DocRED dataset. Table C reports the positive and negative examples generated by our DuRE model. We can find out that even if the relations are long-tail and might not be recognized by our RE classifier, positive examples still contain the relation triples, while some negative examples no longer contain the given relation triples. Learning the contrastive loss helps the generator learn more faithful examples, and thus improves the quality of pseudo training data for RE classifier. This can explain why generated pseudo text for long-tail relations can still be helpful in improving the F1 scores.





\begin{table}
\begin{tabular}{l c c c c c c} \hline \hline
**Model** & **P** & **R** & **F1** & **Ign_F1** & **Freq_F1** & **LT\_F1** \\ \hline DuRE & 80.01 & 73.84 & 76.84 & 75.32 & 79.81 & 72.88 \\ DuRE \(-\)SAG & 79.51 & 73.24 & 76.24 & 75.02 & 79.71 & 70.68 \\ DuRE \(-\)CL & 80.44 & 71.43 & 75.67 & 74.04 & 79.24 & 69.90 \\ DuRE \(-\)PT & 80.04 & 70.35 & 74.88 & 73.72 & 79.14 & 67.88 \\ DuRE \(-\)PL & 82.71 & 66.53 & 73.75 & 72.79 & 77.81 & 67.20 \\ DuRE \(-\)PL\(-\)PT & 85.17 & 61.93 & 71.72 & 70.95 & 76.07 & 64.70 \\ \hline \hline \end{tabular}
\end{table}
Table B2: Full ablation study results on Re-DocRED dataset. Here \(-\) means removing components from DuRE. \(-\)SAG: remove the self-adaptive generation strategy and sample pseudo texts for different classes in the same setting. \(-\)CL: do not generate positive/negative examples and sample random examples. \(-\)PT/\(-\)PL: do not use pseudo text/labels.



* [25] A. K. S. G. T. Jones, and J. M. R. H. Strogatz, "A review of the relationship between the two-level and three-level relationships in a social network," _Journal of Economic Behavior_**106**, 379-484, 2000.

[MISSING_PAGE_POST]