NeuML / biomedbert-hash-nano-embeddings

huggingface.co
Total runs: 247
24-hour runs: 0
7-day runs: 106
30-day runs: 178
Model's Last Updated: June 16 2026
sentence-similarity

Introduction of biomedbert-hash-nano-embeddings

Model Details of biomedbert-hash-nano-embeddings

BiomedBERT Hash Nano Embeddings

This is a BiomedBERT Hash Nano model fined-tuned using sentence-transformers . It maps sentences & paragraphs to a 128 dimensional dense vector space and can be used for tasks like clustering or semantic search.

The training dataset was generated using a random sample of PubMed title-abstract pairs along with similar title pairs. The training workflow was a two step distillation process as follows.

Usage (txtai)

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

embeddings = txtai.Embeddings(
  path="neuml/biomedbert-hash-nano-embeddings",
  content=True,
  vectors={"trust_remote_code": True}
)
embeddings.index(documents())

# Run a query
embeddings.search("query to run")
Usage (Sentence-Transformers)

Alternatively, the model can be loaded with sentence-transformers .

from sentence_transformers import SentenceTransformer
sentences = ["This is an example sentence", "Each sentence is converted"]

model = SentenceTransformer("neuml/biomedbert-hash-nano-embeddings", trust_remote_code=True)
embeddings = model.encode(sentences)
print(embeddings)
Usage (Hugging Face Transformers)

The model can also be used directly with Transformers.

from transformers import AutoTokenizer, AutoModel
import torch

# Mean Pooling - Take attention mask into account for correct averaging
def meanpooling(output, mask):
    embeddings = output[0] # First element of model_output contains all token embeddings
    mask = mask.unsqueeze(-1).expand(embeddings.size()).float()
    return torch.sum(embeddings * mask, 1) / torch.clamp(mask.sum(1), min=1e-9)

# Sentences we want sentence embeddings for
sentences = ['This is an example sentence', 'Each sentence is converted']

# Load model from HuggingFace Hub
tokenizer = AutoTokenizer.from_pretrained("neuml/biomedbert-hash-nano-embeddings", trust_remote_code=True)
model = AutoModel.from_pretrained("neuml/biomedbert-hash-nano-embeddings", trust_remote_code=True)

# Tokenize sentences
inputs = tokenizer(sentences, padding=True, truncation=True, return_tensors='pt')

# Compute token embeddings
with torch.no_grad():
    output = model(**inputs)

# Perform pooling. In this case, mean pooling.
embeddings = meanpooling(output, inputs['attention_mask'])

print("Sentence embeddings:")
print(embeddings)
Evaluation Results

Performance of this model is compared to previously released models trained on medical literature. The most commonly used small embeddings model is also included for comparison.

The following datasets were used to evaluate model performance.

Evaluation results are shown below. 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
bioclinical-modernbert-base-embeddings 92.49 97.10 97.04 95.54
biomedbert-base-colbert 94.59 97.18 96.21 95.99
biomedbert-base-reranker 97.66 99.76 98.81 98.74
biomedbert-hash-nano-colbert 90.45 96.81 92.00 93.09
biomedbert-hash-nano-embeddings 90.39 96.29 95.32 94.00
pubmedbert-base-embeddings 93.27 97.00 96.58 95.62
pubmedbert-base-embeddings-8M 90.05 94.29 94.15 92.83

At only 970K parameters this model packs quite a punch. It's competitive with larger models trained on medical literature retaining 98% of the performance of pubmedbert-base-embeddings at 0.88% the size. The performance is also better than all-MiniLM-L6-v2 , a commonly used small model and it's 23x smaller. It also performs much better than the 8M static embeddings model although it is slower given that model is static.

This is a great model to use for smaller datasets and on limited compute / edge devices. Given that it only produces vectors of 128 dimensions, stored vectors also don't need as much space.

