SAVRN
Search Contact SAVRN

Open-weight model · Feature extraction

SapBERT-from-PubMedBERT-fulltext

by Language Technology Lab @University of Cambridge cambridgeltl/SapBERT-from-PubMedBERT-fulltext

[news] A cross-lingual extension of SapBERT will appear in the main onference of ACL 2021! [news] SapBERT will appear in the conference proceedings of NAACL 2021! SapBERT by Liu et al. (2020).

Parameters109M
Context512
Weights1.8 GB
Licenseapache-2.0
AccessOpen weights
Monthly Downloads1.5M

Runs On

What it takes to serve SapBERT-from-PubMedBERT-fulltext (109M parameters): the memory its weights need at each precision, and the cheapest way to rent enough data-center GPUs to hold them.

PrecisionWeightsMemory neededCheapest setupPer hourAlso fits
16-bit 0.2 GB 0.3 GB 1x MI300X (192 GB)
Vultr
$1.85 1x H100 $1.99 · 1x MI325X $2.00
8-bit 0.1 GB 0.1 GB 1x MI300X (192 GB)
Vultr
$1.85 1x H100 $1.99 · 1x MI325X $2.00
4-bit 0.1 GB 0.1 GB 1x MI300X (192 GB)
Vultr
$1.85 1x H100 $1.99 · 1x MI325X $2.00

Memory is the weights at that precision plus 20% for the runtime and a short context; a long context needs more. Prices are the lowest on-demand hourly rates in the SAVRN Index, read Sep 18, 2026.

SAVRN's Notes on SapBERT-from-PubMedBERT-fulltext

One vector per biomedical entity name is the entire output of SapBERT-from-PubMedBERT-fulltext, and that narrow job is why it draws 1.5 million downloads a month four years after its March 2, 2022 release. Cambridge's Language Technology Lab trained it on UMLS 2020AA, English only, on a PubMedBERT base, and the [CLS] embedding of the last layer is the feature you keep. At 109 million parameters it needs 0.3 GB at 16-bit and 0.1 GB at 8-bit or 4-bit, so an entity-linking service runs on a sliver of the $1.85-an-hour MI300X on the Index.

Apache 2.0 permits commercial use, modification and redistribution with the notices intact. Two checks before you build on it: the 512-token context means inputs are entity names, not passages, and the last update was June 14, 2023, with the method in arXiv:2010.11784. Weights ship in safetensors, pytorch, jax and tf, so the serving stack is your call.

Model Card

By Language Technology Lab @University of Cambridge, published under apache-2.0, revision 090663c3ae57.

datasets: - UMLS

[news] A cross-lingual extension of SapBERT will appear in the main onference of ACL 2021!
[news] SapBERT will appear in the conference proceedings of NAACL 2021!

SapBERT-PubMedBERT

SapBERT by Liu et al. (2020). Trained with UMLS 2020AA (English only), using microsoft/BiomedNLP-PubMedBERT-base-uncased-abstract-fulltext as the base model.

Expected input and output

The input should be a string of biomedical entity names, e.g., "covid infection" or "Hydroxychloroquine". The [CLS] embedding of the last layer is regarded as the output.

Extracting embeddings from SapBERT

The following script converts a list of strings (entity names) into embeddings.

Read the full model card (424 words)

Configuration

Architecture
BertModel
Context length (tokens)
512
Layers
12
Hidden size
768
Feed-forward size
3,072
Attention heads
12
Vocabulary size
30,522
Model type
bert

Identity and Version

Repository
cambridgeltl/SapBERT-from-PubMedBERT-fulltext
Publisher
Language Technology Lab @University of Cambridge
Task
Feature extraction
Modality
Text
Library
transformers
Parameters
109M parameters
Languages
en
Revision
090663c3ae57bf35ffe4d0d468a2a88d03051a4d
First published
2022-03-02
Last updated
2023-06-14

Files and Weights

10 files, 1.8 GB in total. The weights are 4 files totalling 1.8 GB in bin, h5, msgpack, safetensors.

Weights4 files · 1.8 GB
Configuration2 files · 574 B
Tokenizer2 files · 226.3 KB
Documentation1 file · 4.1 KB
Repository1 file · 445 B
Every file
FileTypeSizeSHA-256
flax_model.msgpackWeights437.9 MB c5b447ad22a7
model.safetensorsWeights438.0 MB a4696930afef
pytorch_model.binWeights438.0 MB 07f7672c7ac8
tf_model.h5Weights438.2 MB 18d43f8c7805
config.jsonConfiguration462 B
special_tokens_map.jsonConfiguration112 B
README.mdDocumentation4.1 KB
.gitattributesRepository445 B
tokenizer_config.jsonTokenizer198 B
vocab.txtTokenizer226.2 KB

License and Download

License
apache-2.0
Access
Open weights, no gate
Download size
1.8 GB
Download from Language Technology Lab @University of Cambridge

Released by Language Technology Lab @University of Cambridge through its official repository on Hugging Face. Read the license.

Built From

  • Described by arXiv:2010.11784

Memory Requirements

PrecisionWeights in memory
As published1.8 GB
16-bit0.2 GB
8-bit0.1 GB
4-bit0.1 GB

Weights only, from the published parameter count; the key-value cache and runtime add to this.

Compare SapBERT-from-PubMedBERT-fulltext

Questions About SapBERT-from-PubMedBERT-fulltext

