Model reference · open weights
EdgeCoder-31M is an open-weight embedding model from knowledgator. EdgeCoder-31M (BF16) weighs 62 MB; the smallest configuration that runs it is RTX 3060 12 GB.
For self-hosting, compare this build's requirements below with the GPU you plan to rent.
Summary of the knowledgator/EdgeCoder-31M model card, 2026-11-30
What it is
| Released by | knowledgator |
|---|---|
| Released | 2026-10-29 |
| Parameters | 31M |
| VRAM | 62 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
EdgeCoder-31M is a compact English text encoder (31M parameters, 8 layers) with a context of up to 8192 tokens. It is pre-trained with ModernELECTRA: replaced-token detection (RTD), as in ELECTRA and DeBERTaV3, plus a boundary-window reconstruction task.
RTD encoders are strong on classification but usually weak as backbones for embedding models. EdgeCoder-31M keeps the classification quality of RTD and, after fine-tuning, matches masked-language-model encoders of its size on embedding tasks.
| Architecture | DeBERTa-v2 (disentangled relative attention, no absolute positions) |
| Layers / hidden / FFN / heads | 8 / 384 / 1536 / 6 |
| Token embedding | factorized: 128-d table with a linear projection to 384 |
| Parameters | 31.0M (14.2M without the embedding table) |
| Maximum sequence length | 8192 tokens |
| Tokenizer | DeBERTa-v3 SentencePiece (128,100 tokens) |
| Language | English |
The repository contains the discriminator encoder. It has no masked-language-model head, so it is meant for fine-tuning and feature extraction, not for fill-mask.
The checkpoint is a standard DeBERTa-v2 model and loads with transformers:
from transformers import AutoTokenizer, AutoModel
tokenizer = AutoTokenizer.from_pretrained("knowledgator/EdgeCoder-31M")
model = AutoModel.from_pretrained("knowledgator/EdgeCoder-31M")
inputs = tokenizer("EdgeCoder is a compact text encoder.", return_tensors="pt")
outputs = model(**inputs)
hidden = outputs.last_hidden_state # (batch, seq_len, 384)
For fine-tuning, use the usual task heads, for example AutoModelForSequenceClassification or AutoModelForTokenClassification.
The standard DeBERTa attention needs memory that grows quadratically with the sequence length. For long inputs, we recommend FlashDeBERTa, the implementation the model was trained with. It loads the same checkpoint:
pip install flashdeberta -U
import torch
from transformers import AutoTokenizer
from flashdeberta import FlashDebertaV2Model
tokenizer = AutoTokenizer.from_pretrained("knowledgator/EdgeCoder-31M")
model = FlashDebertaV2Model.from_pretrained("knowledgator/EdgeCoder-31M").to("cuda")
inputs = tokenizer(long_text, truncation=True, max_length=8192, return_tensors="pt").to("cuda")
with torch.no_grad():
outputs = model(**inputs)
FlashDeBERTa also provides heads for sequence and token classification, question answering and multiple choice.
All numbers are from the paper. Baselines were run with the same protocols.
Single seed, best run of a hyperparameter sweep that follows the Ettin protocol.
| Model | Params | CoLA | SST-2 | MRPC | STS-B | QQP | MNLI | QNLI | RTE | Avg |
|---|---|---|---|---|---|---|---|---|---|---|
| BERT-small | 28.8M | 44.8 | 90.1 | 83.1 | 87.6 | 90.1 | 79.2 | 88.2 | 69.3 | 79.0 |
| MiniLM-L12 | 33.4M | 59.1 | 93.3 | 91.2 | 89.2 | 91.5 | 85.6 | 91.9 | 74.7 | 84.6 |
| Ettin-Enc-32m | 31.9M | 57.4 | 92.0 | 89.7 | 89.5 | 91.0 | 83.4 | 90.7 | 74.7 | 83.5 |
| EdgeCoder-31M | 31.0M | 64.9 | 92.2 | 91.8 | 90.2 | 91.1 | 84.5 | 90.3 | 82.7 | 86.0 |
| Larger models, for reference | ||||||||||
| DistilBERT | 66.4M | 56.9 | 92.2 | 86.8 | 87.4 | 90.8 | 82.7 | 89.5 | 66.1 | 81.5 |
| BERT-base | 109.5M | 59.0 | 93.1 | 89.5 | 89.4 | 91.4 | 85.4 | 91.6 | 78.2 | 84.7 |
| Ettin-Enc-68m | 68.1M | 64.8 | 94.4 | 92.2 | 91.1 | 91.9 | 87.0 | 92.9 | 83.8 | 87.2 |
Each backbone is fine-tuned once into a sentence embedding model on 1M MS MARCO triplets (one epoch, mean pooling, contrastive loss) and then evaluated on the 41 tasks of MTEB English v2. The scores describe the backbone after this fine-tuning, not the checkpoint in this repository used as is.
| Model | Params | Class. | Clust. | PairCl. | Rerank. | Retr. | STS | Summ. | Mean (Type) |
|---|---|---|---|---|---|---|---|---|---|
| BERT-small | 28.8M | 64.7 | 39.6 | 79.4 | 41.7 | 38.1 | 73.0 | 21.6 | 51.1 |
| MiniLM-L12 | 33.4M | 64.9 | 37.8 | 79.8 | 43.5 | 38.4 | 73.2 | 21.4 | 51.3 |
| Ettin-Enc-32m | 31.9M | 64.2 | 39.6 | 77.1 | 42.6 | 39.7 | 73.2 | 19.9 | 50.9 |
| EdgeCoder-31M | 31.0M | 65.3 | 39.7 | 78.0 | 42.3 | 38.6 | 73.1 | 20.9 | 51.1 |
Quoted from the model card on Hugging Face. The full card is behind the Hugging Face link above.