Sebis at SemEval-2023 Task 7: A Joint System for Natural Language Inference and Evidence Retrieval from Clinical Trial Reports
Year: 2023

Abstract:
With the increasing number of clinical trial reports generated every day, it is becoming hard to keep up with novel discoveries that inform evidence-based healthcare recommendations. To help automate this process and assist medical experts, NLP solutions are being developed. This motivated the SemEval-2023 Task 7, where the goal was to develop an NLP system for two tasks: evidence retrieval and natural language inference from clinical trial data. In this paper, we describe our two developed systems. The first one is a pipeline system that models the two tasks separately, while the second one is a joint system that learns the two tasks simultaneously with a shared representation and a multi-task learning approach. The final system combines their outputs in an ensemble system. We formalize the models, present their characteristics and challenges, and provide an analysis of achieved results. Our system ranked 3rd out of 40 participants with a final submission.

heading: 1 Introduction
text: Clinical trials are research studies carried out in human subjects to assess the effectiveness and safety of medical, surgical, or behavioral interventions (Friedman et al., 2015). These investigations constitute the main approach that medical researchers use to determine whether a novel treatment such as a new medication, procedure, diet, or medical device is safe and efficient in humans. Clinical trials are often used to compare the effectiveness of a new treatment against the standard treatment or placebo treatment and to assess its adverse effects. When performed rigorously, clinical trials present the most valuable resource for informing evidence-based healthcare decisions.
On average, more than 100 reports of CTs are published every day (Zarin et al., 2019). Keeping up with all their results and novel discoveries is a time-consuming and often practically impossible endeavor. This has brought to light dedicated
organizations, such as Cochrane,1 that manually synthesize these clinical outcomes (Higgins et al., 2019). Nevertheless, they struggle to keep up with the ever-increasing amount of literature and new studies. For this purpose, automated approaches based on Machine Learning (ML) and Natural Language Processing (NLP) can be developed to facilitate the process of inferring new knowledge and finding evidence from clinical trial reports.
The SemEval-2023 Task 7, titled Multi-evidence Natural Language Inference for Clinical Trial Data (NLI4CT), focused on developing NLP systems for making conclusions and finding evidence in clinical trial reports (CTRs) (Jullien et al., 2023). It featured two subtasks that were strongly coupled together. The first subtask was, given a clinical trial document and a claim, to develop a model that infers a logical relation between them, namely either ENTAILMENT or CONTRADICTION. The second subtask was, given all the sentences in the clinical
1https://www.cochranelibrary.com
1863
trial document, to develop a model that selects a subset of those sentences that serve as evidence for making a decision on the logical entailment relation between the claim and the document. The task is illustrated in Figure 1. It shows two different claims, each coupled with an excerpt from a clinical trial report and a gold final label. The gold evidence sentences are highlighted for emphasis.
For this task, we developed two competitive NLP systems. The first one is a pipeline system, which learns to perform the tasks of evidence retrieval and textual entailment separately and takes into account one sentence at a time during the evidence selection process. The second approach is a joint system, which jointly learns the two subtasks with a unified representation of a claim and the whole document, and uses a shared training procedure. The joint system performed better on the test set, but the final system is an ensemble system that utilizes the power of both systems by combining their outputs with an averaging function. Our final system achieved the 3rd place in the competition out of 40 submitting participants. We provide the code of our system in a GitHub repository.2

heading: 2 Related Work
text: The task of Natural Language Inference (NLI) consists of inferring whether there is logical entailment or contradiction between two pieces of text – a premise and a hypothesis. It has been researched since the early days of NLP when it was mostly tackled with rule-based and linguistically informed approaches (MacCartney, 2009). A big surge of interest in the task occurred after the release of the SNLI dataset (Bowman et al., 2015), as well as follow-up datasets like MultiNLI (MNLI) (Williams et al., 2018) and AdversarialNLI (ANLI) (Nie et al., 2020). The task has also been researched in the clinical domain – the dataset MedNLI (Romanov and Shivade, 2018) features more than 14,000 pairs of claims from clinical notes and patient records, extracted from the MIMIC-III database (Johnson et al., 2016).
The task of evidence retrieval, or more precisely evidence sentence selection, has been studied as a step in common NLP tasks like Machine Reading Comprehension (MRC) (Wang et al., 2019) and Question Answering (QA) (Thayaparan et al., 2021). Its main purpose is to improve the explainability and interpretability of models’ predictions
2https://github.com/jvladika/NLI4CT
but also to aid its reasoning process for making decisions. Combining the steps of evidence retrieval and textual entailment recognition comprises the task of automated fact-checking or claim verification, where the goal is to assess a claim’s veracity based on the evidence related to it (Guo et al., 2022). This task has mostly been concerned with verifying claims related to news events, society, and politics, but has been increasingly so researched in scientific, biomedical, and clinical domains (Wadden et al., 2020; Sarrouti et al., 2021).

