SentenceTransformer based on dunzhang/stella_en_1.5B_v5

This is a sentence-transformers model finetuned from dunzhang/stella_en_1.5B_v5. 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: dunzhang/stella_en_1.5B_v5
  • Maximum Sequence Length: 512 tokens
  • Output Dimensionality: 1024 tokens
  • Similarity Function: Cosine Similarity

Model Sources

Full Model Architecture

SentenceTransformer(
  (0): Transformer({'max_seq_length': 512, 'do_lower_case': False}) with Transformer model: Qwen2Model 
  (1): Pooling({'word_embedding_dimension': 1536, 'pooling_mode_cls_token': False, 'pooling_mode_mean_tokens': True, '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): Dense({'in_features': 1536, 'out_features': 1024, 'bias': True, 'activation_function': 'torch.nn.modules.linear.Identity'})
)

Usage

Direct Usage (Sentence Transformers)

First install the Sentence Transformers library:

pip install -U sentence-transformers

Then you can load this model and run inference.

from sentence_transformers import SentenceTransformer

# Download from the 🤗 Hub
model = SentenceTransformer("DrishtiSharma/stella_en_1.5B_v5-obliqa-5-epochs")
# Run inference
sentences = [
    'Are there any anticipated changes to the COBS Rule 17.3 / MIR Rule 3.2.1 that Authorised Persons should be preparing for in the near future? If so, what is the expected timeline for these changes to take effect?',
    'REGULATORY REQUIREMENTS FOR AUTHORISED PERSONS ENGAGED IN REGULATED ACTIVITIES IN RELATION TO VIRTUAL ASSETS\nCapital Requirements\nWhen applying COBS Rule 17.3 / MIR Rule 3.2.1 to an Authorised Person, the FSRA will apply proportionality in considering whether any additional capital buffer must be held, based on the size, scope, complexity and nature of the activities and operations of the Authorised Person and, if so, the appropriate amount of regulatory capital required as an additional buffer. An Authorised Person that the FSRA considers to be high risk may attract higher regulatory capital requirements.\n',
    'In exceptional circumstances, where the Bail-in Tool is applied, the Regulator may exclude or partially exclude certain liabilities from the application of the Write Down or Conversion Power where—\n(a)\tit is not possible to bail-in that liability within a reasonable time despite the reasonable efforts of the Regulator;\n(b)\tthe exclusion is strictly necessary and is proportionate to achieve the continuity of Critical Functions and Core Business Lines in a manner that maintains the ability of the Institution in Resolution to continue key operations, services and transactions;\n(c)\tthe exclusion is strictly necessary and proportionate to avoid giving rise to widespread contagion, in particular as regards Deposits and Eligible Deposits which would severely disrupt the functioning of financial markets, including financial market infrastructures, in a manner that could cause broader financial instability; or\n(d)\tthe application of the Bail-in Tool to those liabilities would cause a destruction of value such that the losses borne by other creditors would be higher than if those liabilities were excluded from bail-in.',
]
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

Metric Value
cosine_accuracy@1 0.6234
cosine_accuracy@3 0.7636
cosine_accuracy@5 0.8113
cosine_accuracy@10 0.8558
cosine_precision@1 0.6234
cosine_precision@3 0.2688
cosine_precision@5 0.1757
cosine_precision@10 0.0953
cosine_recall@1 0.5458
cosine_recall@3 0.6823
cosine_recall@5 0.7314
cosine_recall@10 0.7835
cosine_ndcg@10 0.6893
cosine_mrr@10 0.7027
cosine_map@100 0.6455
dot_accuracy@1 0.3447
dot_accuracy@3 0.5656
dot_accuracy@5 0.6639
dot_accuracy@10 0.7787
dot_precision@1 0.3447
dot_precision@3 0.1955
dot_precision@5 0.1403
dot_precision@10 0.0855
dot_recall@1 0.3029
dot_recall@3 0.5
dot_recall@5 0.5915
dot_recall@10 0.7071
dot_ndcg@10 0.5127
dot_mrr@10 0.4802
dot_map@100 0.4464

Training Details

Training Dataset

Unnamed Dataset

  • Size: 22,291 training samples
  • Columns: sentence_0 and sentence_1
  • Approximate statistics based on the first 1000 samples:
    sentence_0 sentence_1
    type string string
    details
    • min: 16 tokens
    • mean: 33.53 tokens
    • max: 71 tokens
    • min: 15 tokens
    • mean: 118.07 tokens
    • max: 512 tokens
  • Samples:
    sentence_0 sentence_1
    What constitutes a "sufficiently advanced stage of development" for a FinTech Proposal to qualify for a live test under the RegLab framework, as mentioned in criterion (c)? Evaluation Criteria. To qualify for authorisation under the RegLab framework, the applicant must demonstrate how it satisfies the following evaluation criteria:
    (a) the FinTech Proposal promotes FinTech innovation, in terms of the business application and deployment model of the technology.
    (b) the FinTech Proposal has the potential to:
    i. promote significant growth, efficiency or competition in the financial sector;
    ii. promote better risk management solutions and regulatory outcomes for the financial industry; or
    iii. improve the choices and welfare of clients.
    (c) the FinTech Proposal is at a sufficiently advanced stage of development to mount a live test.
    (d) the FinTech Proposal can be deployed in the ADGM and the UAE on a broader scale or contribute to the development of ADGM as a financial centre, and, if so, how the applicant intends to do so on completion of the validity period.

    Are there any upcoming regulatory changes that Authorised Persons should be aware of regarding the handling or classification of Virtual Assets within the ADGM? CONCEPTS RELATING TO THE DISCLOSURE OF PETROLEUM ACTIVITIES
    Petroleum Projects and materiality
    If a Petroleum Reporting Entity discloses estimates that it viewed as material at the time of disclosure, but subsequently forms a view that they are no longer material, the FSRA expects the Petroleum Reporting Entity to make a further disclosure providing the clear rationale for the change view on materiality. Such reasoning would generally follow the considerations outlined in paragraph 24 above.

    What are the ADGM's requirements for VC Managers regarding the periodic assessment and audit of their compliance frameworks, and who is qualified to conduct such assessments? Principle 1 – A Robust and Transparent Risk-Based Regulatory Framework. The framework encompasses a suite of regulations, activity-specific rules and supporting guidance that delivers protection to investors, maintains market integrity and future-proofs against financial stability risks. In particular, it introduces a clear taxonomy defining VAs as commodities within the wider Digital Asset universe and requires the licensing of entities engaged in regulated activities that use VAs within ADGM.
  • Loss: MultipleNegativesRankingLoss with these parameters:
    {
        "scale": 20.0,
        "similarity_fct": "cos_sim"
    }
    

Training Hyperparameters

Non-Default Hyperparameters

  • eval_strategy: steps
  • per_device_train_batch_size: 10
  • per_device_eval_batch_size: 10
  • multi_dataset_batch_sampler: round_robin

All Hyperparameters

Click to expand
  • overwrite_output_dir: False
  • do_predict: False
  • eval_strategy: steps
  • prediction_loss_only: True
  • per_device_train_batch_size: 10
  • per_device_eval_batch_size: 10
  • per_gpu_train_batch_size: None
  • per_gpu_eval_batch_size: None
  • gradient_accumulation_steps: 1
  • eval_accumulation_steps: None
  • torch_empty_cache_steps: None
  • learning_rate: 5e-05
  • weight_decay: 0.0
  • adam_beta1: 0.9
  • adam_beta2: 0.999
  • adam_epsilon: 1e-08
  • max_grad_norm: 1
  • num_train_epochs: 3
  • max_steps: -1
  • lr_scheduler_type: linear
  • lr_scheduler_kwargs: {}
  • warmup_ratio: 0.0
  • warmup_steps: 0
  • log_level: passive
  • log_level_replica: warning
  • log_on_each_node: True
  • logging_nan_inf_filter: True
  • save_safetensors: True
  • save_on_each_node: False
  • save_only_model: False
  • restore_callback_states_from_checkpoint: False
  • no_cuda: False
  • use_cpu: False
  • use_mps_device: False
  • seed: 42
  • data_seed: None
  • jit_mode_eval: False
  • use_ipex: False
  • bf16: False
  • fp16: False
  • fp16_opt_level: O1
  • half_precision_backend: auto
  • bf16_full_eval: False
  • fp16_full_eval: False
  • tf32: None
  • local_rank: 0
  • ddp_backend: None
  • tpu_num_cores: None
  • tpu_metrics_debug: False
  • debug: []
  • dataloader_drop_last: False
  • dataloader_num_workers: 0
  • dataloader_prefetch_factor: None
  • past_index: -1
  • disable_tqdm: False
  • remove_unused_columns: True
  • label_names: None
  • load_best_model_at_end: False
  • ignore_data_skip: False
  • fsdp: []
  • fsdp_min_num_params: 0
  • fsdp_config: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}
  • fsdp_transformer_layer_cls_to_wrap: None
  • accelerator_config: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}
  • deepspeed: None
  • label_smoothing_factor: 0.0
  • optim: adamw_torch
  • optim_args: None
  • adafactor: False
  • group_by_length: False
  • length_column_name: length
  • ddp_find_unused_parameters: None
  • ddp_bucket_cap_mb: None
  • ddp_broadcast_buffers: False
  • dataloader_pin_memory: True
  • dataloader_persistent_workers: False
  • skip_memory_metrics: True
  • use_legacy_prediction_loop: False
  • push_to_hub: False
  • resume_from_checkpoint: None
  • hub_model_id: None
  • hub_strategy: every_save
  • hub_private_repo: False
  • hub_always_push: False
  • gradient_checkpointing: False
  • gradient_checkpointing_kwargs: None
  • include_inputs_for_metrics: False
  • eval_do_concat_batches: True
  • fp16_backend: auto
  • push_to_hub_model_id: None
  • push_to_hub_organization: None
  • mp_parameters:
  • auto_find_batch_size: False
  • full_determinism: False
  • torchdynamo: None
  • ray_scope: last
  • ddp_timeout: 1800
  • torch_compile: False
  • torch_compile_backend: None
  • torch_compile_mode: None
  • dispatch_batches: None
  • split_batches: None
  • include_tokens_per_second: False
  • include_num_input_tokens_seen: False
  • neftune_noise_alpha: None
  • optim_target_modules: None
  • batch_eval_metrics: False
  • eval_on_start: False
  • use_liger_kernel: False
  • eval_use_gather_object: False
  • batch_sampler: batch_sampler
  • multi_dataset_batch_sampler: round_robin

