The injection of domain-specific knowledge is crucial for adapting language models (LMs) to specialized fields such as biomedicine. While most current approaches rely on unstructured text corpora, this study explores two complementary strategies for leveraging structured knowledge from the UMLS Metathesaurus: (i) Continual pretraining that embeds knowledge into model parameters, and (ii) Graph Retrieval-Augmented Generation (GraphRAG) that consults a knowledge graph at inference time. We first construct a large-scale biomedical knowledge graph from UMLS (3.4 million concepts and 34.2 million relations), stored in Neo4j for efficient querying. We then derive a ~100-million-token textual corpus from this graph to continually pretrain two models: BERTUMLS (from BERT) and BioBERTUMLS (from BioBERT). We evaluate these models on six BLURB (Biomedical Language Understanding and Reasoning Benchmark) datasets spanning five task types and evaluate GraphRAG on the two QA (Question Answering) datasets (PubMedQA, BioASQ). On BLURB tasks, BERTUMLS improves over BERT, with the largest gains on knowledge-intensive QA. Effects on BioBERT are more nuanced, suggesting diminishing returns when the base model already encodes substantial biomedical text knowledge. Finally, augmenting LLaMA 3-8B with our GraphRAG pipeline yields over than 3 points accuracy on PubMedQA and 5 points on BioASQ without any retraining, delivering transparent, multi-hop, and easily updated knowledge access. We release the processed UMLS Neo4j graph to support reproducibility.
Figures & tables
Figure 1: Overview of the UMLS-Based Knowledge Injection Pipeline: Continual Pretraining on BERT/BioBERT and GraphRAG.
Figure 2: Pipeline for constructing a biomedical knowledge graph from UMLS Metathesaurus.
Figure 3: Example of generating a textualized triple from the KG.
Figure 4: GraphRAG pipeline.
Dataset
Task
Train
Dev
Test
Evaluation Metrics
Number of Classes
EBM PICO
PICO
339,167
85,321
16,364
Macro F1 word-level
3
BIOSSES
Sentence Similarity
64
16
20
Pearson
N/A (labels continus)
HoC
Document Classification
1,295
186
371
Average Micro F1
10
DDI
Relation Extraction
25,296
2,496
5,716
Micro F1
18
PubMedQA
Question Answering
450
50
500
Accuracy
3
BioASQ
Question Answering
670
75
140
Accuracy
2
Table 1: Summary of the biomedical datasets used with the number of classes and evaluation metrics.
Dataset
BERT
BERTUMLS
PubMedQA
50.72±0.17
53.00±0.0
BioASQ
66.57±0.93
71.57±1.17
EBM PICO
71.95±0.06
72.18±0.05
DDI
77.99±0.19
78.67±0.27
BIOSSES
82.31±4.74
82.54±1.14
HoC
80.60±0.35
80.57±0.88
Table 2: BERT vs BERTUMLS (ours) test results (%) across biomedical NLP tasks. Evaluation metrics are listed in Table 1 .
Dataset
BioBERT
BioBERTUMLS
PubMedQA
52.80±0.0
54.20±0.0
BioASQ
79.71±0.38
75.57±1.25
EBM PICO
73.56±0.01
73.66±0.04
DDI
81.64±0.19
80.97±0.33
BIOSSES
88.37±2.02
90.36±0.45
HoC
82.82±0.22
83.03±0.25
Table 3: BioBERT vs BioBERTUMLS (ours) test results (%) across biomedical NLP tasks. Evaluation metrics are listed in Table 1 .
Model
Number of words
Domain
BERT
3.4B
General
BioBERT
4.5B
Biomedical
BERTUMLS
100M
Biomedical
BioBERTUMLS
100M
Biomedical
Table 4: Pretraining corpora of biomedical and general language models.
Dataset
LLaMA 3-8B
LLaMA 3-8B + GraphRAG
PubMedQA
51.2
54.4
BioASQ
75.0
80.0
Table 5: Comparison of accuracy (%) on PubMedQA and BioASQ between LLaMA 3-8B and our GraphRAG-enhanced model.
Figure 5: A real-world biomedical question from BioASQ and the corresponding subgraph extracted from our Neo4j knowledge graph. Using a LLama model alone often yields an incorrect answer (‘No’). By injecting structured biomedical knowledge from the UMLS graph as context, the model correctly answers ‘Yes’.