SAVRN
Search Contact SAVRN

Open-weight model · Sentence similarity

vandf-rxnorm-biencoder-all

by Kevin Venanzi kvenanzi/vandf-rxnorm-biencoder-all

vandf-rxnorm-biencoder-all is an open-weight model for sentence similarity from Kevin Venanzi, released under Apache License 2.0. It has 109M parameters and a 512-token context. At 16-bit it needs about 0.3 GB of GPU memory, which fits on 1x MI300X from $1.85 an hour, at the lowest prices in the SAVRN Index. It draws 49 downloads a month.

The recipe of kvenanzi/vandf-rxnorm-biencoder, trained on all 14,369 VA National Drug File (VANDF) strings that have a clinical drug in RxNorm, so that every ingredient family in the file is in training.

Parameters109M
Context512
Weights438.0 MB
Licenseapache-2.0
AccessOpen weights
Monthly Downloads49

Runs On

What it takes to serve vandf-rxnorm-biencoder-all (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 23, 2026.

vandf-rxnorm-biencoder-all on every accelerator the SAVRN Index prices, at every precision

Model Card

By Kevin Venanzi, published under apache-2.0, revision 09a45273c3dd.

The recipe of kvenanzi/vandf-rxnorm-biencoder, trained on all 14,369 VA National Drug File (VANDF) strings that have a clinical drug in RxNorm, so that every ingredient family in the file is in training. It maps a VANDF drug string to the RxNorm clinical drug it names (SCD or SBD: ingredient, strength, and dose form), with a calibrated confidence for routing uncertain strings to review. This model has no test set of its own: every VA string was used for training. Its expected accuracy comes from seven-fold cross-validation of the recipe, and a comparison with the first model on strings neither model trained on (below). Write-up: https://withinnoise.dev/blog/posts/vandf-rxnorm-interventions/…

Read Kevin Venanzi's full model card

VANDF → RxNorm clinical drug bi-encoder, trained on every ingredient family

The recipe of kvenanzi/vandf-rxnorm-biencoder, trained on all 14,369 VA National Drug File (VANDF) strings that have a clinical drug in RxNorm, so that every ingredient family in the file is in training. It maps a VANDF drug string to the RxNorm clinical drug it names (SCD or SBD: ingredient, strength, and dose form), with a calibrated confidence for routing uncertain strings to review.

This model has no test set of its own: every VA string was used for training. Its expected accuracy comes from seven-fold cross-validation of the recipe, and a comparison with the first model on strings neither model trained on (below). Write-up: https://withinnoise.dev/blog/posts/vandf-rxnorm-interventions/ (§5.4–5.5).

Usage

pip install "rxnorm-vandf @ git+https://github.com/kvenanzi/rxnorm"
from rxnorm_vandf.infer import Mapper

mapper = Mapper.from_pretrained("kvenanzi/vandf-rxnorm-biencoder-all")   # ~450 MB download
for p in mapper.map(["METOPROLOL TARTRATE 12.5MG TAB", "CATHETER,FOLEY SILICONE 22FR 5CC"]):
    print(p.rxcui, p.name, p.tty, f"{p.confidence:.2f}", "accept" if p.accept else "review")

Mapper loads the encoder, train_config.json (input preprocessing), calibration.json (score → probability), and candidates.parquet (the 27,287 active RxNorm SCD/SBD names it searches) from this repo. The default acceptance threshold (0.961) was chosen on pooled out-of-fold predictions for 99% precision on a population that includes real drugs with no SCD/SBD; pass threshold= to change it.

Expected accuracy

Seven folds of the ingredient hash used for the first model: each fold model trains the same recipe on five folds, selects its epoch on a sixth, and is tested once on the seventh. Pooled over the seven test folds:

acc@1 recall@5 n
Pooled out-of-fold 0.894 (Wilson 95% 0.889–0.899) 0.975 12,227 VA strings
Range over the seven folds 0.864–0.932 0.960–0.988 1,533–1,890 per fold

This is the expected accuracy on strings whose ingredients are new to the model. The fold models' best epochs were 1, 1, 3, 3, 1, 3, and 1; this model trained for the median, one epoch.

Comparison with the first model

Neither model trained on the FDA Structured Product Label names (MTHSPL), so those strings are held out from both:

Strings n First model This model
FDA label names whose ingredients both models trained on 28,464 0.729 0.753
FDA label names whose ingredients only this model trained on 13,492 0.716 0.746
VA strings both models trained on 9,287 0.939 0.909

On the first row, 1,409 strings are answered correctly by this model alone and 701 by the first model alone (exact sign test, p ≈ 2 × 10⁻⁵⁴). This model fits its own training strings less closely, as expected from one epoch of training, and is more accurate on strings that neither model saw.

Calibration

A temperature (0.0386) and a Platt layer over [cosine, top-1 − top-2 margin, log softmax], fit on the pooled out-of-fold predictions of 12,227 matched VA strings and 819 real drugs with no SCD/SBD. Thresholds chosen on six folds and applied to the seventh:

Target Threshold (pooled) Precision on the held-out fold Coverage
95% 0.735 0.922–0.967 about 0.81
99% (default) 0.961 0.986–0.998 about 0.50

The 99% threshold transfers across held-out ingredients more reliably than the 95% one. Re-choose thresholds on your own held-out data.

Training

  • Base model: SapBERT
  • MultipleNegativesRankingLoss on (VA string, RxNorm name, hard negative) triplets; the hard negative has the same ingredients and a different strength or dose form. The deterministic strength normalizer of the first model.
  • 1 epoch, batch 64, lr 2e-5, 10% warmup, fp16, max_seq_length 96, seed 42, one Colab A100
  • Data: every VANDF string with an SCD/SBD in RxNorm 2026-09-08 (14,369 strings, 14,372 pairs); no ingredient is held out.

Limitations

  • No test set of its own. The accuracy above is estimated by cross-validation of the recipe (one partition, one seed), not measured on this model.
  • Trained on VA strings only. On FDA label names acc@1 is about 0.75; other vocabularies are unmeasured.
  • Candidates are RxNorm 2026-09-08. RxNorm changes monthly; rebuild candidates.parquet for a newer release (scripts/03_build_dataset.py in the repo).
  • Not for unsupervised clinical use. Use the confidence to route uncertain strings to a pharmacist, or use the top-5 as suggestions.

Code: https://github.com/kvenanzi/rxnorm · Runs: https://wandb.ai/within-noise/rxnorm-vandf/table

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
kvenanzi/vandf-rxnorm-biencoder-all
Publisher
Kevin Venanzi
Task
Sentence similarity
Modality
Text
Library
sentence-transformers
Parameters
109M parameters
Languages
en
Revision
09a45273c3dda87989f759aea0a188eb8af3d8e1
First published
2026-09-15
Last updated
2026-09-23

Files and Weights

13 files, 439.7 MB in total. The weights are 1 file totalling 438.0 MB in safetensors.

Weights1 file · 438.0 MB
Configuration7 files · 2.7 KB
Tokenizer2 files · 706.7 KB
Documentation1 file · 5.3 KB
Other1 file · 1.1 MB
Repository1 file · 1.5 KB
Every file
FileTypeSizeSHA-256
model.safetensorsWeights438.0 MB 7cbae554dfde
1_Pooling/config.jsonConfiguration90 B
calibration.jsonConfiguration375 B
config.jsonConfiguration706 B
config_sentence_transformers.jsonConfiguration284 B
modules.jsonConfiguration277 B
sentence_bert_config.jsonConfiguration241 B
train_config.jsonConfiguration759 B
README.mdDocumentation5.3 KB
candidates.parquetOther1.1 MB afe3a761c940
.gitattributesRepository1.5 KB
tokenizer.jsonTokenizer706.3 KB
tokenizer_config.jsonTokenizer381 B

License and Download

License
apache-2.0
Access
Open weights, no gate
Download size
438.0 MB
Download from Kevin Venanzi

Released by Kevin Venanzi through its official repository on Hugging Face. Read the license.

Built From

Memory Requirements

PrecisionWeights in memory
As published438.0 MB
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.

Questions About vandf-rxnorm-biencoder-all

How much GPU memory does vandf-rxnorm-biencoder-all 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 vandf-rxnorm-biencoder-all 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 vandf-rxnorm-biencoder-all commercially?

Yes. vandf-rxnorm-biencoder-all 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 vandf-rxnorm-biencoder-all's context length?

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

Similar Models

This is a sentence-transformers model finetuned from BAAI/bge-base-en-v1.5. It maps sentences & paragraphs to a 768-dimensional dense vector space and can be used for semantic textual similarity, semantic search, paraphrase mining, text classification, clustering, and more. First install the Sentence Transformers library: Then you can load this model and run inference. Approximate statistics based on the first 45 samples: Approximate statistics based on the first 5 samples: - evalstrategy: steps - perdevicetrainbatchsize: 16 - perdeviceevalbatchsize: 16 - learningrate: 3e-06 - maxsteps: 24 - warmupratio: 0.1 - batchsampler: noduplicates - overwriteoutputdir: False - dopredict: False…

Open weights 109M parameters 512 tokens sentence-transformers

Model · Sentence similarity

pubmedbert-base-embeddings

NeuML

This is a PubMedBERT-base model fined-tuned using sentence-transformers. It maps sentences & paragraphs to a 768 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. PubMedBERT Embeddings produces higher quality embeddings than generalized models for medical literature. Further fine-tuning for a medical subdomain will result in even better performance. 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). Alternatively, the model can…

