Pre-training data selection for biomedical domain adaptation using journal impact metrics
Mathieu Laï-king Patrick Paroubek

Reply to Comment on “A slightly oblate dark matter halo revealed by a retrograde precessing Galactic disk warp"
    Haibo Yuan
    September 9, 2024
===============================================================================================================

§ ABSTRACT 
Domain adaptation is a widely used method in natural language processing (NLP) to improve the performance of a language model within a specific domain. This method is particularly common in the biomedical domain, which sees regular publication of numerous scientific articles. PubMed, a significant corpus of text, is frequently used in the biomedical domain. The primary objective of this study is to explore whether refining a pre-training dataset using specific quality metrics for scientific papers can enhance the performance of the resulting model. To accomplish this, we employ two straightforward journal impact metrics and conduct experiments by continually pre-training BERT on various subsets of the complete PubMed training set, we then evaluate the resulting models on biomedical language understanding tasks from the BLURB benchmark. Our results show that pruning using journal impact metrics is not efficient. But we also show that pre-training using fewer abstracts (but with the same number of training steps) does not necessarily decrease the resulting model's performance.




§ INTRODUCTION

Advances in deep learning for natural language processing (NLP) in recent years have enabled transfer learning to develop <cit.>, particularly since the creation of Transformers <cit.>. 

One type of transfer learning aims to start with a pre-training phase where the model learns the general language structure and then a second phase where the model can be fine-tuned for a specific task. In the context of deep learning for NLP, this method avoids re-training a model from scratch for each new task, starting with a model that already has general language knowledge. These pre-trained models generally use a large corpus of text.

A specialized domain, such as finance or the biomedical domain, may contain numerous tasks. In the case of language, a specialized domain has a specific vocabulary containing terms more rarely found in general texts. We can observe this phenomenon when looking at tokens produced by a biomedical tokenizer against a general tokenizer <cit.>. Moreover, tasks may require domain-specific knowledge not found in general sources. So, to improve the performance of a model previously trained on a general domain to a specific domain, it is interesting to use a corpus specific to the domain to which we wish to adapt our model. 

Most of the data used for pre-training in the biomedical field are research articles and papers that can be either abstracts, full texts, or a combination of both. This data generally originates from large public databases such as PubMed or PubMedCentral (for full-text articles). However, to our knowledge, no study has examined the selecting subsets of these large databases for pre-training using metrics specific to scientific papers. That leads us to our research questions: Can a language model be adapted to the biomedical domain by efficiently selecting scientific documents in the pre-training data while maintaining or improving its performance ? Is the journal impact factor a good metric to select scientific documents for pre-training ? 

This paper presents our experiments on adapting the pretrained BERT-base model to the biomedical domain. We get the PubMed January 2024 baseline corpus and define different subset configurations using journal impact metrics: h-index <cit.> and Scimago Journal Rank or SJR <cit.>. We then perform continual pre-training from the BERT-base model <cit.> and evaluate it on several tasks from the BLURB benchmark <cit.>.



§ RELATED WORK



 §.§ Domain-adaptive and domain-specific pre-training for the biomedical domain

The adaptation of neural models to the biomedical domain has been extensively studied in recent years, focusing on BERT-type models and, more recently, large generative language models. We distinguish two main categories regarding the pre-training data:

    
  * Mixed-domain pre-training, where the model has seen data from different domains during the pre-training: it can either be a model that has been pre-trained on a general corpus and then trained on in-domain data or a model trained simultaneously on data from multiple domains, such as biomedical and clinical for example <cit.>.
    
  * Domain-specific pre-training, where the model only sees data from a single domain during pre-training. The hypotheses are that by using a domain-specific vocabulary, the models learn more accurate representations of specific in-domain terms (that would be divided by the sub-word tokenization with a general corpus) and that it reduces noise introduced by text completely unrelated to the domain <cit.>.
 



 §.§ Pre-training data quality for large language models

Several works focus on selecting sequences using quality metrics for pre-training Transformer models in the general domain, particularly with the advent of large language models and the evolution of the size of pre-training datasets for these models <cit.>. 