heading: 3 Dataset
text: The clinical trials used for constructing the dataset originate from ClinicalTrials.gov,3 a database of privately and publicly funded clinical studies conducted around the world, run by the U.S. National Library of Medicine. All the clinical trial reports in the dataset are related to breast cancer and are written in English. There is a total of 1,200 clinical trials and 2,400 corresponding claims related to these CTRs, which were written and annotated by clinical domain experts, clinical trial organizers, and research oncologists.
For the task, each CTR may contain 1-2 patient groups, called cohorts or arms, and these groups may receive different treatments, or have different baseline characteristics. The dataset consists of a total of 2,400 claims and was split into a training dataset of 1,700 claims, a development dataset of 200 claims, and a hidden test dataset of 500 claims. There are two types of claims, those related only to a single CTR and other ones related to two CTRs, which usually make some form of comparison between the two reports. Each of the claims is related to only one of the following four sections:
• Eligibility Criteria. A set of conditions for patients to be allowed to take part in the clinical trial, such as age, gender, medical history.
• Intervention: Information concerning the type, dosage, frequency, and duration of treatments being studied in the clinical trial.
• Results: Reports the outcome of the trial with data like the number of participants, outcome measures, units, and results.
• Adverse Events: These are any unwanted side effects, signs, or symptoms observed in patients during the clinical trial.
3https://clinicaltrials.gov

heading: 4 System Description
text: In this chapter, we will describe the architecture of the developed systems and the choice of base models comprising the systems. Even though the task features two standalone subtasks and participating in each of them was optional, we found the best synergy is achieved by combining them. The selection of appropriate evidence sentences in subtask 2 is an important prerequisite for recognizing textual entailment in subtask 1. This is because most textual entailment datasets used for training the NLI systems are modeled to recognize entailment between two sentences only, so the performance between a sentence and a whole document is still underwhelming (Schuster et al., 2022). Therefore, it was important to narrow down the whole document to a shorter span of text with only the relevant evidence sentences.

heading: 4.1 Pipeline Systems
text: In the pipeline system, the evidence sentences selected by the first model are used as the input for veracity prediction to the next model. Using the standard terminology from computer science, we call these systems pipeline systems. It is also common to use the same underlying base model in both steps and fine-tune it for these two different tasks (DeYoung et al., 2020).
To formalize the approach, we will define it mathematically. Given a claim c and n sentences s1, s2, ..., sn that constitute the clinical trial report, the goal is to train a model that predicts
zi = 1[si is an evidence sentence].
This is modeled as a binary sequence classification task, where candidate sequences are a concatenation of a candidate sentence si and the claim c in the form of ai = [si;SEP ; c]. Each of these sequences is encoded with the base language model to obtain their dense representation hi = BERT (ai). This representation is then fed to a classifier model, Multi-Layer Perceptron (MLP), and its output is passed to a softmax function that assigns the probabilities on whether the candidate sentence is or is not the evidence:
pi, p̄i = softmax(MLP (hi)).
Finally, a selector function labels those sentences with a probability over a threshold to be evidence sentences – this threshold is a hyperparameter that
can be learned, such as zi = pi > 0.5. In the end, the model has selected k final evidence sentences e1, e2, ..., ek that are used as input for the next step.
The task of textual entailment is again a binary classification task that for a given claim c and k evidence sentences e1, e2, ..., ek predicts the logical relation of either ENTAILMENT or CONTRADICTION. Using the standard terminology of Natural Language Inference, the claim c is the hypothesis, and the concatenation of evidence sentences e = [e1; e2; ...; ek] is the premise. These two are concatenated as x = [c;SEP ; e] and once again passed to the base language model to obtain the dense embedding w = BERT (x). The model has to learn the function
ŷ(c; e) = softmax(MLP (w)),
which is the probability distribution of each inference label for the claim c given evidence e. The class with the highest probability score is selected as the final verdict v(c; e) = argmax(y).

