Building astroBERT, a language model for Astronomy & Astrophysics

Félix Grèzes, Sergi Blanco-Cuaresma, Alberto Accomazzi, Michael J. Kurtz, Golnaz Shapurian, Edwin A. Henneken, Carolyn S. Grant, Donna M. Thompson, Roman Chyla, Stephen McDonald, Timothy W. Hostetler, Matthew R. Templeton, Kelly E. Lockhart, Nemanja Martinovic, Shinyi Chen, Chris Tanner, Pavlos ProtopapasarXiv 2021

Abstract

The existing search tools for exploring the NASA Astrophysics Data System (ADS) can be quite rich and empowering (e.g., similar and trending operators), but researchers are not yet allowed to fully leverage semantic search. For example, a query for "results from the Planck mission" should be able to distinguish between all the various meanings of Planck (person, mission, constant, institutions and more) without further clarification from the user. At ADS, we are applying modern machine learning and natural language processing techniques to our dataset of recent astronomy publications to train astroBERT, a deeply contextual language model based on research at Google. Using astroBERT, we aim to enrich the ADS dataset and improve its discoverability, and in particular we are developing our own named entity recognition tool. We present here our preliminary results and lessons learned.

Introduction

The NASA Astrophysics Data System (ADS) is a cornerstone of astronomical research, housing over 15 million records. However, traditional search mechanisms relying on keywords and Boolean logic often fail to capture the semantic nuances of the field. A primary challenge is disambiguation; terms like "Planck" can refer to an individual, a satellite mission, or a physical constant depending on the context. To address this, we developed astroBERT, a domain-specific language model designed to enable semantic search by understanding the intent and context inherent in astrophysical literature.

Methodology

Model Architecture and Training

AstroBERT is built upon the Bidirectional Encoder Representations from Transformers (BERT) architecture. Unlike general-purpose models, astroBERT is case-sensitive. This design choice is critical for astronomy, where acronyms such as WISE (Wide-field Infrared Survey Explorer) must be distinguished from the adjective "wise."

The model underwent pre-training using two primary objectives:

  1. Masked Language Modeling (MLM): Predicting hidden tokens within a sentence.
  2. Next Sentence Prediction (NSP): Determining the logical sequence of sentence pairs.

Training was conducted on a high-performance system featuring two NVIDIA V100 GPUs and 768GB of RAM.

Data Acquisition

The pre-training corpus consisted of 395,499 documents curated from the ADS database, totaling approximately 16GB of text (3.8 billion tokens). For evaluation, a specialized Named Entity Recognition (NER) benchmark was developed by extracting and annotating 6,279 organizations from the acknowledgment sections of 44,000 manuscripts.

Results and Discussion

Domain Adaptation and Perplexity

A key finding was the significant "dialect" gap between general English and astronomical literature; the vocabulary overlap between the original BERT and astroBERT is only 24.5%. Perplexity scores, which measure how well a model predicts a sample, demonstrate astroBERT's superior adaptation to the domain.

Table 2: Perplexity scores across different datasets for various models.

As shown in Table 2, astroBERT (MLM) achieved a perplexity of 4.16 on the ADS dataset, vastly outperforming the base BERT model's score of 38.4. This confirms that astronomical literature is essentially a distinct dialect that general-purpose models cannot fully grasp.

Named Entity Recognition Performance

The primary downstream application tested was NER for identifying organizations. AstroBERT demonstrated a clear advantage over general-purpose models in this task.

Table 1: F1-score and standard deviation for NER performance.

The inclusion of the NSP task, while slightly increasing perplexity, significantly improved NER performance. AstroBERT (NSP+MLM) reached an F1-score of 0.902, compared to 0.859 for the base BERT model (Table 1). This suggests that understanding inter-sentence relationships is vital for entity extraction in technical texts.

Conclusion and Future Work

AstroBERT represents a significant step toward semantic search in astrophysics. While current results are promising, future work will focus on refining data cleaning processes to remove "noise" like raw data tables and complex formulas. We also plan to expand the NER capabilities to include astronomical facilities and celestial objects. To support the community, astroBERT will be released via the Huggingface Model Hub.

Summary updated

BibTeX
@misc{grezes2021building,
  author = {Félix Grèzes and Sergi Blanco-Cuaresma and Alberto Accomazzi and Michael J. Kurtz and Golnaz Shapurian and Edwin A. Henneken and Carolyn S. Grant and Donna M. Thompson and Roman Chyla and Stephen McDonald and Timothy W. Hostetler and Matthew R. Templeton and Kelly E. Lockhart and Nemanja Martinovic and Shinyi Chen and Chris Tanner and Pavlos Protopapas},
  title = {{Building astroBERT, a language model for Astronomy \& Astrophysics}},
  year = {2021},
  eprint = {2112.00590},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2112.00590},
}
Figure