Skip to page content
SAVRN
Search Plan a project

Open-weight model · Fill mask

UltraBERT-380M-ONNX

by Pastel Labs pastel-labs/UltraBERT-380M-ONNX

UltraBERT-380M-ONNX is an open-weight model for fill mask from Pastel Labs, released under Apache License 2.0. Its published files total 2.6 GB.

ONNX export of dmis-lab/UltraBERT-380M for ONNX Runtime and Transformers.js. All credit for the model goes to dmis-lab. The weights are theirs, under the same Apache-2.0 license. We only converted the format.

Parameters—
Context—
Weights2.6 GB
Licenseapache-2.0
AccessOpen weights
Monthly Downloads—

Model Card

By Pastel Labs, published under apache-2.0, revision 7c98ad28ff8b.

ONNX export of dmis-lab/UltraBERT-380M for ONNX Runtime and Transformers.js. All credit for the model goes to dmis-lab. The weights are theirs, under the same Apache-2.0 license. We only converted the format. Inputs are inputids and attentionmask, with dynamic batch size and sequence length. Output is lasthiddenstate plus logits from the masked-language-model head. The sliding-window (128 tokens) and full-attention layers are built from the attention mask inside the graph, so padding and any length work. We ran 20 English texts through the original PyTorch model and through each ONNX file, then compared mean-pooled last hidden states with cosine similarity. Fifteen texts are short (3 to 25…

Read Pastel Labs's full model card

ONNX export of dmis-lab/UltraBERT-380M for ONNX Runtime and Transformers.js. All credit for the model goes to dmis-lab. The weights are theirs, under the same Apache-2.0 license. We only converted the format.

Files

Precision File Size Min cosine Mean cosine Top-1 token match
fp32 onnx/model.onnx 1720 MB 1.0000 1.00000 100.0%
fp16 onnx/model_fp16.onnx 860 MB 0.9995 0.99995 99.2%

Inputs are input_ids and attention_mask, with dynamic batch size and sequence length. Output is last_hidden_state plus logits from the masked-language-model head. The sliding-window (128 tokens) and full-attention layers are built from the attention mask inside the graph, so padding and any length work.

How we checked it

We ran 20 English texts through the original PyTorch model and through each ONNX file, then compared mean-pooled last hidden states with cosine similarity. Fifteen texts are short (3 to 25 tokens: questions, reviews, code, SQL, news, medical notes). Five are long book excerpts of 2,000 to 8,000 tokens, capped at 4,096 tokens for this model because of memory on our test machine. Top-1 token match is how often the highest-scoring vocabulary token at each position is the same as in PyTorch.

Pass bar: cosine of at least 0.99 on every text. fp32 and fp16 pass.

We left out a 4-bit (q4) file. Weight-only 4-bit quantization (ONNX Runtime MatMulNBits, block size 32) gave a minimum cosine of 0.926 and the masked-LM predictions stopped matching, below the bar. Asymmetric, HQQ and block-16 variants did not reach 0.99 either.

Transformers.js 3 loaded each file in Node, produced the same token ids as the Python tokenizer, and reproduced the ONNX Runtime vectors (cosine above 0.999).

Usage with Transformers.js

import { AutoTokenizer, AutoModel } from '@huggingface/transformers';

const id = 'pastel-labs/UltraBERT-380M-ONNX';
const tokenizer = await AutoTokenizer.from_pretrained(id);
const model = await AutoModel.from_pretrained(id, { dtype: 'fp16' }); // or 'fp32'

const out = await model(tokenizer('Paris is the capital of <|mask|>.'));
// out.logits: masked-language-model scores, [batch, tokens, 49152]
// out.last_hidden_state: token vectors, [batch, tokens, 1024]

Transformers.js v3 has no ultrabert model type, so AutoModel prints "Unknown model class" and falls back to the base class. That works and returns both outputs. AutoModelForMaskedLM and the fill-mask pipeline refuse the type. If you want a masked-LM class, ModernBertForMaskedLM.from_pretrained(id) loads this graph and returns logits (we checked that it predicts " France" for the example above). The architecture is not ModernBERT; that class only wraps the session.

Notes

  • fp16 marks the RMSNorm and softmax ops to stay in fp32 to avoid overflow; matrix multiplies run in fp16.
  • Exported with the PyTorch TorchScript exporter, opset 17, from the original modeling_ultrabert.py (eager attention).
  • English only, like the original.

Configuration

Architecture
UltrabertForMaskedLM
Layers
24
Hidden size
1,024
Feed-forward size
3,072
Attention heads
8
Key/value heads
8
Head dimension
128
Vocabulary size
49,152
Model type
ultrabert

Identity and Version

Repository
pastel-labs/UltraBERT-380M-ONNX
Publisher
Pastel Labs
Task
Fill mask
Modality
Text
Library
transformers.js
Parameters
Not stated by the source
Languages
en
Revision
7c98ad28ff8bcd42c7c888ffcff22f85926cab5a
First published
2026-10-15
Last updated
2026-10-15

Files and Weights

9 files, 2.6 GB in total. The weights are 2 files totalling 2.6 GB in onnx.

Weights2 files · 2.6 GB
Configuration3 files · 34.5 KB
Tokenizer2 files · 3.5 MB
Documentation1 file · 3.3 KB
Repository1 file · 1.5 KB
Every file
FileTypeSizeSHA-256
onnx/model.onnxWeights1.7 GB fcd85a1b4fee
onnx/model_fp16.onnxWeights860.5 MB 56838a15237f
config.jsonConfiguration1.7 KB —
configuration_ultrabert.pyConfiguration2.2 KB —
modeling_ultrabert.pyConfiguration30.6 KB —
README.mdDocumentation3.3 KB —
.gitattributesRepository1.5 KB —
tokenizer.jsonTokenizer3.5 MB —
tokenizer_config.jsonTokenizer765 B —

License and Download

License
apache-2.0
Access
Open weights, no gate
Download size
2.6 GB
Download from Pastel Labs

Released by Pastel Labs through its official repository on Hugging Face. Read the license.

Built From

  • Derived from dmis-lab/UltraBERT-380M
  • Quantized from dmis-lab/UltraBERT-380M

Memory Requirements

PrecisionWeights in memory
As published2.6 GB

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

Questions About UltraBERT-380M-ONNX

Can I use UltraBERT-380M-ONNX commercially?

Yes. UltraBERT-380M-ONNX 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.

Similar Models

Model · Fill mask

mdeberta-v3-base

Microsoft

DeBERTa improves the BERT and RoBERTa models using disentangled attention and enhanced mask decoder. With those two improvements, DeBERTa out perform RoBERTa on a majority of NLU tasks with 80GB training data. In DeBERTa V3, we further improved the efficiency of DeBERTa using ELECTRA-Style pre-training with Gradient Disentangled Embedding Sharing. Compared to DeBERTa, our V3 version significantly improves the model performance on downstream tasks. You can find more technique details about the new model from our paper. Please check the official repository for more implementation details and updates. mDeBERTa is multilingual version of DeBERTa which use the same structure as DeBERTa and was…

Open weights mit 512 tokens transformers

Model · Fill mask

deberta-v3-base

Microsoft

DeBERTa improves the BERT and RoBERTa models using disentangled attention and enhanced mask decoder. With those two improvements, DeBERTa out perform RoBERTa on a majority of NLU tasks with 80GB training data. In DeBERTa V3, we further improved the efficiency of DeBERTa using ELECTRA-Style pre-training with Gradient Disentangled Embedding Sharing. Compared to DeBERTa, our V3 version significantly improves the model performance on downstream tasks. You can find more technique details about the new model from our paper. Please check the official repository for more implementation details and updates. The DeBERTa V3 base model comes with 12 layers and a hidden size of 768. It has only 86M…

Open weights mit 512 tokens transformers

Model · Fill mask

Bio_ClinicalBERT

Emily Alsentzer

The Publicly Available Clinical BERT Embeddings paper contains four unique clinicalBERT models: initialized with BERT-Base (casedL-12H-768A-12) or BioBERT (BioBERT-Base v1.0 + PubMed 200K + PMC 270K) & trained on either all MIMIC notes or only discharge summaries. This model card describes the Bio+Clinical BERT model, which was initialized from BioBERT & trained on all MIMIC notes. The BioClinicalBERT model was trained on all notes from MIMIC III, a database containing electronic health records from ICU patients at the Beth Israel Hospital in Boston, MA. For more details on MIMIC, see here. All notes from the NOTEEVENTS table were included (~880M words). Each note in MIMIC was first split…

Open weights mit 512 tokens transformers

This model was previously named "PubMedBERT (abstracts)". You can either adopt the new model name "microsoft/BiomedNLP-BiomedBERT-base-uncased-abstract" or update your transformers library to version 4.22+ if you need to refer to the old name. Pretraining large neural language models, such as BERT, has led to impressive gains on many natural language processing (NLP) tasks. However, most pretraining efforts focus on general domain corpora, such as newswire and Web. A prevailing assumption is that even domain-specific pretraining can benefit by starting from general-domain language models. Recent work shows that for domains with abundant unlabeled text, such as biomedicine, pretraining…

Open weights mit 512 tokens transformers

LEGAL-BERT is a family of BERT models for the legal domain, intended to assist legal NLP research, computational law, and legal technology applications. To pre-train the different variations of LEGAL-BERT, we collected 12 GB of diverse English legal text from several fields (e.g., legislation, court cases, contracts) scraped from publicly available resources. Sub-domain variants (CONTRACTS-, EURLEX-, ECHR-) and/or general LEGAL-BERT perform better than using BERT out of the box for domain-specific tasks. A light-weight model (33% the size of BERT-BASE) pre-trained from scratch on legal data with competitive performance is also available. I. Chalkidis, M. Fergadiotis, P. Malakasiotis, N.…

Open weights cc-by-sa-4.0 512 tokens transformers

Model · Fill mask

deberta-v3-large

Microsoft

DeBERTa improves the BERT and RoBERTa models using disentangled attention and enhanced mask decoder. With those two improvements, DeBERTa out perform RoBERTa on a majority of NLU tasks with 80GB training data. In DeBERTa V3, we further improved the efficiency of DeBERTa using ELECTRA-Style pre-training with Gradient Disentangled Embedding Sharing. Compared to DeBERTa, our V3 version significantly improves the model performance on downstream tasks. You can find more technique details about the new model from our paper. Please check the official repository for more implementation details and updates. The DeBERTa V3 large model comes with 24 layers and a hidden size of 1024. It has 304M…

Open weights mit 512 tokens transformers