Model reference · open weights
pubmedbert-embeddings is an open-weight embedding model from NeuML. pubmedbert-base-embeddings-8M (FP32) weighs 16 MB; the smallest configuration that runs it is RTX 3060 12 GB.
Summary of the NeuML/pubmedbert-base-embeddings-8M model card, 2026-10-01
What it is
| Released by | NeuML |
|---|---|
| Released | 2025-01-03 |
| Parameters | 8M |
| VRAM | 16 MB for the weights |
What it runs on
| Card | Runs | Memory |
|---|---|---|
| RTX 3060 12 GB | fits | 11.6 GB |
| RTX 4060 Ti 16 GB | fits | 15.4 GB |
| RTX 3090 24 GB | fits | 23.4 GB |
| RTX 4090 24 GB | fits | 23.4 GB |
| RTX 5090 32 GB | fits | 31.0 GB |
| L40S 48 GB | fits | 44.0 GB |
| A100 80 GB | fits | 78.2 GB |
| H100 80 GB | fits | 78.1 GB |
| RTX PRO 6000 Blackwell 96 GB | fits | 93.8 GB |
| DGX Spark (GB10) 128 GB unified | fits | 107 GB |
| H200 141 GB | fits | 138 GB |
| B200 180 GB | fits | 176 GB |
From the model card
This is a distilled version of PubMedBERT Embeddings using the Model2Vec library. It uses static embeddings, allowing text embeddings to be computed orders of magnitude faster on both GPU and CPU. It is designed for applications where computational resources are limited or where real-time performance is critical.
This model can be used to build embeddings databases with txtai for semantic search and/or as a knowledge source for retrieval augmented generation (RAG).
import txtai
# Create embeddings
embeddings = txtai.Embeddings(
path="neuml/pubmedbert-base-embeddings-8M",
content=True,
)
embeddings.index(documents())
# Run a query
embeddings.search("query to run")
Alternatively, the model can be loaded with sentence-transformers.
from sentence_transformers import SentenceTransformer
from sentence_transformers.models import StaticEmbedding
# Initialize a StaticEmbedding module
static = StaticEmbedding.from_model2vec("neuml/pubmedbert-base-embeddings-8M")
model = SentenceTransformer(modules=[static])
sentences = ["This is an example sentence", "Each sentence is converted"]
embeddings = model.encode(sentences)
print(embeddings)
The model can also be used directly with Model2Vec.
from model2vec import StaticModel
# Load a pretrained Model2Vec model
model = StaticModel.from_pretrained("neuml/pubmedbert-base-embeddings-8M")
# Compute text embeddings
sentences = ["This is an example sentence", "Each sentence is converted"]
embeddings = model.encode(sentences)
print(embeddings)
The following compares performance of this model against the models previously compared with PubMedBERT Embeddings. The following datasets were used to evaluate model performance.
The Pearson correlation coefficient is used as the evaluation metric.
| Model | PubMed QA | PubMed Subset | PubMed Summary | Average |
|---|---|---|---|---|
| all-MiniLM-L6-v2 | 90.40 | 95.92 | 94.07 | 93.46 |
| bge-base-en-v1.5 | 91.02 | 95.82 | 94.49 | 93.78 |
| gte-base | 92.97 | 96.90 | 96.24 | 95.37 |
| pubmedbert-base-embeddings-2M | 88.62 | 93.08 | 93.24 | 91.65 |
| pubmedbert-base-embeddings-8M | 90.05 | 94.29 | 94.15 | 92.83 |
| pubmedbert-base-embeddings | 93.27 | 97.00 | 96.58 | 95.62 |
| S-PubMedBert-MS-MARCO | 90.86 | 93.68 | 93.54 | 92.69 |
As we can see, this model while not the top scoring model is certainly competitive.
As another test, let's see how long each model takes to index 120K article abstracts using the following code. All indexing is done with a RTX 3090 GPU.
from datasets import load_dataset
from tqdm import tqdm
from txtai import Embeddings
ds = load_dataset("ccdv/pubmed-summarization", split="train")
embeddings = Embeddings(path="path to model", content=True, backend="numpy")
embeddings.index(tqdm(ds["abstract"]))
| Model | Params (M) | Index time (s) |
|---|---|---|
| all-MiniLM-L6-v2 | 22 | 117 |
| BM25 | - | 18 |
| bge-base-en-v1.5 | 109 | 518 |
| gte-base | 109 | 523 |
| pubmedbert-base-embeddings-2M | 2 | 17 |
| pubmedbert-base-embeddings-8M | 8 | 18 |
| pubmedbert-base-embeddings | 109 | 462 |
| S-PubMedBert-MS-MARCO | 109 | 465 |
Clearly a static model's main upside is speed. It's important to note that if storage savings is the only concern, then take a look at PubMedBERT Embeddings Matryoshka. The 256 dimension model scores higher than this model, so does the 64 dimension model. The tradeoff is that the runtime performance i
Quoted from the model card on Hugging Face. The full card is behind the Hugging Face link above.