heading: 4.2 Joint Systems
text: The second system we developed jointly learns both the tasks of evidence retrieval and textual entailment. This leverages the machine-learning technique of multi-task learning (MTL), which was shown to be data efficient and improve the performance of each individual task it learns on through shared representations (Crawshaw, 2020). Intuitively, the model improves the performance on both tasks simultaneously since selecting high-quality evidence is important for recognizing entailment and conversely, the final entailment/contradiction label influences the specific evidence to be selected.
Unlike in the pipeline system, where each sequence consisted only of one candidate sentence and the claim, here the claim c is concatenated together with all of the sentences s1, s2, ..., sn in the clinical trial document to obtain a claimdocument sequence seq = [c;SEP ; s1;SEP ; s2; ...;SEP ; sn].4 This approach makes the representation of each candidate sentence aware of the context it appears in with regard to the rest of the document, as well as aware of the claim itself. This sequence is fed to the base language model to obtain a dense representation h =
4Considering the input sequence length limitation of large language models, this sequence has to be truncated to 512 or 1024 tokens, which is good enough for the vast majority of documents in the dataset.
BERT (seq) = [hc;SEP ;hs1 ; ... : SEP ;hsn ]. The representation of each candidate sentence hsi = [hw1 , hw2 , ..., hwm ] is singled out from the initial representation and passed to a binary linear classifier that, similarly to the one in the pipeline system, calculates the probabilities of the sentence being an evidence sentence:
pi, p̄i = softmax(MLP (hsi)).
Those sentences that are above the 0.5 threshold are then selected as evidence sentences and concatenated together to form the final evidence representation he = [he1 , he2 , ..., hek ]. This representation is given to a final ternary linear classifier, that same as in the pipeline system predicts the verdict
v = argmax(softmax(MLP (he))).
Note that the representation of the claim hc is not passed anywhere because the idea is for evidence sentences to already be aware of the semantics of the claim from the joint claim-document representation.

heading: 4.3 Ensemble System
text: After developing the pipeline system and the joint system, we ended up with the best-performing systems on the two tasks in each category of systems. These best systems were singled out and their outputs were combined for the final system. This type of approach is usually called a stacked (Pavlyshenko, 2018) or an ensemble system (Ganaie et al., 2021) and has been proven to perform well in machine-learning shared tasks and competitions.
Considering that the outputs of the two systems are different in certain predictions because of different output probabilities of classes, we decided to average the probabilities of each of the systems
with appropriate weights. After experimenting with different weights, the final function was:
pfinal = 0.4 · ppipeline + 0.6 · pjoint.

heading: 4.4 Base Models
text: Both of the components constituting the system use an underlying base model. We opt for large pre-trained language models (PLMs) since they represent the state of the art in virtually all NLP tasks. We experimented with a number of different base models. BERT (Devlin et al., 2019) is used as the representative vanilla PLM, which gives good initial insight into the performance of PLMs on the task. Over the years, there have been multiple domain-specific variations of the BERT model, specialized for text in the scientific, biomedical, or clinical domains. BioBERT (Lee et al., 2020) was fine-tuned on abstracts of biomedical scientific publications. ClinicalBERT (Alsentzer et al., 2019) is a model fine-tuned on MIMIC-III database, a database of electronic health records and clinical notes of patients admitted to critical care units. UmlsBERT (Michalopoulos et al., 2020) moves further away from unstructured text and injects structured domain knowledge, from UMLS (Bodenreider, 2004) – a large knowledge base of biomedical concepts and semantic relations between them, into the model training process.
DeBERTa (He et al., 2021b) is an improved extension of the BERT model that introduced disentangled attention and enhanced masked decoder, which both amplify the importance of positional embedding of tokens in a sequence. The DeBERTav3 (He et al., 2021a) is a novel version of the model that uses the task of replaced token detection (RTD) instead of predicting masked tokens. It was the first model to beat the human performance on the GLUE benchmark (Wang et al., 2018) for natural language understanding tasks. For compari-
son, we include other models that excel in NLU tasks, namely StructBERT (Wang et al., 2020) and ERNIE (Zhang et al., 2019). In the end, we would like to test whether the models highly specialized for inference and textual entailment tasks beat the BERT extension models fine-tuned to biomedical language and knowledge.
The hyperparameters were the same for all models and setups: learning rate 10−5, warmup rate 0.06, weight decay 0.01, epochs 5–7, mixed precision training enabled. For all of the datasets, their Large version was used, imported from the HuggingFace repository.5 The models were additionally fine-tuned on the previously mentioned NLI datasets like MNLI, ANLI, MedNLI, following the approach of Laurer et al. (2022).

heading: 5 Results & Analysis
text: In this section, we report on results achieved by our systems and provide a qualitative error analysis with challenging examples from the dataset.