Training Logs

Epoch Step Training Loss cosine_map@100
0.0897 200 - 0.5597
0.1794 400 - 0.5674
0.2242 500 0.7416 -
0.2691 600 - 0.4684
0.3587 800 - 0.5593
0.4484 1000 0.6613 0.5502
0.5381 1200 - 0.5740
0.6278 1400 - 0.5398
0.6726 1500 0.5382 -
0.7175 1600 - 0.5820
0.8072 1800 - 0.5770
0.8969 2000 0.4959 0.5834
0.9865 2200 - 0.5382
1.0 2230 - 0.3223
1.0762 2400 - 0.5532
1.1211 2500 0.3796 -
1.1659 2600 - 0.5817
1.2556 2800 - 0.5929
1.3453 3000 0.367 0.5937
1.4350 3200 - 0.5907
1.5247 3400 - 0.6024
1.5695 3500 0.2877 -
1.6143 3600 - 0.6006
1.7040 3800 - 0.6131
1.7937 4000 0.2818 0.6167
1.8834 4200 - 0.6040
1.9731 4400 - 0.6144
2.0 4460 - 0.6225
2.0179 4500 0.2529 -
2.0628 4600 - 0.6196
2.1525 4800 - 0.6222
2.2422 5000 0.1409 0.6278
2.3318 5200 - 0.6337
2.4215 5400 - 0.6409
2.4664 5500 0.1213 -
2.5112 5600 - 0.6424
2.6009 5800 - 0.6412
2.6906 6000 0.1218 0.6432
2.7803 6200 - 0.6456
2.8700 6400 - 0.6446
2.9148 6500 0.1247 -
2.9596 6600 - 0.6458
3.0 6690 - 0.6455

