---
language:
- en
license: apache-2.0
tags:
- sentence-transformers
- cross-encoder
- generated_from_trainer
- dataset_size:578402
- loss:BinaryCrossEntropyLoss
base_model: microsoft/MiniLM-L12-H384-uncased
pipeline_tag: text-ranking
library_name: sentence-transformers
metrics:
- map
- mrr@10
- ndcg@10
co2_eq_emissions:
emissions: 55.59664796149612
energy_consumed: 0.14303154591819986
source: codecarbon
training_type: fine-tuning
on_cloud: false
cpu_model: 13th Gen Intel(R) Core(TM) i7-13700K
ram_total_size: 31.777088165283203
hours_used: 0.391
hardware_used: 1 x NVIDIA GeForce RTX 3090
model-index:
- name: MiniLM-L12-H384-uncased trained on GooAQ
results:
- task:
type: cross-encoder-reranking
name: Cross Encoder Reranking
dataset:
name: gooaq dev
type: gooaq-dev
metrics:
- type: map
value: 0.6856
name: Map
- type: mrr@10
value: 0.683
name: Mrr@10
- type: ndcg@10
value: 0.7314
name: Ndcg@10
- task:
type: cross-encoder-reranking
name: Cross Encoder Reranking
dataset:
name: NanoMSMARCO R100
type: NanoMSMARCO_R100
metrics:
- type: map
value: 0.432
name: Map
- type: mrr@10
value: 0.4205
name: Mrr@10
- type: ndcg@10
value: 0.5022
name: Ndcg@10
- task:
type: cross-encoder-reranking
name: Cross Encoder Reranking
dataset:
name: NanoNFCorpus R100
type: NanoNFCorpus_R100
metrics:
- type: map
value: 0.3503
name: Map
- type: mrr@10
value: 0.5706
name: Mrr@10
- type: ndcg@10
value: 0.3846
name: Ndcg@10
- task:
type: cross-encoder-reranking
name: Cross Encoder Reranking
dataset:
name: NanoNQ R100
type: NanoNQ_R100
metrics:
- type: map
value: 0.5234
name: Map
- type: mrr@10
value: 0.5284
name: Mrr@10
- type: ndcg@10
value: 0.5854
name: Ndcg@10
- task:
type: cross-encoder-nano-beir
name: Cross Encoder Nano BEIR
dataset:
name: NanoBEIR R100 mean
type: NanoBEIR_R100_mean
metrics:
- type: map
value: 0.4353
name: Map
- type: mrr@10
value: 0.5065
name: Mrr@10
- type: ndcg@10
value: 0.4907
name: Ndcg@10
---
# MiniLM-L12-H384-uncased trained on GooAQ
This is a [Cross Encoder](https://www.sbert.net/docs/cross_encoder/usage/usage.html) model finetuned from [microsoft/MiniLM-L12-H384-uncased](https://huggingface.co/microsoft/MiniLM-L12-H384-uncased) using the [sentence-transformers](https://www.SBERT.net) library. It computes scores for pairs of texts, which can be used for text reranking and semantic search.
## Model Details
### Model Description
- **Model Type:** Cross Encoder
- **Base model:** [microsoft/MiniLM-L12-H384-uncased](https://huggingface.co/microsoft/MiniLM-L12-H384-uncased)
- **Maximum Sequence Length:** 512 tokens
- **Number of Output Labels:** 1 label
- **Language:** en
- **License:** apache-2.0
### Model Sources
- **Documentation:** [Sentence Transformers Documentation](https://sbert.net)
- **Documentation:** [Cross Encoder Documentation](https://www.sbert.net/docs/cross_encoder/usage/usage.html)
- **Repository:** [Sentence Transformers on GitHub](https://github.com/UKPLab/sentence-transformers)
- **Hugging Face:** [Cross Encoders on Hugging Face](https://huggingface.co/models?library=sentence-transformers&other=cross-encoder)
## Usage
### Direct Usage (Sentence Transformers)
First install the Sentence Transformers library:
```bash
pip install -U sentence-transformers
```
Then you can load this model and run inference.
```python
from sentence_transformers import CrossEncoder
# Download from the 🤗 Hub
model = CrossEncoder("tomaarsen/reranker-MiniLM-L12-gooaq-bce")
# Get scores for pairs of texts
pairs = [
['what is the remote desktop connection broker?', 'A remote desktop connection broker is software that allows clients to access various types of server-hosted desktops and applications. ... Load balancing the servers that host the desktops. Managing desktop images. Redirecting multimedia processing to the client.'],
['what is the remote desktop connection broker?', 'Remote Desktop Connection (RDC, also called Remote Desktop, formerly Microsoft Terminal Services Client, mstsc or tsclient) is the client application for RDS. It allows a user to remotely log into a networked computer running the terminal services server.'],
['what is the remote desktop connection broker?', "['Click the Start menu on your PC and search for Remote Desktop Connection.', 'Launch Remote Desktop Connection and click on Show Options.', 'Select the Local Resources tab and click More.', 'Under Drives, check the box for your C: drive or the drives that contain the files you will transfer and click OK.']"],
['what is the remote desktop connection broker?', "['Press the MENU button on your remote.', 'Select Parental Favs & Setup > System Setup > Remote or Remote Control > Program Remote.', 'Choose the device (TV, audio, DVD) you want to program. ... ', 'Follow the on-screen instructions to finish programming your remote.']"],
['what is the remote desktop connection broker?', "['Press MENU on your remote.', 'Select Parental Favs & Setup > System Setup > Remote or Remote Control > Program Remote.', 'Choose the device (TV, audio, DVD) you wish to program. ... ', 'Follow the on-screen prompts to complete the programming.']"],
]
scores = model.predict(pairs)
print(scores.shape)
# (5,)
# Or rank different texts based on similarity to a single text
ranks = model.rank(
'what is the remote desktop connection broker?',
[
'A remote desktop connection broker is software that allows clients to access various types of server-hosted desktops and applications. ... Load balancing the servers that host the desktops. Managing desktop images. Redirecting multimedia processing to the client.',
'Remote Desktop Connection (RDC, also called Remote Desktop, formerly Microsoft Terminal Services Client, mstsc or tsclient) is the client application for RDS. It allows a user to remotely log into a networked computer running the terminal services server.',
"['Click the Start menu on your PC and search for Remote Desktop Connection.', 'Launch Remote Desktop Connection and click on Show Options.', 'Select the Local Resources tab and click More.', 'Under Drives, check the box for your C: drive or the drives that contain the files you will transfer and click OK.']",
"['Press the MENU button on your remote.', 'Select Parental Favs & Setup > System Setup > Remote or Remote Control > Program Remote.', 'Choose the device (TV, audio, DVD) you want to program. ... ', 'Follow the on-screen instructions to finish programming your remote.']",
"['Press MENU on your remote.', 'Select Parental Favs & Setup > System Setup > Remote or Remote Control > Program Remote.', 'Choose the device (TV, audio, DVD) you wish to program. ... ', 'Follow the on-screen prompts to complete the programming.']",
]
)
# [{'corpus_id': ..., 'score': ...}, {'corpus_id': ..., 'score': ...}, ...]
```
## Evaluation
### Metrics
#### Cross Encoder Reranking
* Dataset: `gooaq-dev`
* Evaluated with [CrossEncoderRerankingEvaluator
](https://sbert.net/docs/package_reference/cross_encoder/evaluation.html#sentence_transformers.cross_encoder.evaluation.CrossEncoderRerankingEvaluator) with these parameters:
```json
{
"at_k": 10,
"always_rerank_positives": false
}
```
| Metric | Value |
|:------------|:---------------------|
| map | 0.6856 (+0.1545) |
| mrr@10 | 0.6830 (+0.1591) |
| **ndcg@10** | **0.7314 (+0.1402)** |
#### Cross Encoder Reranking
* Datasets: `NanoMSMARCO_R100`, `NanoNFCorpus_R100` and `NanoNQ_R100`
* Evaluated with [CrossEncoderRerankingEvaluator
](https://sbert.net/docs/package_reference/cross_encoder/evaluation.html#sentence_transformers.cross_encoder.evaluation.CrossEncoderRerankingEvaluator) with these parameters:
```json
{
"at_k": 10,
"always_rerank_positives": true
}
```
| Metric | NanoMSMARCO_R100 | NanoNFCorpus_R100 | NanoNQ_R100 |
|:------------|:---------------------|:---------------------|:---------------------|
| map | 0.4320 (-0.0576) | 0.3503 (+0.0894) | 0.5234 (+0.1038) |
| mrr@10 | 0.4205 (-0.0570) | 0.5706 (+0.0708) | 0.5284 (+0.1018) |
| **ndcg@10** | **0.5022 (-0.0382)** | **0.3846 (+0.0596)** | **0.5854 (+0.0847)** |
#### Cross Encoder Nano BEIR
* Dataset: `NanoBEIR_R100_mean`
* Evaluated with [CrossEncoderNanoBEIREvaluator
](https://sbert.net/docs/package_reference/cross_encoder/evaluation.html#sentence_transformers.cross_encoder.evaluation.CrossEncoderNanoBEIREvaluator) with these parameters:
```json
{
"dataset_names": [
"msmarco",
"nfcorpus",
"nq"
],
"rerank_k": 100,
"at_k": 10,
"always_rerank_positives": true
}
```
| Metric | Value |
|:------------|:---------------------|
| map | 0.4353 (+0.0452) |
| mrr@10 | 0.5065 (+0.0385) |
| **ndcg@10** | **0.4907 (+0.0354)** |
## Training Details
### Training Dataset
#### Unnamed Dataset
* Size: 578,402 training samples
* Columns: question
, answer
, and label
* Approximate statistics based on the first 1000 samples:
| | question | answer | label |
|:--------|:-----------------------------------------------------------------------------------------------|:-------------------------------------------------------------------------------------------------|:------------------------------------------------|
| type | string | string | int |
| details |
what is the remote desktop connection broker?
| A remote desktop connection broker is software that allows clients to access various types of server-hosted desktops and applications. ... Load balancing the servers that host the desktops. Managing desktop images. Redirecting multimedia processing to the client.
| 1
|
| what is the remote desktop connection broker?
| Remote Desktop Connection (RDC, also called Remote Desktop, formerly Microsoft Terminal Services Client, mstsc or tsclient) is the client application for RDS. It allows a user to remotely log into a networked computer running the terminal services server.
| 0
|
| what is the remote desktop connection broker?
| ['Click the Start menu on your PC and search for Remote Desktop Connection.', 'Launch Remote Desktop Connection and click on Show Options.', 'Select the Local Resources tab and click More.', 'Under Drives, check the box for your C: drive or the drives that contain the files you will transfer and click OK.']
| 0
|
* Loss: [BinaryCrossEntropyLoss
](https://sbert.net/docs/package_reference/cross_encoder/losses.html#binarycrossentropyloss) with these parameters:
```json
{
"activation_fn": "torch.nn.modules.linear.Identity",
"pos_weight": 5
}
```
### Training Hyperparameters
#### Non-Default Hyperparameters
- `eval_strategy`: steps
- `per_device_train_batch_size`: 64
- `per_device_eval_batch_size`: 64
- `learning_rate`: 2e-05
- `num_train_epochs`: 1
- `warmup_ratio`: 0.1
- `seed`: 12
- `bf16`: True
- `dataloader_num_workers`: 4
- `load_best_model_at_end`: True
#### All Hyperparameters