Open weights apache-2.0 109M parameters 512 tokens sentence-transformers

Model · Sentence similarity

vandf-rxnorm-biencoder

Kevin Venanzi

Maps a VA National Drug File (VANDF) drug string to the RxNorm clinical drug confidence so you can auto-accept the sure cases and route the rest to review. Published tools such as RxMap normalize to the ingredient level (IN/MIN). This model targets the full clinical drug, where a miss on strength or dose form is a wrong answer. Method, hypotheses, the full sweep, and the error Mapper loads the encoder, trainconfig.json (input preprocessing), calibration.json (score → probability), and candidates.parquet (the 27,287 active RxNorm SCD/SBD names it searches) from this repo. The default acceptance threshold (0.92) was chosen on validation for 99% precision on a population that includes real…

Open weights apache-2.0 109M parameters 512 tokens sentence-transformers

Model · Sentence similarity

finetuned-medical-bert

Fico Filbert

This is a sentence-transformers model finetuned from google-bert/bert-base-uncased. It maps inputs to a 768-dimensional dense vector space and can be used for semantic textual similarity, semantic search, paraphrase mining, classification, clustering, and more. First install the Sentence Transformers library: Then you can load this model and run inference. Approximate statistics based on the first 100 samples: - perdevicetrainbatchsize: 16 - perdeviceevalbatchsize: 16 - multidatasetbatchsampler: roundrobin - dopredict: False - predictionlossonly: True - perdevicetrainbatchsize: 16 - perdeviceevalbatchsize: 16 - gradientaccumulationsteps: 1 - evalaccumulationsteps: None…