Full Model Architecture
SentenceTransformer(
  (0): Transformer({'max_seq_length': 512, 'do_lower_case': False, 'architecture': 'BertHashModel'})
  (1): Pooling({'word_embedding_dimension': 128, 'pooling_mode_cls_token': False, 'pooling_mode_mean_tokens': True, 'pooling_mode_max_tokens': False, 'pooling_mode_mean_sqrt_len_tokens': False, 'pooling_mode_weightedmean_tokens': False, 'pooling_mode_lasttoken': False, 'include_prompt': True})
)

Runs of NeuML biomedbert-hash-nano-embeddings on huggingface.co

247
Total runs
0
24-hour runs
0
3-day runs
106
7-day runs
178
30-day runs

More Information About biomedbert-hash-nano-embeddings huggingface.co Model

More biomedbert-hash-nano-embeddings license Visit here:

https://choosealicense.com/licenses/apache-2.0

biomedbert-hash-nano-embeddings huggingface.co

biomedbert-hash-nano-embeddings huggingface.co is an AI model on huggingface.co that provides biomedbert-hash-nano-embeddings's model effect (), which can be used instantly with this NeuML biomedbert-hash-nano-embeddings model. huggingface.co supports a free trial of the biomedbert-hash-nano-embeddings model, and also provides paid use of the biomedbert-hash-nano-embeddings. Support call biomedbert-hash-nano-embeddings model through api, including Node.js, Python, http.

biomedbert-hash-nano-embeddings huggingface.co Url

https://huggingface.co/NeuML/biomedbert-hash-nano-embeddings

NeuML biomedbert-hash-nano-embeddings online free

biomedbert-hash-nano-embeddings huggingface.co is an online trial and call api platform, which integrates biomedbert-hash-nano-embeddings's modeling effects, including api services, and provides a free online trial of biomedbert-hash-nano-embeddings, you can try biomedbert-hash-nano-embeddings online for free by clicking the link below.

NeuML biomedbert-hash-nano-embeddings online free url in huggingface.co:

https://huggingface.co/NeuML/biomedbert-hash-nano-embeddings

biomedbert-hash-nano-embeddings install

biomedbert-hash-nano-embeddings is an open source model from GitHub that offers a free installation service, and any user can find biomedbert-hash-nano-embeddings on GitHub to install. At the same time, huggingface.co provides the effect of biomedbert-hash-nano-embeddings install, users can directly use biomedbert-hash-nano-embeddings installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

biomedbert-hash-nano-embeddings install url in huggingface.co:

https://huggingface.co/NeuML/biomedbert-hash-nano-embeddings

Url of biomedbert-hash-nano-embeddings

biomedbert-hash-nano-embeddings huggingface.co Url

Provider of biomedbert-hash-nano-embeddings huggingface.co

NeuML
ORGANIZATIONS

Other API from NeuML

huggingface.co

Total runs: 1.3K
Run Growth: 1.2K
Growth Rate: 94.08%
Updated:January 27 2025
huggingface.co

Total runs: 1.1K
Run Growth: 528
Growth Rate: 50.87%
Updated:February 21 2023
huggingface.co

Total runs: 1.1K
Run Growth: -170
Growth Rate: -16.18%
Updated:January 27 2025
huggingface.co

Total runs: 853
Run Growth: 250
Growth Rate: 29.31%
Updated:February 21 2023
huggingface.co

Total runs: 521
Run Growth: -99.9K
Growth Rate: -19182.34%
Updated:January 27 2025
huggingface.co

Total runs: 285
Run Growth: 98
Growth Rate: 34.39%
Updated:January 27 2025
huggingface.co

Total runs: 149
Run Growth: 85
Growth Rate: 57.05%
Updated:April 21 2026
huggingface.co

Total runs: 31
Run Growth: 14
Growth Rate: 45.16%
Updated:October 10 2025
huggingface.co

Total runs: 17
Run Growth: 2
Growth Rate: 12.50%
Updated:November 23 2024
huggingface.co

Total runs: 10
Run Growth: 4
Growth Rate: 50.00%
Updated:July 21 2026
huggingface.co

Total runs: 8
Run Growth: -75
Growth Rate: -937.50%
Updated:April 13 2026
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:November 11 2025