# ms-marco-MiniLM-L4-v2 by Sentence Transformers - Cross-Encoders
Source: https://savrn.com/models/ms-marco-minilm-l4-v2
Markdown alternate of the page above; the site index is https://savrn.com/llms.txt

---

## Runs On

What it takes to serve ms-marco-MiniLM-L4-v2 (19M parameters): the memory its weights need at each precision, and the cheapest way to rent enough data-center GPUs to hold them.

| Precision | Weights | Memory needed | Cheapest setup | Per hour | Also fits |
| --- | --- | --- | --- | --- | --- |
| 16-bit | 0.0 GB | 0.0 GB | 1x [MI300X](https://savrn.com/ai-index/pricing/gpus/mi300x) (192 GB) Vultr | $1.85 | [1x H100](https://savrn.com/ai-index/pricing/gpus/h100) $1.99 · [1x MI325X](https://savrn.com/ai-index/pricing/gpus/mi325x) $2.00 |
| 8-bit | 0.0 GB | 0.0 GB | 1x [MI300X](https://savrn.com/ai-index/pricing/gpus/mi300x) (192 GB) Vultr | $1.85 | [1x H100](https://savrn.com/ai-index/pricing/gpus/h100) $1.99 · [1x MI325X](https://savrn.com/ai-index/pricing/gpus/mi325x) $2.00 |
| 4-bit | 0.0 GB | 0.0 GB | 1x [MI300X](https://savrn.com/ai-index/pricing/gpus/mi300x) (192 GB) Vultr | $1.85 | [1x H100](https://savrn.com/ai-index/pricing/gpus/h100) $1.99 · [1x MI325X](https://savrn.com/ai-index/pricing/gpus/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](https://savrn.com/ai-index/pricing/gpus), read Oct 24, 2026.

[ms-marco-MiniLM-L4-v2 on every accelerator the SAVRN Index prices, at every precision](https://savrn.com/models/ms-marco-minilm-l4-v2/gpus)

## SAVRN's Notes on ms-marco-MiniLM-L4-v2

This is one of the most used rerankers anywhere: about 4.8 million downloads a month. A cross-encoder reads the query and each candidate passage together, and this four-layer MiniLM version at 19M parameters is small enough to rerank dozens of results in milliseconds on a CPU.

Apache 2.0 allows commercial use. It is trained on MS MARCO, English web search. For English retrieval pipelines, adding it after first-stage search is one of the cheapest quality gains available; the six- and twelve-layer versions trade a little speed for accuracy.

SAVRN Research, 2026-09-18

## Model Card

By Sentence Transformers - Cross-Encoders, published under apache-2.0, revision 777b2f369bc1.

### Cross-Encoder for MS Marco

This model was trained on the [MS Marco Passage Ranking](https://github.com/microsoft/MSMARCO-Passage-Ranking) task.

The model can be used for Information Retrieval: Given a query, encode the query will all possible passages (e.g. retrieved with ElasticSearch). Then sort the passages in a decreasing order. See [SBERT.net Retrieve & Re-rank](https://www.sbert.net/examples/applications/retrieve_rerank/README.html) for more details. The training code is available here: [SBERT.net Training MS Marco](https://github.com/UKPLab/sentence-transformers/tree/master/examples/cross_encoder/training/ms_marco)

### Usage with SentenceTransformers

The usage is easy when you have [SentenceTransformers](https://www.sbert.net/) installed. Then you can use the pre-trained models like this:

```
from sentence_transformers import CrossEncoder

model = CrossEncoder('cross-encoder/ms-marco-MiniLM-L4-v2')
scores = model.predict([
    ("How many people live in Berlin?", "Berlin had a population of 3,520,031 registered inhabitants in an area of 891.82 square kilometers."),
    ("How many people live in Berlin?", "Berlin is well known for its museums."),
])
print(scores)
# [ 9.1273365 -4.569759 ]
```

### Usage with Transformers

[Read the full model card (316 words)](https://savrn.com/models/ms-marco-minilm-l4-v2/card)

## Configuration

Architecture

BertForSequenceClassification

Context length (tokens)

512

Layers

4

Hidden size

384

Feed-forward size

1,536

Attention heads

12

Vocabulary size

30,522

Model type

bert

## Identity and Version

Repository

cross-encoder/ms-marco-MiniLM-L4-v2

Publisher

Sentence Transformers - Cross-Encoders

Task

Text ranking

Modality

Other

Library

sentence-transformers

Parameters

19M parameters

Languages

en

Revision

777b2f369bc1c2f850df8bd367ed1654bda4497b

First published

2022-03-02

Last updated

2025-08-29

## Files and Weights

23 files, 750.7 MB in total. The weights are 14 files totalling 749.4 MB in bin, msgpack, onnx, safetensors.

Weights14 files · 749.4 MB

Configuration2 files · 926 B

Tokenizer3 files · 944.2 KB

Documentation1 file · 3.7 KB

Other2 files · 408.4 KB

Repository1 file · 790 B

Every file

| File | Type | Size | SHA-256 |
| --- | --- | --- | --- |
| flax_model.msgpack | Weights | 76.7 MB | 6696cd546b69 |
| model.safetensors | Weights | 76.7 MB | 3db1c98132b5 |
| onnx/model.onnx | Weights | 76.8 MB | be236c757857 |
| onnx/model_O1.onnx | Weights | 76.7 MB | 45b021acb951 |
| onnx/model_O2.onnx | Weights | 76.7 MB | 4ca7ed6294c5 |
| onnx/model_O3.onnx | Weights | 76.7 MB | a969f82ecdc4 |
| onnx/model_O4.onnx | Weights | 38.4 MB | 89a50b9276ab |
| onnx/model_qint8_arm64.onnx | Weights | 19.5 MB | 2e3e3db7950b |
| onnx/model_qint8_avx512.onnx | Weights | 19.5 MB | 2e3e3db7950b |
| onnx/model_qint8_avx512_vnni.onnx | Weights | 19.5 MB | 2e3e3db7950b |
| onnx/model_quint8_avx2.onnx | Weights | 19.5 MB | 74118ad9ab2b |
| openvino/openvino_model.bin | Weights | 76.7 MB | c98398f19870 |
| openvino/openvino_model_qint8_quantized.bin | Weights | 19.5 MB | 026119caa48e |
| pytorch_model.bin | Weights | 76.7 MB | 943560a8b409 |
| config.json | Configuration | 794 B | — |
| special_tokens_map.json | Configuration | 132 B | — |
| README.md | Documentation | 3.7 KB | — |
| openvino/openvino_model.xml | Other | 146.5 KB | — |
| openvino/openvino_model_qint8_quantized.xml | Other | 261.9 KB | — |
| .gitattributes | Repository | 790 B | — |
| tokenizer.json | Tokenizer | 711.4 KB | — |
| tokenizer_config.json | Tokenizer | 1.3 KB | — |
| vocab.txt | Tokenizer | 231.5 KB | — |

## License and Download

License

apache-2.0

Access

Open weights, no gate

Download size

749.4 MB

[Download from Sentence Transformers - Cross-Encoders](https://huggingface.co/cross-encoder/ms-marco-MiniLM-L4-v2)

Released by Sentence Transformers - Cross-Encoders through its official repository on Hugging Face. [Read the license](https://www.apache.org/licenses/LICENSE-2.0).

## Built From

- Derived from [cross-encoder/ms-marco-MiniLM-L12-v2](https://savrn.com/models/ms-marco-minilm-l12-v2)
- Quantized from [cross-encoder/ms-marco-MiniLM-L12-v2](https://savrn.com/models/ms-marco-minilm-l12-v2)
- Trained on (disclosed) sentence-transformers/msmarco

## Memory Requirements

| Precision | Weights in memory |
| --- | --- |
| As published | 749.4 MB |
| 16-bit | 0.0 GB |
| 8-bit | 0.0 GB |
| 4-bit | 0.0 GB |

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

## Compare ms-marco-MiniLM-L4-v2

- [ms-marco-MiniLM-L4-v2 vs ms-marco-MiniLM-L6-v2](https://savrn.com/models/compare/ms-marco-minilm-l4-v2-vs-ms-marco-minilm-l6-v2)
- [ms-marco-MiniLM-L12-v2 vs ms-marco-MiniLM-L4-v2](https://savrn.com/models/compare/ms-marco-minilm-l12-v2-vs-ms-marco-minilm-l4-v2)
- [ms-marco-MiniLM-L2-v2 vs ms-marco-MiniLM-L4-v2](https://savrn.com/models/compare/ms-marco-minilm-l2-v2-vs-ms-marco-minilm-l4-v2)

## Questions About ms-marco-MiniLM-L4-v2

### How much GPU memory does ms-marco-MiniLM-L4-v2 need?

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

### What is the cheapest GPU to run ms-marco-MiniLM-L4-v2 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 ms-marco-MiniLM-L4-v2 commercially?

Yes. ms-marco-MiniLM-L4-v2 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 ms-marco-MiniLM-L4-v2's context length?

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

## Similar Models

Model · Text ranking

### [ms-marco-MiniLM-L6-v2](https://savrn.com/models/ms-marco-minilm-l6-v2)

[Sentence Transformers - Cross-Encoders](https://savrn.com/model-publishers/cross-encoder)

This model was trained on the MS Marco Passage Ranking task. The model can be used for Information Retrieval: Given a query, encode the query with all possible passages (e.g. retrieved with ElasticSearch). Then sort the passages in a decreasing order. See SBERT.net Retrieve & Re-rank for more details. The training code is available here: SBERT.net Training MS Marco The usage is easy when you have SentenceTransformers installed. Then you can use the pre-trained models like this: In the following table, we provide various pre-trained Cross-Encoders together with their performance on the TREC Deep Learning 2019 and the MS Marco Passage Reranking dataset.

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

[View model](https://savrn.com/models/ms-marco-minilm-l6-v2)

Model · Text ranking

### [ms-marco-MiniLM-L2-v2](https://savrn.com/models/ms-marco-minilm-l2-v2)

[Sentence Transformers - Cross-Encoders](https://savrn.com/model-publishers/cross-encoder)

This model was trained on the MS Marco Passage Ranking task. The model can be used for Information Retrieval: Given a query, encode the query will all possible passages (e.g. retrieved with ElasticSearch). Then sort the passages in a decreasing order. See SBERT.net Retrieve & Re-rank for more details. The training code is available here: SBERT.net Training MS Marco The usage is easy when you have SentenceTransformers installed. Then you can use the pre-trained models like this: In the following table, we provide various pre-trained Cross-Encoders together with their performance on the TREC Deep Learning 2019 and the MS Marco Passage Reranking dataset.

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

[View model](https://savrn.com/models/ms-marco-minilm-l2-v2)

Model · Text ranking

### [ms-marco-MiniLM-L12-v2](https://savrn.com/models/ms-marco-minilm-l12-v2)

[Sentence Transformers - Cross-Encoders](https://savrn.com/model-publishers/cross-encoder)

This model was trained on the MS Marco Passage Ranking task. The model can be used for Information Retrieval: Given a query, encode the query will all possible passages (e.g. retrieved with ElasticSearch). Then sort the passages in a decreasing order. See SBERT.net Retrieve & Re-rank for more details. The training code is available here: SBERT.net Training MS Marco The usage is easy when you have SentenceTransformers installed. Then you can use the pre-trained models like this: In the following table, we provide various pre-trained Cross-Encoders together with their performance on the TREC Deep Learning 2019 and the MS Marco Passage Reranking dataset.

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

[View model](https://savrn.com/models/ms-marco-minilm-l12-v2)

Model · Text ranking

### [ms-marco-TinyBERT-L2-v2](https://savrn.com/models/ms-marco-tinybert-l2-v2)

[Sentence Transformers - Cross-Encoders](https://savrn.com/model-publishers/cross-encoder)

This model was trained on the MS Marco Passage Ranking task. The model can be used for Information Retrieval: Given a query, encode the query will all possible passages (e.g. retrieved with ElasticSearch). Then sort the passages in a decreasing order. See SBERT.net Retrieve & Re-rank for more details. The training code is available here: SBERT.net Training MS Marco The usage becomes easier when you have SentenceTransformers installed. Then, you can use the pre-trained models like this: In the following table, we provide various pre-trained Cross-Encoders together with their performance on the TREC Deep Learning 2019 and the MS Marco Passage Reranking dataset.

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

[View model](https://savrn.com/models/ms-marco-tinybert-l2-v2)

Model · Text ranking

### [ettin-150m-memory-reranker-ft-v1](https://savrn.com/models/ettin-150m-memory-reranker-ft-v1)

[Daecore](https://savrn.com/model-publishers/daecore)

An English cross-encoder for ranking passages from notes, procedures, decisions and technical documentation. Give it a query and candidate passages; it returns one relevance score per pair. It is a fine-tune of Ettin Reranker 150M and runs locally through ONNX Runtime. This revision adds a Vulkan FP32 graph, model.vulkan.onnx; the learned weights and the CUDA FP16 graph are unchanged. It omits the DirectML graph, which remains in the previous revision. Install tokenizers, numpy and onnxruntime-gpu[cuda,cudnn]==1.24.4. Keep model.onnx, model.onnx.data and the tokenizer from the same package together. This CUDA example assumes that package is in downloaded-model and scores two passages…

Open weights apache-2.0 7,999 tokens

[View model](https://savrn.com/models/ettin-150m-memory-reranker-ft-v1)

Model · Text ranking

### [rerank-indonesia-Q8_0-GGUF](https://savrn.com/models/rerank-indonesia-q8-0-gguf)

[Radhi Fadlillah](https://savrn.com/model-publishers/radhifadlillah)

This model was converted to GGUF format from madebyaris/rerank-indonesia using llama.cpp via the ggml.ai's GGUF-my-repo space. Refer to the original model card for more details on the model. Install llama.cpp through brew (works on Mac and Linux) Invoke the llama.cpp server or the CLI. Note: You can also use this checkpoint directly through the usage steps listed in the Llama.cpp repo as well. Step 2: Move into the llama.cpp folder and build it with LLAMACURL=1 flag along with other hardware-specific flags (for ex: LLAMACUDA=1 for Nvidia GPUs on Linux).

Open weights apache-2.0 sentence-transformers

[View model](https://savrn.com/models/rerank-indonesia-q8-0-gguf)

## Sentence Transformers - Cross-Encoders

[All models and datasets](https://savrn.com/model-publishers/cross-encoder)

## Versions

- [777b2f369bc1](https://savrn.com/models/ms-marco-minilm-l4-v2/versions/777b2f369bc1) · current 2026-10-24

## Explore More

- [All text ranking models](https://savrn.com/models/tasks/text-ranking)
- [All models under apache-2.0](https://savrn.com/models/licenses/apache-2-0)
- [Model comparisons](https://savrn.com/models/comparisons)
- [The model directory](https://savrn.com/models)
- [Open model prices by host](https://savrn.com/ai-index/pricing/open-models)

## Source

- Repository metadata, read 2026-10-19.
- [Sentence Transformers - Cross-Encoders website](https://sbert.net/)
- [Hugging Face record](https://huggingface.co/cross-encoder/ms-marco-MiniLM-L4-v2)
- [How the hub is built](https://savrn.com/model-hub/methodology)
