Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks
Paper
•
1908.10084
•
Published
•
9
This is a sentence-transformers model finetuned from google/embeddinggemma-300m. It maps sentences & paragraphs to a 768-dimensional dense vector space and can be used for semantic textual similarity, semantic search, paraphrase mining, text classification, clustering, and more.
SentenceTransformer(
(0): Transformer({'max_seq_length': 2048, 'do_lower_case': False, 'architecture': 'Gemma3TextModel'})
(1): Pooling({'word_embedding_dimension': 768, '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': 768, 'out_features': 3072, 'bias': False, 'activation_function': 'torch.nn.modules.linear.Identity'})
(3): Dense({'in_features': 3072, 'out_features': 768, 'bias': False, 'activation_function': 'torch.nn.modules.linear.Identity'})
(4): Normalize()
)
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("ayushexel/xynft-embeddinggemma-300m-8e")
# Run inference
queries = [
"What is the critical issue with the ICICI payment gateway, and what are the potential consequences and mitigation strategies being discussed?",
]
documents = [
'The critical issue is the sustained `BANK_TIMEOUT` errors occurring with the ICICI payment gateway, which are identified as the primary driver of a business loss. If the engineering team cannot provide an ETA for a fix, the proposed mitigation strategy is to temporarily deprioritize this payment method on the checkout page to protect the user experience and the overall payment success rate.',
"To mitigate the impact on merchants from the ongoing UPI ICICI gateway latency spike and high 'Transaction Not Permitted' errors, two immediate actions are proposed. First, Rahul Verma is asked to explore temporarily de-prioritizing the ICICI gateway in the routing logic for high-volume merchants until a confirmation on the issue is received from the bank. Second, the team needs to investigate the severity of the issue by checking Grafana to confirm if the p99 latency for the gateway has breached the Service Level Agreement (SLA).",
"The initial analysis indicates that the latency spike is not a failure at the SDK or app-level. The issue is believed to originate from a downstream system, pointing specifically to a problem either in Juspay's backend communication with ICICI's systems or within the ICICI gateway itself. The critical implication of this finding is that it allows the event to be classified as a 'specific partner gateway degradation' rather than a failure of Juspay's core payment system, which is a key distinction for any required regulatory reporting to the RBI.",
]
query_embeddings = model.encode_query(queries)
document_embeddings = model.encode_document(documents)
print(query_embeddings.shape, document_embeddings.shape)
# [1, 768] [3, 768]
# Get the similarity scores for the embeddings
similarities = model.similarity(query_embeddings, document_embeddings)
print(similarities)
# tensor([[0.7479, 0.3172, 0.2254]])
baseline_pre_training and ft-devTripletEvaluator| Metric | baseline_pre_training | ft-dev |
|---|---|---|
| cosine_accuracy | 0.508 | 0.668 |
query, answer, and negative| query | answer | negative | |
|---|---|---|---|
| type | string | string | string |
| details |
|
|
|
| query | answer | negative |
|---|---|---|
What is the root cause of the data loss identified in JIRA-DATA-781, and what is the proposed plan to both fix the issue and recover the missing data? |
The root cause is a schema change in the |
Aishwarya is encountering an intermittent |
What are the specific documentation and compliance actions being taken in response to the UPI Juspay latency spike, and what is the potential consequence if the issue persists? |
The latency spike is being formally documented as a 'major service degradation event' for the quarterly RBI filing. An incident report has been created on Confluence (doc ID: COMP-2023-Q4-PSP-01), and all technical findings and communication logs must be attached to Jira ticket #PAY-4812 to maintain a critical audit trail. If the issue is not resolved, the company may need to trigger a penalty clause. |
The investigation into the UPI 'Payment Pending' latency spike is being formally tracked under JIRA ticket OPS-1724. The immediate plan involves Siddharth Nair pulling detailed transaction logs from BigQuery for the specific merchant_id affected between 10:00 and 11:00 AM today. This issue is considered a high priority as it is impacting a key merchant. The team, including Pooja Joshi and Riya Kapoor, will convene for a sync-up call after lunch to review the findings from the logs. |
What immediate actions are being taken to address the latency spike on the ICICI payment gateway, and how will the success of these actions be validated? |
To address the latency spike, a critical Jira ticket (BREEZE-4812) has been raised for the SRE team to immediately update the BGP routing configuration, effectively deprioritizing the problematic ISP for traffic from the 'payment-gateway' service. The effectiveness of this fix will be validated by a new, dedicated Grafana dashboard, which Riya Kapoor will create to specifically monitor the ICICI net banking success rate for the affected 103.22.x.x IP range once the network changes are deployed via the CI/CD pipeline. |
Meera Reddy has proposed a multi-step plan to address the ICICI API latency spike. The plan involves asking the engineering team to investigate if specific transaction types (like subscriptions vs. one-time payments) are disproportionately affected. Concurrently, a consolidated report with failed transaction IDs and latency graphs will be prepared. Finally, Meera will escalate the issue by raising a high-priority ticket with the ICICI support team by the end of the day. |
MultipleNegativesRankingLoss with these parameters:{
"scale": 20.0,
"similarity_fct": "cos_sim",
"gather_across_devices": false
}
eval_strategy: stepsper_device_train_batch_size: 128per_device_eval_batch_size: 128learning_rate: 3e-05weight_decay: 0.01num_train_epochs: 8warmup_ratio: 0.1bf16: Truebatch_sampler: no_duplicatesoverwrite_output_dir: Falsedo_predict: Falseeval_strategy: stepsprediction_loss_only: Trueper_device_train_batch_size: 128per_device_eval_batch_size: 128per_gpu_train_batch_size: Noneper_gpu_eval_batch_size: Nonegradient_accumulation_steps: 1eval_accumulation_steps: Nonetorch_empty_cache_steps: Nonelearning_rate: 3e-05weight_decay: 0.01adam_beta1: 0.9adam_beta2: 0.999adam_epsilon: 1e-08max_grad_norm: 1.0num_train_epochs: 8max_steps: -1lr_scheduler_type: linearlr_scheduler_kwargs: {}warmup_ratio: 0.1warmup_steps: 0log_level: passivelog_level_replica: warninglog_on_each_node: Truelogging_nan_inf_filter: Truesave_safetensors: Truesave_on_each_node: Falsesave_only_model: Falserestore_callback_states_from_checkpoint: Falseno_cuda: Falseuse_cpu: Falseuse_mps_device: Falseseed: 42data_seed: Nonejit_mode_eval: Falseuse_ipex: Falsebf16: Truefp16: Falsefp16_opt_level: O1half_precision_backend: autobf16_full_eval: Falsefp16_full_eval: Falsetf32: Nonelocal_rank: 0ddp_backend: Nonetpu_num_cores: Nonetpu_metrics_debug: Falsedebug: []dataloader_drop_last: Falsedataloader_num_workers: 0dataloader_prefetch_factor: Nonepast_index: -1disable_tqdm: Falseremove_unused_columns: Truelabel_names: Noneload_best_model_at_end: Falseignore_data_skip: Falsefsdp: []fsdp_min_num_params: 0fsdp_config: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}fsdp_transformer_layer_cls_to_wrap: Noneaccelerator_config: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}parallelism_config: Nonedeepspeed: Nonelabel_smoothing_factor: 0.0optim: adamw_torch_fusedoptim_args: Noneadafactor: Falsegroup_by_length: Falselength_column_name: lengthddp_find_unused_parameters: Noneddp_bucket_cap_mb: Noneddp_broadcast_buffers: Falsedataloader_pin_memory: Truedataloader_persistent_workers: Falseskip_memory_metrics: Trueuse_legacy_prediction_loop: Falsepush_to_hub: Falseresume_from_checkpoint: Nonehub_model_id: Nonehub_strategy: every_savehub_private_repo: Nonehub_always_push: Falsehub_revision: Nonegradient_checkpointing: Falsegradient_checkpointing_kwargs: Noneinclude_inputs_for_metrics: Falseinclude_for_metrics: []eval_do_concat_batches: Truefp16_backend: autopush_to_hub_model_id: Nonepush_to_hub_organization: Nonemp_parameters: auto_find_batch_size: Falsefull_determinism: Falsetorchdynamo: Noneray_scope: lastddp_timeout: 1800torch_compile: Falsetorch_compile_backend: Nonetorch_compile_mode: Noneinclude_tokens_per_second: Falseinclude_num_input_tokens_seen: Falseneftune_noise_alpha: Noneoptim_target_modules: Nonebatch_eval_metrics: Falseeval_on_start: Falseuse_liger_kernel: Falseliger_kernel_config: Noneeval_use_gather_object: Falseaverage_tokens_across_devices: Falseprompts: Nonebatch_sampler: no_duplicatesmulti_dataset_batch_sampler: proportionalrouter_mapping: {}learning_rate_mapping: {}| Epoch | Step | Training Loss | baseline_pre_training_cosine_accuracy | ft-dev_cosine_accuracy |
|---|---|---|---|---|
| -1 | -1 | - | 0.5080 | - |
| 1.6667 | 10 | 1.76 | - | 0.6560 |
| 3.3333 | 20 | 0.1574 | - | 0.6760 |
| 5.0 | 30 | 0.0299 | - | 0.6720 |
| 6.6667 | 40 | 0.016 | - | 0.6840 |
| -1 | -1 | - | - | 0.6680 |
@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",
}
@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}
}
Base model
google/embeddinggemma-300m