Text Ranking
sentence-transformers
Safetensors
Transformers
multilingual
t5gemma2
text2text-generation
reranker
encoder-decoder
FBNL
matryoshka
retrieval
RAG
Instructions to use KaLM-Embedding/KaLM-Reranker-V1-Nano-R2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use KaLM-Embedding/KaLM-Reranker-V1-Nano-R2 with sentence-transformers:
from sentence_transformers import CrossEncoder model = CrossEncoder("KaLM-Embedding/KaLM-Reranker-V1-Nano-R2") query = "Which planet is known as the Red Planet?" passages = [ "Venus is often called Earth's twin because of its similar size and proximity.", "Mars, known for its reddish appearance, is often referred to as the Red Planet.", "Jupiter, the largest planet in our solar system, has a prominent red spot.", "Saturn, famous for its rings, is sometimes mistaken for the Red Planet." ] scores = model.predict([(query, passage) for passage in passages]) print(scores) - Transformers
How to use KaLM-Embedding/KaLM-Reranker-V1-Nano-R2 with Transformers:
# Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("KaLM-Embedding/KaLM-Reranker-V1-Nano-R2") model = AutoModelForMultimodalLM.from_pretrained("KaLM-Embedding/KaLM-Reranker-V1-Nano-R2", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files
README.md
CHANGED
|
@@ -51,6 +51,7 @@ library_name: sentence-transformers
|
|
| 51 |
|
| 52 |

|
| 53 |
|
|
|
|
| 54 |
|
| 55 |
| Capability | KaLM-Reranker-V1 | KaLM-Reranker-V1-R2 |
|
| 56 |
|:--|:--|:--|
|
|
@@ -60,7 +61,6 @@ library_name: sentence-transformers
|
|
| 60 |
| Multi-domain ranking | Strong | **Improved on BEIR for all three sizes** |
|
| 61 |
| Multilingual ranking | Limited | **Substantially improved across MIRACL's 18 languages** |
|
| 62 |
|
| 63 |
-