The adaptation of large language models using scientific articles has been largely studied. However, only a few have emphasized the quality of scientific articles used. For the Galactica model <cit.>, they only mention applying "several quality filters, including excluding papers from journals with certain keywords and also excluding papers with a low journal impact factor". Most other models that used PubMed or PubMedCentral for pre-training do not mention any specific selection of data at the document level; most focus on preprocessing steps at the content level (bibliography references, authors, figures and tables, etc.) when dealing with full-text articles <cit.>.



§ METHODS
 


 §.§ Methodology

We use a similar methodology as <cit.>, with some small modifications : 

Let D be a large dataset containing documents and ξ a metric assigning a score to a document. We build a subset P_cξ by adding instances that fit our selection criteria c :

    P_cξ={d_i∈ D | c_0ξ≤ξ(d_i)) ≤ c_1ξ}

Where c_0ξ and c_1ξ are the lower and upper bound for the criteria c and the metric ξ. For each metric, we consider two selection criteria: keeping top or middle part of the distribution of the metric[we do not use the bottom part because in our case, for the SJR metric, more than 25% of the dataset had the same value : 0, so the percentiles for the bottom part would be 0 but include more than 25% of the corpus] of D as the data to be kept. This serves as verifying if the model learns better with high quality documents (defined by the metric, for our metrics, higher is better). We keep either 25% or 50% of the documents in D. So for instance, if we take the 25 % of the middle part of the distribution for the metric ξ, we should compute the 37.5 % and 62.5 % percentiles with respect to metric ξ, which corresponds to c_0ξ and c_1ξ, and keep the documents between these two percentiles.

Then, we tokenize each document in the subset, and we concatenate them into sequences of length equal to the model's context length. This differs from <cit.> as we do the filtering before tokenization (because our metrics are applied on a document, not on a sequence of tokens). These sequences are then used to pre-train a model. Moreover, our metrics do not rely on a reference language model.
The goal is then to pre-train a model on a subset of the whole training set while retaining or improving the model's performance. 



 §.§ Pre-training corpus

We use the PubMed Baseline corpus comprising all article abstracts deposited on the PubMed database until January 2024. Using PubMed metadata, we filter out abstracts that are not in English, abstracts whose text is not available, and abstracts whose ISSN journal identifier is not present (we filter this to have enough abstracts with a score as our pruning metrics are based on journal impact). After filtering, the total corpus is comprised of 15.9B tokens.

We did not perform a pre-training experiment using the non-filtered PubMed set because we did not have enough articles with journal identifiers to obtain convenient metric percentiles. Still, we expect this filtering to already impact the overall quality of the corpus.



 §.§ Quality metrics

The nature of the datasets used for general model training (by which we mean models that are not domain-specific) differs from those used in the biomedical field. They are generally huge datasets comprising texts extracted from the Internet on various sites. In our case, these are research articles from the same database. This presupposes a text quality that is adequate in certain respects (generally correct syntax and formal language, unlike texts found on the Internet). 