Open weights 109M parameters 512 tokens sentence-transformers

Model · Sentence similarity

e5-base-v2

Liang Wang

Liang Wang, Nan Yang, Xiaolong Huang, Binxing Jiao, Linjun Yang, Daxin Jiang, Rangan Majumder, Furu Wei, arXiv 2022 This model has 12 layers and the embedding size is 768. Below is an example to encode queries and passages from the MS-MARCO passage ranking dataset. Please refer to our paper at https://arxiv.org/pdf/2212.03533.pdf. Check out unilm/e5 to reproduce evaluation results on the BEIR and MTEB benchmark. Below is an example for usage with sentencetransformers. Package requirements pip install sentencetransformers~=2.2.2 1. Do I need to add the prefix "query: " and "passage: " to input texts? Yes, this is how the model is trained, otherwise you will see a performance degradation.…

Open weights mit 109M parameters 512 tokens sentence-transformers

Model · Sentence similarity

e5-base

Liang Wang

News (May 2023): please switch to e5-base-v2, which has better performance and same method of usage. Liang Wang, Nan Yang, Xiaolong Huang, Binxing Jiao, Linjun Yang, Daxin Jiang, Rangan Majumder, Furu Wei, arXiv 2022 This model has 12 layers and the embedding size is 768. Below is an example to encode queries and passages from the MS-MARCO passage ranking dataset. Please refer to our paper at https://arxiv.org/pdf/2212.03533.pdf. Check out unilm/e5 to reproduce evaluation results on the BEIR and MTEB benchmark. Below is an example for usage with sentencetransformers. Package requirements pip install sentencetransformers~=2.2.2 1. Do I need to add the prefix "query: " and "passage: " to…

Open weights mit 109M parameters 512 tokens sentence-transformers