How much GPU memory does SapBERT-from-PubMedBERT-fulltext need?

About 0.3 GB at 16-bit and 0.1 GB at 4-bit: the weights (109M parameters) plus a working margin. A long context needs more.

What is the cheapest GPU to run SapBERT-from-PubMedBERT-fulltext on?

At 16-bit, 1x MI300X from $1.85 an hour; at 4-bit, 1x MI300X from $1.85 an hour, at the lowest on-demand prices the SAVRN Index lists.

Can I use SapBERT-from-PubMedBERT-fulltext commercially?

Yes. SapBERT-from-PubMedBERT-fulltext is released under Apache License 2.0. The Apache License 2.0 is a permissive open-source license. It permits commercial use, modification and redistribution. It requires keeping the license and copyright notices and any NOTICE file, stating significant changes, and it includes an express patent grant from contributors.

What is SapBERT-from-PubMedBERT-fulltext's context length?

512 tokens, from the maximum position embeddings in its published configuration.

Similar Models

For more details please refer to our Github: FlagEmbedding. If you are looking for a model that supports more languages, longer texts, and other retrieval methods, you can try using bge-m3. FlagEmbedding focuses on retrieval-augmented LLMs, consisting of the following projects currently: - 1/30/2024: Release BGE-M3, a new member to BGE model series! M3 stands for Multi-linguality (100+ languages), Multi-granularities (input length up to 8192), Multi-Functionality (unification of dense, lexical, multi-vec/colbert retrieval). It is the first embedding model which supports all three retrieval methods, achieving new SOTA on multi-lingual (MIRACL) and cross-lingual (MKQA) benchmarks. Technical…

Open weights mit 109M parameters 512 tokens sentence-transformers

Recommend switching to newest BAAI/bge-base-en-v1.5, which has more reasonable similarity distribution and same method of usage. More details please refer to our Github: FlagEmbedding. FlagEmbedding can map any text to a low-dimensional dense vector which can be used for tasks like retrieval, classification, clustering, or semantic search. And it also can be used in vector databases for LLMs. Updates - 10/12/2023: Release LLM-Embedder, a unified embedding model to support diverse retrieval augmentation needs for LLMs. Paper:fire: - 09/15/2023: The technical report of BGE has been released - 09/15/2023: The masive training data of BGE has been released - 09/12/2023: New models: - 09/07/2023…

Open weights mit 109M parameters 512 tokens transformers

Model · Feature extraction

Vela-1.0-Omni-Nano

vLLM Semantic Router

Vela Omni Nano maps text, images, and speech into a shared embedding space for multimodal search, routing, and use a 0–100 scale; higher is better. All applicable models use the same examples and retrieval pools. N/A denotes a modality the text-only model does not support. Bold Vela scores improve on multi-modal-embed-small. Macro-F1 gives equal weight to every intent class (77 for Banking77 and 60 for MASSIVE), complementing the query-weighted accuracy; undefined class F1 is zero. Text evaluation uses fixed class prototypes: 3,080 Banking77 and 2,972 MASSIVE English queries. Vela Omni is adapted using training examples and intent labels from these two datasets; comparison models are…

Open weights apache-2.0 134M parameters pytorch

Model · Feature extraction

jina-embeddings-v2-base-code

Jina AI

The easiest way to starting using jina-embeddings-v2-base-code is to use Jina AI's Embedding API. jina-embeddings-v2-base-code is an multilingual embedding model speaks English and 30 widely used programming languages. Same as other jina-embeddings-v2 series, it supports 8192 sequence length. jina-embeddings-v2-base-code is based on a Bert architecture (JinaBert) that supports the symmetric bidirectional variant of ALiBi to allow longer sequence length. The backbone jina-bert-v2-base-code is pretrained on the github-code dataset. The model is further trained on Jina AI's collection of more than 150 millions of coding question answer and docstring source code pairs. These pairs were obtained…

Open weights apache-2.0 161M parameters 8,192 tokens sentence-transformers

Model · Feature extraction

granite-embedding-small-english-r2

IBM Granite

Granite-embedding-small-english-r2 is a 47M parameter dense biencoder embedding model from the Granite Embeddings collection that can be used to generate high quality text embeddings. This model produces embedding vectors of size 384 based on context length of upto 8192 tokens. Compared to most other open-source models, this model was only trained using open-source relevance-pair datasets with permissive, enterprise-friendly license, plus IBM collected and generated datasets. The r2 models show strong performance across standard and IBM-built information retrieval benchmarks (BEIR, ClapNQ), code retrieval (COIR), long-document search benchmarks (MLDR, LongEmbed), conversational multi-turn…

Open weights apache-2.0 48M parameters 8,192 tokens sentence-transformers

More details please refer to our Github: FlagEmbedding. If you are looking for a model that supports more languages, longer texts, and other retrieval methods, you can try using bge-m3. FlagEmbedding focuses on retrieval-augmented LLMs, consisting of the following projects currently: - 1/30/2024: Release BGE-M3, a new member to BGE model series! M3 stands for Multi-linguality (100+ languages), Multi-granularities (input length up to 8192), Multi-Functionality (unification of dense, lexical, multi-vec/colbert retrieval). It is the first embedding model which supports all three retrieval methods, achieving new SOTA on multi-lingual (MIRACL) and cross-lingual (MKQA) benchmarks. Technical…

Open weights mit 33M parameters 512 tokens sentence-transformers