Downloads · 30 days
8
13% of all-time downloads
brettgenz/modernbert-science-dapt-v1
modernbert-science-dapt-v1 is a fill-mask model from brettgenz. Use it when you need the model to fill a missing word. It is set up for transformers. The card lists the license as apache-2.0.
A newer version of this model is available:
Downloads · 30 days
8
13% of all-time downloads
All-time downloads
61
Public
Parameters
150M
599 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors599 MB · 99%
From the Hugging Face model README
A newer version of this model is available:
https://huggingface.co/brettgenz/modernbert-science-dapt-v2
The v2 model was selected using checkpoint evaluation and shows improved retrieval performance and slightly improved classification metrics.
Evaluate whether domain-adaptive pretraining (DAPT) on a large, curated scientific corpus improves downstream performance of ModernBERT-base on scientific text tasks.
Sources
Filtering & Policy
Deduplication
Final Training Corpus
Final Training Run (Run 2)
The training process was stable, with decreasing loss and well-behaved gradient norms.
We used three proxy evaluations:
| Metric | Base | DAPT | Δ |
|---|---|---|---|
| Recall@1 | 0.279 | 0.338 | +21% |
| Recall@5 | 0.565 | 0.668 | +18% |
| MRR | 0.412 | 0.485 | +18% |
Result: Significant improvement in semantic matching and representation quality.
| Model | Eval Loss |
|---|---|
| Base | 1.081 |
| DAPT | 0.996 |
Result: Clear improvement in language modeling on scientific text.
| Metric | Base | DAPT |
|---|---|---|
| Accuracy | 0.9161 | 0.9150 |
| Macro F1 | 0.9168 | 0.9156 |
Result: No meaningful change (slight, negligible decrease).
The DAPT model demonstrates meaningful improvement in scientific-domain representation, particularly for:
While classification gains were not observed on this proxy task, there is no evidence of degradation, and improvements in representation quality suggest likely benefit for downstream tasks involving:
from transformers import AutoTokenizer, AutoModel
model_id = "brettgenz/modernbert-science-dapt-v1"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModel.from_pretrained(model_id)
text = "Deep learning approaches for protein structure prediction"
inputs = tokenizer(text, return_tensors="pt", truncation=True)
outputs = model(**inputs)
embeddings = outputs.last_hidden_state
This model is intended as a drop-in replacement for ModernBERT-base when working with scientific or technical text.
This model is released under the Apache 2.0 License.
The training data consists of publicly available open-access scientific content under permissive licenses (e.g., CC-BY, CC0).