---
language:
- en
license: apache-2.0
library_name: sentence-transformers
tags:
- sentence-transformers
- sentence-similarity
- feature-extraction
- generated_from_trainer
- dataset_size:6300
- loss:MatryoshkaLoss
- loss:MultipleNegativesRankingLoss
base_model: BAAI/bge-m3
datasets: []
metrics:
- cosine_accuracy@1
- cosine_accuracy@3
- cosine_accuracy@5
- cosine_accuracy@10
- cosine_precision@1
- cosine_precision@3
- cosine_precision@5
- cosine_precision@10
- cosine_recall@1
- cosine_recall@3
- cosine_recall@5
- cosine_recall@10
- cosine_ndcg@10
- cosine_mrr@10
- cosine_map@100
widget:
- source_sentence: The consolidated financial statements and accompanying notes listed
in Part IV, Item 15(a)(1) of this Annual Report on Form 10-K.
sentences:
- How much total space does an average The Home Depot store encompass including
its garden area?
- What section of the Annual Report on Form 10-K contains the consolidated financial
statements and accompanying notes?
- What types of competitive factors does Garmin believe are important in its markets?
- source_sentence: Item 3. Legal Proceedings, which covers litigation and regulatory
matters, refers to Note 12 – Commitments and Contingencies for more detailed information
within the Consolidated Financial Statements.
sentences:
- What pages contain the Financial Statements and Supplementary Data in IBM’s 2023
Annual Report to Stockholders?
- In which note can further details on Legal Proceedings be found within the Consolidated
Financial Statements?
- What is the title of Item 8 in the document?
- source_sentence: Net Revenues for the Entertainment segment were $659.3 million
in 2023.
sentences:
- What were the net revenues for the Entertainment segment in 2023?
- How much net cash was provided by operating activities in 2023?
- What was the net income reported for the fiscal year ending in August 2023?
- source_sentence: 'The capital allocation program focuses on three objectives: (1)
grow our business at an average target ROIC-adjusted rate of 20% or greater; (2)
maintain a strong investment-grade balance sheet, including a target average automotive
cash balance of $18.0 billion; and (3) after the first two objectives are met,
return available cash to shareholders.'
sentences:
- Why is ICE Mortgage Technology subject to the examination by the Federal Financial
Institutions Examination Council (FFIEC) and its member agencies?
- What type of regulations do U.S. automobiles need to comply with under the National
Highway Traffic Safety Administration?
- What are the three objectives of the capital allocation program referenced?
- source_sentence: As of January 28, 2024 the net carrying value of our inventories
was $1.3 billion, which included provisions for obsolete and damaged inventory
of $139.7 million.
sentences:
- What is the status of the company's inventory as of January 28, 2024, in terms
of its valuation and provisions for obsolescence?
- What is the relationship between the ESG goals and the long-term growth strategy?
- What were the financial impacts of Ford's investments in Rivian and Argo in the
year 2022?
pipeline_tag: sentence-similarity
model-index:
- name: BGE-M3 Financial Matryoshka
results:
- task:
type: information-retrieval
name: Information Retrieval
dataset:
name: dim 1024
type: dim_1024
metrics:
- type: cosine_accuracy@1
value: 0.7171428571428572
name: Cosine Accuracy@1
- type: cosine_accuracy@3
value: 0.8314285714285714
name: Cosine Accuracy@3
- type: cosine_accuracy@5
value: 0.87
name: Cosine Accuracy@5
- type: cosine_accuracy@10
value: 0.9142857142857143
name: Cosine Accuracy@10
- type: cosine_precision@1
value: 0.7171428571428572
name: Cosine Precision@1
- type: cosine_precision@3
value: 0.27714285714285714
name: Cosine Precision@3
- type: cosine_precision@5
value: 0.174
name: Cosine Precision@5
- type: cosine_precision@10
value: 0.09142857142857141
name: Cosine Precision@10
- type: cosine_recall@1
value: 0.7171428571428572
name: Cosine Recall@1
- type: cosine_recall@3
value: 0.8314285714285714
name: Cosine Recall@3
- type: cosine_recall@5
value: 0.87
name: Cosine Recall@5
- type: cosine_recall@10
value: 0.9142857142857143
name: Cosine Recall@10
- type: cosine_ndcg@10
value: 0.8152097277196483
name: Cosine Ndcg@10
- type: cosine_mrr@10
value: 0.7835873015873015
name: Cosine Mrr@10
- type: cosine_map@100
value: 0.7867088346410263
name: Cosine Map@100
- task:
type: information-retrieval
name: Information Retrieval
dataset:
name: dim 768
type: dim_768
metrics:
- type: cosine_accuracy@1
value: 0.7128571428571429
name: Cosine Accuracy@1
- type: cosine_accuracy@3
value: 0.8342857142857143
name: Cosine Accuracy@3
- type: cosine_accuracy@5
value: 0.8657142857142858
name: Cosine Accuracy@5
- type: cosine_accuracy@10
value: 0.91
name: Cosine Accuracy@10
- type: cosine_precision@1
value: 0.7128571428571429
name: Cosine Precision@1
- type: cosine_precision@3
value: 0.2780952380952381
name: Cosine Precision@3
- type: cosine_precision@5
value: 0.17314285714285713
name: Cosine Precision@5
- type: cosine_precision@10
value: 0.09099999999999998
name: Cosine Precision@10
- type: cosine_recall@1
value: 0.7128571428571429
name: Cosine Recall@1
- type: cosine_recall@3
value: 0.8342857142857143
name: Cosine Recall@3
- type: cosine_recall@5
value: 0.8657142857142858
name: Cosine Recall@5
- type: cosine_recall@10
value: 0.91
name: Cosine Recall@10
- type: cosine_ndcg@10
value: 0.8122143155463835
name: Cosine Ndcg@10
- type: cosine_mrr@10
value: 0.7808730158730155
name: Cosine Mrr@10
- type: cosine_map@100
value: 0.7843065190190194
name: Cosine Map@100
- task:
type: information-retrieval
name: Information Retrieval
dataset:
name: dim 512
type: dim_512
metrics:
- type: cosine_accuracy@1
value: 0.7114285714285714
name: Cosine Accuracy@1
- type: cosine_accuracy@3
value: 0.8357142857142857
name: Cosine Accuracy@3
- type: cosine_accuracy@5
value: 0.8642857142857143
name: Cosine Accuracy@5
- type: cosine_accuracy@10
value: 0.91
name: Cosine Accuracy@10
- type: cosine_precision@1
value: 0.7114285714285714
name: Cosine Precision@1
- type: cosine_precision@3
value: 0.2785714285714286
name: Cosine Precision@3
- type: cosine_precision@5
value: 0.17285714285714285
name: Cosine Precision@5
- type: cosine_precision@10
value: 0.09099999999999998
name: Cosine Precision@10
- type: cosine_recall@1
value: 0.7114285714285714
name: Cosine Recall@1
- type: cosine_recall@3
value: 0.8357142857142857
name: Cosine Recall@3
- type: cosine_recall@5
value: 0.8642857142857143
name: Cosine Recall@5
- type: cosine_recall@10
value: 0.91
name: Cosine Recall@10
- type: cosine_ndcg@10
value: 0.8109635546819154
name: Cosine Ndcg@10
- type: cosine_mrr@10
value: 0.7792959183673466
name: Cosine Mrr@10
- type: cosine_map@100
value: 0.782703758965192
name: Cosine Map@100
- task:
type: information-retrieval
name: Information Retrieval
dataset:
name: dim 384
type: dim_384
metrics:
- type: cosine_accuracy@1
value: 0.7142857142857143
name: Cosine Accuracy@1
- type: cosine_accuracy@3
value: 0.8328571428571429
name: Cosine Accuracy@3
- type: cosine_accuracy@5
value: 0.8628571428571429
name: Cosine Accuracy@5
- type: cosine_accuracy@10
value: 0.9128571428571428
name: Cosine Accuracy@10
- type: cosine_precision@1
value: 0.7142857142857143
name: Cosine Precision@1
- type: cosine_precision@3
value: 0.2776190476190476
name: Cosine Precision@3
- type: cosine_precision@5
value: 0.17257142857142854
name: Cosine Precision@5
- type: cosine_precision@10
value: 0.09128571428571428
name: Cosine Precision@10
- type: cosine_recall@1
value: 0.7142857142857143
name: Cosine Recall@1
- type: cosine_recall@3
value: 0.8328571428571429
name: Cosine Recall@3
- type: cosine_recall@5
value: 0.8628571428571429
name: Cosine Recall@5
- type: cosine_recall@10
value: 0.9128571428571428
name: Cosine Recall@10
- type: cosine_ndcg@10
value: 0.8125530857386527
name: Cosine Ndcg@10
- type: cosine_mrr@10
value: 0.7806292517006799
name: Cosine Mrr@10
- type: cosine_map@100
value: 0.7837508100457361
name: Cosine Map@100
---
# BGE-M3 Financial Matryoshka
This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [BAAI/bge-m3](https://huggingface.co/BAAI/bge-m3). It maps sentences & paragraphs to a 1024-dimensional dense vector space and can be used for semantic textual similarity, semantic search, paraphrase mining, text classification, clustering, and more.
## Model Details
### Model Description
- **Model Type:** Sentence Transformer
- **Base model:** [BAAI/bge-m3](https://huggingface.co/BAAI/bge-m3)
- **Maximum Sequence Length:** 8192 tokens
- **Output Dimensionality:** 1024 tokens
- **Similarity Function:** Cosine Similarity
- **Language:** en
- **License:** apache-2.0
### Model Sources
- **Documentation:** [Sentence Transformers Documentation](https://sbert.net)
- **Repository:** [Sentence Transformers on GitHub](https://github.com/UKPLab/sentence-transformers)
- **Hugging Face:** [Sentence Transformers on Hugging Face](https://huggingface.co/models?library=sentence-transformers)
### Full Model Architecture
```
SentenceTransformer(
(0): Transformer({'max_seq_length': 8192, 'do_lower_case': False}) with Transformer model: XLMRobertaModel
(1): Pooling({'word_embedding_dimension': 1024, 'pooling_mode_cls_token': True, 'pooling_mode_mean_tokens': False, 'pooling_mode_max_tokens': False, 'pooling_mode_mean_sqrt_len_tokens': False, 'pooling_mode_weightedmean_tokens': False, 'pooling_mode_lasttoken': False, 'include_prompt': True})
(2): Normalize()
)
```
## 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 SentenceTransformer
# Download from the 🤗 Hub
model = SentenceTransformer("haophancs/bge-m3-financial-matryoshka")
# Run inference
sentences = [
'As of January 28, 2024 the net carrying value of our inventories was $1.3 billion, which included provisions for obsolete and damaged inventory of $139.7 million.',
"What is the status of the company's inventory as of January 28, 2024, in terms of its valuation and provisions for obsolescence?",
'What is the relationship between the ESG goals and the long-term growth strategy?',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 1024]
# Get the similarity scores for the embeddings
similarities = model.similarity(embeddings, embeddings)
print(similarities.shape)
# [3, 3]
```
## Evaluation
### Metrics
#### Information Retrieval
* Dataset: `dim_1024`
* Evaluated with [InformationRetrievalEvaluator
](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.InformationRetrievalEvaluator)
| Metric | Value |
|:--------------------|:-----------|
| cosine_accuracy@1 | 0.7171 |
| cosine_accuracy@3 | 0.8314 |
| cosine_accuracy@5 | 0.87 |
| cosine_accuracy@10 | 0.9143 |
| cosine_precision@1 | 0.7171 |
| cosine_precision@3 | 0.2771 |
| cosine_precision@5 | 0.174 |
| cosine_precision@10 | 0.0914 |
| cosine_recall@1 | 0.7171 |
| cosine_recall@3 | 0.8314 |
| cosine_recall@5 | 0.87 |
| cosine_recall@10 | 0.9143 |
| cosine_ndcg@10 | 0.8152 |
| cosine_mrr@10 | 0.7836 |
| **cosine_map@100** | **0.7867** |
#### Information Retrieval
* Dataset: `dim_768`
* Evaluated with [InformationRetrievalEvaluator
](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.InformationRetrievalEvaluator)
| Metric | Value |
|:--------------------|:-----------|
| cosine_accuracy@1 | 0.7129 |
| cosine_accuracy@3 | 0.8343 |
| cosine_accuracy@5 | 0.8657 |
| cosine_accuracy@10 | 0.91 |
| cosine_precision@1 | 0.7129 |
| cosine_precision@3 | 0.2781 |
| cosine_precision@5 | 0.1731 |
| cosine_precision@10 | 0.091 |
| cosine_recall@1 | 0.7129 |
| cosine_recall@3 | 0.8343 |
| cosine_recall@5 | 0.8657 |
| cosine_recall@10 | 0.91 |
| cosine_ndcg@10 | 0.8122 |
| cosine_mrr@10 | 0.7809 |
| **cosine_map@100** | **0.7843** |
#### Information Retrieval
* Dataset: `dim_512`
* Evaluated with [InformationRetrievalEvaluator
](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.InformationRetrievalEvaluator)
| Metric | Value |
|:--------------------|:-----------|
| cosine_accuracy@1 | 0.7114 |
| cosine_accuracy@3 | 0.8357 |
| cosine_accuracy@5 | 0.8643 |
| cosine_accuracy@10 | 0.91 |
| cosine_precision@1 | 0.7114 |
| cosine_precision@3 | 0.2786 |
| cosine_precision@5 | 0.1729 |
| cosine_precision@10 | 0.091 |
| cosine_recall@1 | 0.7114 |
| cosine_recall@3 | 0.8357 |
| cosine_recall@5 | 0.8643 |
| cosine_recall@10 | 0.91 |
| cosine_ndcg@10 | 0.811 |
| cosine_mrr@10 | 0.7793 |
| **cosine_map@100** | **0.7827** |
#### Information Retrieval
* Dataset: `dim_384`
* Evaluated with [InformationRetrievalEvaluator
](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.InformationRetrievalEvaluator)
| Metric | Value |
|:--------------------|:-----------|
| cosine_accuracy@1 | 0.7143 |
| cosine_accuracy@3 | 0.8329 |
| cosine_accuracy@5 | 0.8629 |
| cosine_accuracy@10 | 0.9129 |
| cosine_precision@1 | 0.7143 |
| cosine_precision@3 | 0.2776 |
| cosine_precision@5 | 0.1726 |
| cosine_precision@10 | 0.0913 |
| cosine_recall@1 | 0.7143 |
| cosine_recall@3 | 0.8329 |
| cosine_recall@5 | 0.8629 |
| cosine_recall@10 | 0.9129 |
| cosine_ndcg@10 | 0.8126 |
| cosine_mrr@10 | 0.7806 |
| **cosine_map@100** | **0.7838** |
## Training Details
### Training Dataset
#### Unnamed Dataset
* Size: 6,300 training samples
* Columns: positive
and anchor
* Approximate statistics based on the first 1000 samples:
| | positive | anchor |
|:--------|:-------------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|
| type | string | string |
| details |
From fiscal year 2022 to 2023, the cost of revenue as a percentage of total net revenue decreased by 3 percent.
| What was the percentage change in cost of revenue as a percentage of total net revenue from fiscal year 2022 to 2023?
|
| •Operating income increased $321 million, or 2%, to $18.1 billion versus year ago due to the increase in net sales, partially offset by a modest decrease in operating margin.
| What factors contributed to the increase in operating income for Procter & Gamble in 2023?
|
| market specific brands including 'Aurrera,' 'Lider,' and 'PhonePe.'
| What specific brands does Walmart International market?
|
* Loss: [MatryoshkaLoss
](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#matryoshkaloss) with these parameters:
```json
{
"loss": "MultipleNegativesRankingLoss",
"matryoshka_dims": [
1024,
768,
512,
384
],
"matryoshka_weights": [
1,
1,
1,
1
],
"n_dims_per_step": -1
}
```
### Training Hyperparameters
#### Non-Default Hyperparameters
- `eval_strategy`: epoch
- `per_device_train_batch_size`: 4
- `per_device_eval_batch_size`: 2
- `gradient_accumulation_steps`: 2
- `learning_rate`: 2e-05
- `num_train_epochs`: 4
- `lr_scheduler_type`: cosine
- `warmup_ratio`: 0.1
- `bf16`: True
- `tf32`: True
- `load_best_model_at_end`: True
- `optim`: adamw_torch_fused
- `batch_sampler`: no_duplicates
#### All Hyperparameters