We wanted to use metrics specific to scientific articles that have meaning for scientific article readers. So, we decided to use journal impact metrics. We used the metadata available on PubMed. This type of metric can provide insight into the probable impact that a paper can have but does not necessarily ensure scientific quality. However, we believe filtering with impact metrics in a large corpus can help reduce the noise, help the model learn biomedical language, and learn biomedical knowledge more efficiently. We use the h-index <cit.> and the SJR <cit.> as the data is publicly available on the Scimago website[<https://www.scimagojr.com/journalrank.php>]. For comparison, we also perform a random score assignation on all papers from the dataset; we do not perform multiple random assignations to limit the compute cost.

We computed the percentiles for SJR and h-index and, as there were zero values for the SJR index (for the 12.5% and 25% percentiles), we did not perform all the pre-trainings for the mid criteria, we only considered the 25 % subset. This is also why we did not consider the bottom percentiles. We also did not perform the pre-training on the complete set because of time and resource constraints, but we plan to do it in future work.



 §.§ Pre-processing

We tokenize the whole dataset and concatenate the text of the different abstracts into sequences of length 512 tokens (maximum sequence length for the model we use: BERT <cit.>). We keep 5 % of this set as validation data.



 §.§ Model and pre-training

We use the original BERT-base model <cit.>, continue pre-training on the defined datasets with masked language modeling, and compare the resulting models. For each pre-training (on each subset), we fix a shared global number of steps so that each model sees the same quantity of tokens: we select the number of steps as the total number needed for one epoch on the entire PubMed corpus. For the runs with the subsets, the model will run multiple epochs until it reaches the total number of steps, with data shuffling between epochs (for example, two epochs for the run where we take the top 50% of PubMed abstracts with respect to h-index).

We train with a sequence length of 512 and a batch size of 8192[We perform gradient accumulation and data parallelism to get this batch size.], which gives us a total of 3598 steps. We use a linear schedule with 10 % warmup and a peak learning rate of 1e-4. For the other hyperparameters, we follow the original BERT paper. We train our different models on 2 NVIDIA A100 GPUs.





 §.§ Evaluation and fine-tuning

We evaluate the produced pre-trained models on some of the datasets from the BLURB benchmark <cit.>. We also re-evaluate the BERT-base model to ensure a consistent evaluation with our fine-tuning scripts. We excluded the PICO and Sentence Similarity tasks (EBM-PICO <cit.> and BIOSSES <cit.>), for which we had trouble reproducing similar and consistent results across runs to those obtained in the BLURB paper, as they did not share any code to perform the fine-tuning and evaluation. So, we are left with the following evaluation tasks : 

    
  * Named entity recognition (NER) : BC5-chem & BC5-disease <cit.>, BC2GM <cit.>, JNLPBA <cit.> and NCBI-disease <cit.>. We evaluate the models for NER tasks using the entity-level F1 score. We model the entities using BIO tags.
    
  * Relation extraction : ChemProt<cit.>, DDI <cit.>, GAD <cit.>. We evaluate the models for relation extraction using the micro F1 score. We use entity dummyfication with start and end tags and use the [CLS] token to classify relations.
    
  * Document classification : HoC <cit.>, for which we measure the micro F1 score.
    
  * Question answering : PubMedQA <cit.> and BioASQ Task 7b <cit.>. We evaluate these tasks using accuracy.




§ RESULTS AND DISCUSSION

To limit random effects, we perform the fine-tuning multiple times with different random seeds, as described in the BLURB paper: using five seeds for all datasets except for BioASQ and PubMedQA, for which we use ten seeds (because they are smaller in size). We then report the average performance across the different seeds for each dataset in the table <ref>. 



 §.§ Improvement against non biomedical model

All models trained on biomedical data perform better than the base model trained only on general-domain data. However, for a fair comparison, we should train it for the same amount of steps on non-biomedical data.



 §.§ Are journal impact metrics important for the model ?

We obtain the best results in micro and macro averages for the model trained on the top 50% of the entire set with respect to the h-index of the journal in which abstracts have been published. Overall, the h-index metric performs better than SJR, which may be because the SJR percentile values are very close to each other, so the quality differences are less important.

However, the performance differences are low when we compare to the SJR metric or even when selecting abstracts randomly, regardless of the proportion of abstracts we keep. So, journal impact metrics do not seem important when selecting pre-training data from a corpus of scientific articles. We then should find more appropriate metrics to define the quality of a single abstract or test it on a full-text article corpus (so that the impact of a single document is higher).



 §.§ Is it better to pre-train a model using more abstracts ?

If we compare the performance difference when training with 25% of the data against 50%, we globally have better performances (except for the random selection), but these differences are not significant. So, it would be interesting to perform further pre-training experiments using different subset sizes to investigate which number of documents is optimal for the domain adaptation. 



§ CONCLUSION

This paper presents our early experiments on selecting the pre-training data for the biomedical domain. We show that the journal impact metrics are not better than the random selection at a fixed number of training steps. We also observe that reducing the number of abstracts in the training set does not necessarily decrease the final model performance and show the need to investigate how many documents we need to pre-train a model without losing performance.
 
Further directions include finding better metrics (or combinations of metrics) to assess the quality of a document in the pre-training corpus, investigating metrics at a different level (at the corpus level using various mixtures of biomedical domains), and using a corpus of full-text articles.



§ ACKNOWLEDGMENTS

This project was provided with computer and storage resources by GENCI at IDRIS thanks to the grant 20XX-AD011014707 on the supercomputer Jean-Zay's A100 partition .