|
| 64 |
|
| 65 |
### KaLM-Reranker-V1-R2 vs. the original KaLM-Reranker-V1
|
| 66 |
All results below use the same default compression ratio, `r=4`. KaLM-Reranker-V1 results are taken from the previous model cards; KaLM-Reranker-V1-R2 results are from the updated paper.
|
|
@@ -109,19 +109,20 @@ All results below use the same default compression ratio, `r=4`. KaLM-Reranker-V
|
|
| 109 |
| **KaLM-Reranker-V1-Large-R2** | **75.12** | **74.92** | **74.50** | **73.85** | **73.26** | **72.46** | **71.97** |
|
| 110 |
| **Delta** | **+4.82** | **+4.85** | **+4.87** | **+5.60** | **+7.32** | — | — |
|
| 111 |
|
| 112 |
-
R2 consistently outperforms V1 at every shared compression ratio. The gains increase as compression becomes more aggressive, demonstrating substantially improved compression robustness.
|
| 113 |
|
| 114 |
|
| 115 |
|
| 116 |
### Model family
|
| 117 |
|
|
|
|
|
|
|
| 118 |
| Models | Activated Params. | Non-Embedding Params. | Embedding Params. | #Layers (encoder + decoder) | Sequence Length | Document Token Dim. | MEP Support | Instruction Aware | Test-Time Compute |
|
| 119 |
| ------------------------------------------------------------------------------------------------- | -----------------: | --------------------: | ----------------: | --------------------------: | --------------: | ------------------: | ----------: | ----------------: | ----------------: |
|
| 120 |
| [KaLM-Reranker-V1-Nano-R2](https://huggingface.co/KaLM-Embedding/KaLM-Reranker-V1-Nano-R2) | 0.27B | 100M | 168M | 18+18 | 128K | 640 | 1x-128x | Yes | Yes |
|
| 121 |
| [KaLM-Reranker-V1-Small-R2](https://huggingface.co/KaLM-Embedding/KaLM-Reranker-V1-Small-R2) | 1B | 698M | 302M | 26+26 | 128K | 1152 | 1x-128x | Yes | Yes |
|
| 122 |
| [KaLM-Reranker-V1-Large-R2](https://huggingface.co/KaLM-Embedding/KaLM-Reranker-V1-Large-R2) | 4B | 3209M | 675M | 34+34 | 128K | 2560 | 1x-128x | Yes | Yes |
|
| 123 |
|
| 124 |
-
The reported sizes are **activated parameters**. Nano, Small, and Large are initialized from the T5Gemma2 270M-270M, 1B-1B, and 4B-4B encoder-decoder families, respectively.
|
| 125 |
|
| 126 |
|
| 127 |
### Prompt Template
|
|
|
|
| 51 |
|
| 52 |

|
| 53 |
|
| 54 |
+

|
| 55 |
|
| 56 |
| Capability | KaLM-Reranker-V1 | KaLM-Reranker-V1-R2 |
|
| 57 |
|:--|:--|:--|
|
|
|
|
| 61 |
| Multi-domain ranking | Strong | **Improved on BEIR for all three sizes** |
|
| 62 |
| Multilingual ranking | Limited | **Substantially improved across MIRACL's 18 languages** |
|
| 63 |
|
|
|
|
| 64 |
|
| 65 |
### KaLM-Reranker-V1-R2 vs. the original KaLM-Reranker-V1
|
| 66 |
All results below use the same default compression ratio, `r=4`. KaLM-Reranker-V1 results are taken from the previous model cards; KaLM-Reranker-V1-R2 results are from the updated paper.
|
|
|
|
| 109 |
| **KaLM-Reranker-V1-Large-R2** | **75.12** | **74.92** | **74.50** | **73.85** | **73.26** | **72.46** | **71.97** |
|
| 110 |
| **Delta** | **+4.82** | **+4.85** | **+4.87** | **+5.60** | **+7.32** | — | — |
|
| 111 |
|
| 112 |
+
KaLM-Reranker-V1-R2 consistently outperforms KaLM-Reranker-V1 at every shared compression ratio. The gains increase as compression becomes more aggressive, demonstrating substantially improved compression robustness.
|
| 113 |
|
| 114 |
|
| 115 |
|
| 116 |
### Model family
|
| 117 |
|
| 118 |
+
The reported sizes are **activated parameters**. Nano, Small, and Large are initialized from the T5Gemma2 270M-270M, 1B-1B, and 4B-4B encoder-decoder families, respectively.
|
| 119 |
+
|
| 120 |
| Models | Activated Params. | Non-Embedding Params. | Embedding Params. | #Layers (encoder + decoder) | Sequence Length | Document Token Dim. | MEP Support | Instruction Aware | Test-Time Compute |
|
| 121 |
| ------------------------------------------------------------------------------------------------- | -----------------: | --------------------: | ----------------: | --------------------------: | --------------: | ------------------: | ----------: | ----------------: | ----------------: |
|
| 122 |
| [KaLM-Reranker-V1-Nano-R2](https://huggingface.co/KaLM-Embedding/KaLM-Reranker-V1-Nano-R2) | 0.27B | 100M | 168M | 18+18 | 128K | 640 | 1x-128x | Yes | Yes |
|
| 123 |
| [KaLM-Reranker-V1-Small-R2](https://huggingface.co/KaLM-Embedding/KaLM-Reranker-V1-Small-R2) | 1B | 698M | 302M | 26+26 | 128K | 1152 | 1x-128x | Yes | Yes |
|
| 124 |
| [KaLM-Reranker-V1-Large-R2](https://huggingface.co/KaLM-Embedding/KaLM-Reranker-V1-Large-R2) | 4B | 3209M | 675M | 34+34 | 128K | 2560 | 1x-128x | Yes | Yes |
|
| 125 |
|
|
|
|
| 126 |
|
| 127 |
|
| 128 |
### Prompt Template
|