heading: 5.1 Final Results
text: The results of different base models for the two tasks with the pipeline system are presented in Table 1. These are the results on the dev set considering that this dataset has the revealed truth labels and allowed for an unlimited number of test runs. The results for the evidence retrieval are binary classification metrics, where each candidate sentence was of positive class if it constituted evidence, otherwise of negative class. The results of the textual entailment task are again binary classification metrics for the two classes of entailment and contradiction, using the gold evidence sentences. We found that the model trained on gold evidence performs better on the final test set than the model trained on internally selected evidence sentences.
As visible from Table 1, the NLI task of textual entailment recognition was more challenging than the evidence sentence selection task. The domainspecific biomedical and clinical BERT models outperformed the vanilla BERT model on both tasks, which shows the benefit of pre-training large language models on specialized text for NLP tasks concerning specific domains. The clinical BERT outperforms the BioBERT, which is an expected outcome since it works with clinical trial reports, while UmlsBERT outperforms both, showing the
5For example, DeBERTa-v3-Large is at: https:// huggingface.co/microsoft/deberta-v3-large
effectiveness of injecting structured knowledge into language models. Nevertheless, by far the bestperforming base model turned out to be DeBERTav3 and it especially excelled in the textual entailment task. Although this was expected considering its proven efficiency on NLU tasks, the sheer margin of difference came as a surprise.
The joint systems turned out to perform slightly better on the evidence retrieval task. This was expected considering that it considers the full document when doing the evidence retrieval task, which means each candidate sentence is contextualized with appropriate surroundings around it and was already shown to perform well in evidence selection for fact-verification datasets (Stammbach, 2021). Considering the long training times of the joint system, since it uses dense representations of full documents which can be up to 1024 tokens, we narrowed it down to just using DeBERTa as the underlying base model for embedding generation. The scores of the best-performing pipeline and bestperforming joint system on the hidden test set are shown in Table 2. The outputs of these two systems were averaged with appropriate weights to obtain the final ensemble submission. We performed some additional post-processing such as truncating the selected evidence to a maximum of 20 sentences. This was done due to the tendency of the model to select all the candidate sentences as evidence sentences for claims with quantifiers like at least one, exactly one, none of the patients, etc. Selecting all the sentences incorrectly diminishes precision while increasing recall, but achieving high precision contributed more to the final score and was more challenging in general.

heading: 5.2 Error Analysis
text: To better understand the strengths and weaknesses of our system, we conducted a manual analysis
of predictions on the development set to find out where the final model incorrectly labeled the claims as the opposite class. Table 3 provides five such examples from the dataset. Each example in the table consists of a claim, accompanying evidence sentences, and a gold label assigned to them by the expert annotators. We also identify five different challenges that the model has to tackle in order to be able to correctly classify these claims. These challenges are:
• Commonsense Reasoning. The model has to understand concepts and make judgments about everyday matters, that are common and innate to humans.
• Numerical Reasoning. The model has to be capable of applying basic mathematical operations and grasping comparisons, orders, or quantities.
• Multi-hop Reasoning. In some examples, the model needs to combine multiple pieces of evidence (make multiple "hops") to come to the final conclusion.
• Medical Knowledge. Certain claims rely on expert knowledge of medical concepts and terminology related to the human body, diseases, drugs, or treatments.
• World Knowledge. This type of knowledge refers to the non-linguistic information about the outside world contained in claims.

heading: 6 Conclusion
text: In this paper, we describe our solution for the SemEval-2023 Task 7, dealing with natural language inference and evidence retrieval from clinical trial reports. We motivate the task, discuss related work, provide formal definitions of the developed systems, present the results, analyze the performance of models, and discuss some challenges in the process. We developed two types of systems – a pipeline system, which learns evidence retrieval and textual entailment sequentially, and a joint system, which learns the two tasks simultaneously. The final system combines them into an ensemble and achieved the 3rd place in the competition out of 40 teams with a final submission.
We anticipate this system will be useful for facilitating the work of medical experts in synthesizing the results and outcomes of the ever-increasing amount of clinical trial reports, as well as be used by the NLP community for the related tasks of biomedical question answering, automated claim verification, and recognizing textual entailment. The system could be improved in the future by overcoming the challenges related to commonsense, numerical, and multi-hop reasoning, or by injecting additional medical and world knowledge to it.

heading: Future Work
text: The system could be improved in the future by overcoming the challenges related to commonsense, numerical, and multi-hop reasoning, or by injecting additional medical and world knowledge to it