Framework Versions

  • Python: 3.10.12
  • Sentence Transformers: 3.1.1
  • Transformers: 4.45.2
  • PyTorch: 2.1.0+cu118
  • Accelerate: 1.2.0.dev0
  • Datasets: 3.1.0
  • Tokenizers: 0.20.3

Citation

BibTeX

Sentence Transformers

@inproceedings{reimers-2019-sentence-bert,
    title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
    author = "Reimers, Nils and Gurevych, Iryna",
    booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
    month = "11",
    year = "2019",
    publisher = "Association for Computational Linguistics",
    url = "https://arxiv.org/abs/1908.10084",
}

MultipleNegativesRankingLoss

@misc{henderson2017efficient,
    title={Efficient Natural Language Response Suggestion for Smart Reply},
    author={Matthew Henderson and Rami Al-Rfou and Brian Strope and Yun-hsuan Sung and Laszlo Lukacs and Ruiqi Guo and Sanjiv Kumar and Balint Miklos and Ray Kurzweil},
    year={2017},
    eprint={1705.00652},
    archivePrefix={arXiv},
    primaryClass={cs.CL}
}
Downloads last month
30
Safetensors
Model size
1.54B params
Tensor type
F32
·
Inference Examples
This model does not have enough activity to be deployed to Inference API (serverless) yet. Increase its social visibility and check back later, or deploy to Inference Endpoints (dedicated) instead.

Model tree for DrishtiSharma/stella-en-1.5B-v5-obliqa-5-epochs

Finetuned
(12)
this model

Evaluation results