SlowGuess/NAACL_2022_OCR huggingface dataset:
Among the above RE models, we apply our CoRE on LUKE and IRE. To demonstrate the effectiveness of debiased inference, we also compare
with the following debiasing techniques that are applied to the same two RE models. (1) Focal (Lin et al., 2017) adaptively reweights the losses of different instances so as to focus on the hard ones. (2) Resample (Burnaev et al., 2015) up-samples rare categories by the inversed sample fraction during training. (3) Entity Mask (Zhang et al., 2017): masks the entity mentions with special tokens to reduce the over-fitting on entities. (4) CFIE (Nan et al., 2021) is also a causal inference method. In contrast to our method, CFIE strengthens the causal effects of entities by masking entity-centric information in the counterfactual predictions.
Model configuration. For the hyper-parameters of the considered baseline methods, e.g., the batch size, the number of hidden units, the optimizer, and the learning rate, we set them as suggested by their authors. For the hyper-parameters of our CoRE method, we set the search range of the hypermeters in Eq. 3 as  $[-2, 2]$  and the search step 0.1. For all experiments, we report the median  $F1$  scores of five runs of training using different random seeds.
We implement our CoRE with LUKE and  $\mathrm{IRE}_{\mathrm{RoBERTa}}$ . Tab. 3 reports the RE results on the TACRED, TACRED-Revisit, Re-TACRED, and SemEval datasets. Our CoRE method improves the F1-macro scores of LUKE by  $4.9\%$  on TACRED,  $4.0\%$  on TACRED-Revisit,  $1.7\%$  on Re-TACRED, and 1.7 on SemEval, and improves  $\mathrm{IRE}_{\mathrm{RoBERTa}}$
Method	TACRED	TACRED-Revisit	Re-TACRED	SemEval
LUKE (Yamada et al., 2020)	72.7	80.6	90.3	87.8
LUKE + Resample (Burnaev et al., 2015)	73.1	80.9	90.5	87.9
LUKE + Focal (Lin et al., 2017)	72.9	80.7	90.4	87.6
LUKE + CFIE (Nan et al., 2021)	73.3	80.8	90.5	88.0
LUKE + Entity Mask (Zhang et al., 2017)	72.3	80.4	90.1	87.5
LUKE + CoRE	74.6	81.4	90.9	88.7
Table 3: F1-micro scores (%) of RE on the test sets of TACRED, TACRED-Revisit, Re-TACRED, and SemEval. The best results in each column are highlighted in bold font.
Method	TACRED	Re-TACRED
LUKE (Yamada et al., 2020)	51.9	65.3
w/ Resample (Burnaev et al., 2015)	53.2	66.7
w/ Focal (Lin et al., 2017)	52.4	65.9
w/ CFIE (Nan et al., 2021)	52.1	65.6
w/ Entity Mask (Zhang et al., 2017)	54.5	67.1
w/ CoRE (ours)	69.3	83.1
IRERoBERTa (Zhou and Chen, 2021)	56.4	68.1
w/ Resample (Burnaev et al., 2015)	58.1	70.3
w/ Focal (Lin et al., 2017)	56.8	68.7
w/ CFIE (Nan et al., 2021)	57.1	68.4
w/ Entity Mask (Zhang et al., 2017)	57.3	68.9
w/ CoRE (ours)	73.6	85.4
Table 4: F1-macro scores (\%) of RE on the challenging test sets of TACRED and Re-TACRED, in which the relations implied by the entity mentions do not exist in the textual context. ‘w’ denotes ‘with’. The best results in each column are highlighted in bold font.
by  $1.2\%$  on TACRED,  $1.4\%$  on TACRED-Revisit,  $0.9\%$  on Re-TACRED, and  $1.8\%$  on SemEval. As a result, our CoRE achieves substantial improvements for LUKE and  $\mathrm{IRE}_{\mathrm{RoBERTa}}$ , and enables them to outperform the baseline methods. Additionally, we report the experimental results in terms of F1-micro scores in Tab. 3, showing the improvement from CoRE on LUKE by  $2.6\%$  on TACRED,  $1.0\%$  on TACRED-Revisit,  $0.7\%$  on Re-TACRED, and  $1.0\%$  on SemEval. Overall, our CoRE method improves the effectiveness of RE significantly in terms of both F1-macro and F1-micro scores. The above experimental results validate the effectiveness and generalization of our proposed method.
Among the baseline debiasing methods, Resample, Focal, CFIE cannot distill the entity bias in an entity-aware manner like ours. Entity Mask leads to the loss of information, while our CoRE enables RE models to focus on the main effects of textual context without losing the entity information. The superiority of CoRE highlights the importance of the causal inference based entity bias analysis for debiasing RE, which compares traditional likelihood-based predictions and hypothe
sized counterfactual ones to produce debiased predictions. Besides, the proposed CoRE works in inference and thus can be employed on the previous already-trained models. In this way, CoRE serves as a model-agnostic approach to enhance RE models without changing their training process.
4.3 Analysis on Entity Bias
Some work argues that RE models may rely on the entity mentions to make relation predictions instead of the textual context (Zhang et al., 2018; Joshi et al., 2020). The empirical results in Fig. 3 validate this argument. Regardless of whether the textual context exists or not, the baseline RE model makes the same predictions given only entity mentions on many instances. The entity bias can mislead the RE models to make wrong predictions when the relation implied by the entity mentions does not exist in the textual context.
To evaluate whether RE models can generalize well to particularly challenging instances where relations implied by the entity mentions do not exist in the textual context, we propose a filtered evaluation setting, where we keep the test instances having the entity bias different from their ground-truth relations. In this setting, RE models cannot overly rely on the entity mentions for RE, since the entity mentions no longer provide the superficial and spurious clues for the ground-truth relations.
We present the evaluation results on the filtered test set in Tab. 4. Our CoRE method consistently and substantially improves the effectiveness of LUKE and IRE on the filtered test set and outperforms the baseline methods by a significant margin, which validates the effectiveness and generalization of our method to mitigate the entity bias in the challenging cases.
4.4 Evaluation on Fairness
According to Sweeney and Najafian (2019), the more imbalanced/skewed a prediction produced by a trained model is, the more unfair opportunities it
Method	TACRED	TACRED-Revisit	Re-TACRED	SemEval
IRERoBERTa (Zhou and Chen, 2021)	61.2	59.3	57.5	54.1
IRERoBERTa + Resample (Burnaev et al., 2015)	60.5	58.4	56.8	53.5
IRERoBERTa + Focal (Lin et al., 2017)	60.9	58.9	57.1	53.7
IRERoBERTa + CFIE (Nan et al., 2021)	60.1	57.8	56.2	52.9
IRERoBERTa + Entity Mask (Zhang et al., 2017)	61.5	60.1	57.3	54.2
IRERoBERTa + CORE	57.3	55.6	54.3	50.8
Table 5: Experimental results (unfairness; %) of Relation Extraction on the test sets of TACRED, TACRED-Revisit, Re-TACRED, and SemEval (lower is better). The best results in each column are highlighted in bold font.
LUKE + CoRE	61.7	Δ	IRE + CoRE	64.4	Δ
w/o CoRE	58.8	2.9↓	w/o CoRE	63.1	1.3↓
w/o EBM	59.5	2.2↓	w/o EBM	63.4	1.0↓
w/o LBM	60.8	0.9↓	w/o LBM	63.9	0.5↓
w/o BSH	60.1	1.6↓	w/o BSH	63.8	0.6↓
Table 6: Ablation study based on the TACRED dataset. The analyzed model components include entity bias mitigation operation (EBM), the label bias mitigation operation (LBM) and the beam search for hyper-parameters (BSH). 'w/o' denotes 'without'.  $\downarrow$  denotes performance drop in terms of F1-macro scores.
gives over predefined categories, and the more unfairly discriminative the trained model is. We thus follow previous work (Xiang et al., 2020; Sweeney and Najafian, 2019; Qian et al., 2021) to use the metric - imbalance divergence - to evaluate how imbalanced/skewed/unfair a prediction  $P$  is :
$$
D (P, U) = J S (P \| U), \tag {4}
$$
where  $D(\cdot)$  is defined as the distance between  $P$  and the uniform distribution  $U$ . Specifically, we use the  $JS$  divergence as the distance metric since it is symmetric (i.e.,  $JS(P\| U) = JS(U\| P)$ ) and strictly scoped (Fuglede and Topsoe, 2004). Based on this, to evaluate the entity bias of a trained RE model, we average the following relative entity mention imbalance (REI) measure over all the testing instances containing whichever entity mentions:
$$
\operatorname {R E I} = \frac {1}{\mathcal {E}} \sum_ {e \in \mathcal {E}} D (P (\{x | e \in x \wedge x \in \mathcal {D} \}), U), \tag {5}
$$
where  $x$  is an input instance,  $\mathcal{D}$  is the testing set,  $P(x)$  is the prediction output,  $e$  is an entity mention, and  $\mathcal{E}$  is the corpus of entity mentions. This metric captures the distance between all predictions and the fair uniform distribution  $U$ .
We follow the experimental settings in §4.2 and report the fairness test in Tab. 5. The results show that our CoRE method reduces the imbalance metrics (lower is better) when employed on
$\mathrm{IRE}_{\mathrm{RoBERTa}}$  significantly and consistently, indicating that it is helpful to mitigate the entity bias.
4.5 Ablation and Case Study
We conduct ablation studies on CoRE to empirically examine the contribution of its main technical components. including the entity bias mitigation operation (EBM), the label bias mitigation operation (LBM) and the beam search for hyperparameters (BSH).
We report the experimental results of the ablation study in Tab. 6. We observe that removing our CoRE causes serious performance degradation. This provides evidence that using our counterfactual framework for RE can explicitly mitigate biases to generalize better on unseen examples. Moreover, we observe that mitigating the two types of biases is consistently helpful for RE. The key reason is that the distilled label bias provides an instance-agnostic offset and the distilled entity bias provides an entity-aware one in the prediction space, which makes the RE models focus on extracting relations on the textual context without losing the entity information. Meanwhile, the beam search for hyper-parameters effectively finds two dynamic scaling factors to amplify or shrink two biases, making the biases be mitigated properly and adaptively.
Tab. 7 gives a qualitative comparison example between CoRE and  $\mathrm{IRE}_{\mathrm{RoBERTa}}$  on TACRED. The results show that the state-of-the-art RE model  $\mathrm{IRE}_{\mathrm{RoBERTa}}$  returns the relations that do not exist in the textual context between the considered entities. For example, given "Bibi drew the ire of fellow farmhands after a dispute in June 2009, when they refused to drink water she collected and she refused their demands that she convert to Islam", there is no relation between Bibi and Islam exists in the text but the baseline model believes that the relation between them is "religion". The counterfactual prediction can account for this disappointing result,
Input sentence	Original	Debiased	Counterfactual
More than 1,100 miles (1,770 kilometers) away, Alan Gross passes his days in a Cuban military hospital, watching baseball on a small television or jamming with his jailers on a stringed instrument they gave him.	origin ×	countries_of_residence √	origin
He said that according to his investigation, Bibi drew the ire of fellow farmhands after a dispute in June 2009, when they refused to drink water she collected and she refused their demands that she convert to Islam.	religion ×	no Relation √	religion
ShopperTrak also estimates foot traffic in the U.S. was 11.2 percent below what it would have been Sunday if the blizzard had not occurred and 13.9 percent below what it could have been Monday.	country_of_headquarters ×	no Relation √	country_of_headquarters
Table 7: A case study for  $\mathrm{IRE}_{\mathrm{RoBERTa}}$  and our CORE on the relation extraction dataset TACRED. Underlines and wavy lines highlight the subject and object entities respectively. We report the original prediction, the corresponding counterfactual prediction and the debiased prediction.
where given only the entity mentions Bibi and Islam, the RE model returns the relation "religion" without any textual context. This implies that the model makes the prediction for the original input relying on the entity mentions, which leads to the wrong RE prediction. Our CoRE method distills the biases through counterfactual predictions and mitigates the biases to distinguish the main effects from the textual context, which leads to the correct predictions as shown in Tab. 7.
Last but not least, we conduct experiments on the fairness of different models, and present respective results in the appendix.
We have designed a counterfactual analysis based method named CoRE to debias RE. We distill the entity bias and mitigate the distilled biases with the help of our causal graph for RE, which is a road map for analyzing the RE models. Based on the counterfactual analysis, we can analyze the side-effects of entity mentions in the RE and debias the models in an entity-aware manner. Extensive experiments demonstrate that our methods can improve the effectiveness and generalization of RE. Future work includes analyzing the effects of other factors that can cause bias in natural language processing.
Muhao Chen and Wenxuan Zhou are supported by the National Science Foundation of United States Grant IIS 2105329, and by the DARPA MCS
program under Contract No. N660011924033 with the United States Office Of Naval Research. Except for Muhao Chen and Wenxuan Zhou, this paper is supported by NUS ODPRT Grant R252-000-A81-133 and Singapore Ministry of Education Academic Research Fund Tier 3 under MOEs official grant number MOE2017-T3-1-007.
Christoph Alt, Aleksandra Gabryszak, and Leonhard Hennig. 2020. TACRED revisited: A thorough evaluation of the TACRED relation extraction task. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 1558-1569, Online. Association for Computational Linguistics.
Evgeny Burnaev, Pavel Erofeev, and Artem Papanov. 2015. Influence of resampling on accuracy of imbalanced classification. In *Eighth international conference on machine vision (ICMV 2015)*, volume 9875, page 987521. International Society for Optics and Photonics.
Xiang Chen, Ningyu Zhang, Xin Xie, Shumin Deng, Yunzhi Yao, Chuanqi Tan, Fei Huang, Luo Si, and Huajun Chen. 2021. Knowprompt: Knowledge-aware prompt-tuning with synergistic optimization for relation extraction.
Bayu Distiawan, Gerhard Weikum, Jianzhong Qi, and Rui Zhang. 2019. Neural relation extraction for knowledge base enrichment. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 229-240.
Lucas Dixon, John Li, Jeffrey Sorensen, Nithum Thain, and Lucy Vasserman. 2018. Measuring and mitigating unintended bias in text classification. In Proceedings of the 2018 AAAI/ACM Conference on AI, Ethics, and Society, pages 67-73.
Bent Fuglede and Flemming Topsoe. 2004. Jensenshannon divergence and hilbert space embedding. In International Symposium on Information Theory, 2004. ISIT 2004. Proceedings., page 31. IEEE.
Guang-Gang Geng, Chun-Heng Wang, Qiu-Dan Li, Lei Xu, and Xiao-Bo Jin. 2007. Boosting the performance of web spam detection with ensemble undersampling classification. In Fourth International Conference on Fuzzy Systems and Knowledge Discovery (FSKD 2007), volume 4, pages 583-587. IEEE.
Iris Hendrickx, Su Nam Kim, Zornitsa Kozareva, Preslav Nakov, Diarmuid O Seaghdha, Sebastian Padó, Marco Pennacchiotti, Lorenza Romano, and Stan Szpakowicz. 2019. Semeval-2010 task 8: Multiway classification of semantic relations between pairs of nominals. arXiv preprint arXiv:1911.10422.
Chris Hokamp and Qun Liu. 2017. Lexically constrained decoding for sequence generation using grid beam search. arXiv preprint arXiv:1704.07138.
Mandar Joshi, Danqi Chen, Yinhan Liu, Daniel S. Weld, Luke Zettlemoyer, and Omer Levy. 2020. SpanBERT: Improving pre-training by representing and predicting spans. Transactions of the Association for Computational Linguistics, 8:64-77.
Qi Kang, XiaoShuang Chen, SiSi Li, and MengChu Zhou. 2016. A noise-filtered under-sampling scheme for imbalanced classification. IEEE transactions on cybernetics, 47(12):4263-4274.
Kang-Min Kim, Yeachan Kim, Jungho Lee, Ji-Min Lee, and SangKeun Lee. 2019. From small-scale to large-scale text classification. In The World Wide Web Conference, pages 853-862.
Tsung-Yi Lin, Priya Goyal, Ross Girshick, Kaiming He, and Piotr Dólar. 2017. Focal loss for dense object detection. In Proceedings of the IEEE international conference on computer vision, pages 2980-2988.
Yinhan Liu, Myle Ott, Naman Goyal, Jingfei Du, Mandar Joshi, Danqi Chen, Omer Levy, Mike Lewis, Luke Zettlemoyer, and Veselin Stoyanov. 2019. Roberta: A robustly optimized bert pretraining approach. arXiv preprint arXiv:1907.11692.
Shengfei Lyu and Huanhuan Chen. 2021. Relation classification with entity type restriction. arXiv preprint arXiv:2105.08393.
Guoshun Nan, Jiaqi Zeng, Rui Qiao, Zhijiang Guo, and Wei Lu. 2021. Uncovering main causalities for long-tailed information extraction. arXiv preprint arXiv:2109.05213.
Hien M Nguyen, Eric W Cooper, and Katsuari Kamei. 2011. Borderline over-sampling for imbalanced data classification. International Journal of Knowledge Engineering and Soft Data Paradigms, 3(1):4-21.
Thien Huu Nguyen and Ralph Grishman. 2015. Relation extraction: Perspective from convolutional neural networks. In Proceedings of the 1st Workshop on Vector Space Modeling for Natural Language Processing, pages 39-48, Denver, Colorado. Association for Computational Linguistics.
Judea Pearl. 2009. Causality. Cambridge university press.
Judea Pearl. 2018. Causal and counterfactual inference. The Handbook of Rationality, pages 1-41.
Judea Pearl, Madelyn Glymour, and Nicholas P Jewell. 2016. Causal inference in statistics: A primer. John Wiley & Sons.
Judea Pearl and Dana Mackenzie. 2018. The book of why: the new science of cause and effect. Basic books.
Hao Peng, Tianyu Gao, Xu Han, Yankai Lin, Peng Li, Zhiyuan Liu, Maosong Sun, and Jie Zhou. 2020. Learning from context or names? an empirical study on neural relation extraction. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 3661-3672.
Chen Qian, Fuli Feng, Lijie Wen, Li Lin, and Tat-Seng Chua. 2020. Enhancing text classification via discovering additional semantic clues from logograms. In Proceedings of the 43rd International ACM SIGIR Conference on Research and Development in Information Retrieval, pages 1201-1210.
Chen Qian, Fuli Feng, Lijie Wen, Chunping Ma, and Pengjun Xie. 2021. Counterfactual inference for text classification debiasing. In Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing (Volume 1: Long Papers), pages 5434-5445.
Farshid Rayhan, Sajid Ahmed, Asif Mahbub, Rafsan Jani, Swakkhar Shatabda, and Dewan Md Farid. 2017. Cusboost: Cluster-based under-sampling with boosting for imbalanced classification. In 2017 2nd International Conference on Computational Systems and Information Technology for Sustainable Solution (CSITSS), pages 1-5. IEEE.
George Stoica, Emmanouil Antonios Platanios, and Barnabás Póczos. 2021. Re-tacred: Addressing shortcomings of the tacred dataset. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 35, pages 13843-13850.
Chris Sweeney and Maryam Najafian. 2019. A transparent framework for evaluating unintended demographic bias in word embeddings. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 1662-1667.
Kaihua Tang, Yulei Niu, Jianqiang Huang, Jiaxin Shi, and Hanwang Zhang. 2020. Unbiased scene graph generation from biased training. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 3716-3725.
Antonio Torralba and Alexei A Efros. 2011. Unbiased look at dataset bias. In CVPR 2011, pages 1521-1528. IEEE.
Nicole Van Hoeck, Patrick D Watson, and Aron K Barbey. 2015. Cognitive neuroscience of human counterfactual reasoning. Frontiers in human neuroscience, 9:420.
Tyler VanderWeele. 2015. Explanation in causal inference: methods for mediation and interaction. Oxford University Press.
Linlin Wang, Zhu Cao, Gerard de Melo, and Zhiyuan Liu. 2016. Relation classification via multi-level attention CNNs. In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 1298-1307, Berlin, Germany. Association for Computational Linguistics.
Ruize Wang, Duyu Tang, Nan Duan, Zhongyu Wei, Xuanjing Huang, Guihong Cao, Daxin Jiang, Ming Zhou, et al. 2020. K-adapter: Infusing knowledge into pre-trained models with adapters. arXiv preprint arXiv:2002.01808.
Jason Wei and Kai Zou. 2019. Eda: Easy data augmentation techniques for boosting performance on text classification tasks. arXiv preprint arXiv:1901.11196.
Felix Wu, Amauri Souza, Tianyi Zhang, Christopher Fifty, Tao Yu, and Kilian Weinberger. 2019. Simplifying graph convolutional networks. In International conference on machine learning, pages 6861-6871. PMLR.
Liuyu Xiang, Guiguang Ding, and Jungong Han. 2020. Learning from multiple experts: Self-paced knowledge distillation for long-tailed classification. In European Conference on Computer Vision, pages 247-263. Springer.
Ikuya Yamada, Akari Asai, Hiroyuki Shindo, Hideaki Takeda, and Yuji 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), pages 6442-6454, Online. Association for Computational Linguistics.
Yuhao Zhang, Peng Qi, and Christopher D. Manning. 2018. Graph convolution over pruned dependency trees improves relation extraction. In Proceedings of
the 2018 Conference on Empirical Methods in Natural Language Processing, pages 2205-2215, Brussels, Belgium. Association for Computational Linguistics.
Yuhao Zhang, Victor Zhong, Danqi Chen, Gabor Angeli, and Christopher 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, pages 35-45.
Wenxuan Zhou and Muhao Chen. 2021. An improved baseline for sentence-level relation extraction. arXiv preprint arXiv:2102.01373.