Scaling Deep Contrastive Learning Batch Size under Memory Limited Setup
Paper • 2101.06983 • Published • 3
How to use finvector/nomic_raw_ccdb_tri_merged with sentence-transformers:
from sentence_transformers import SentenceTransformer
model = SentenceTransformer("finvector/nomic_raw_ccdb_tri_merged", trust_remote_code=True)
sentences = [
"I am filing this complaint to resolve unauthorized, unverified, and inaccurate items reported on my TransUnion credit report. \n\nXXXX. Charged Off Disputed The following accounts are incorrectly reported and I request verification or removal : XXXX XXXX, Acct # : XXXX, Date Open : XX/XX/XXXX, Balance : {$570.00} XXXX XXXX, Acct # : XXXX, Date Open : XX/XX/XXXX, Balance : {$2500.00} XXXX, Acct # : XXXX, Date Open : XX/XX/XXXX, Balance : {$2600.00} XXXX XXXX XXXX, Acct # : XXXX, Date Open : XX/XX/XXXX, Balance : {$0.00} XXXX. Inquiries Disputed There are no disputed inquiries on my TransUnion report at this time. \n\nXXXX. Positive Accounts There are no issues with positive accounts at this time. \n\nXXXX. Late Payment Disputed The following late payments need to be verified or removed : XXXX XXXX, Acct # : XXXX XXXX XXXX XXXX, Acct # : XXXX XXXX XXXX, Acct # : XXXX XXXX XXXX XXXX, Acct # : XXXX",
"It was not disclosed that I would not receive a refund if or when the money transfer went to the wrong person.",
"I am submitting this complaint to dispute inaccurate and incomplete information on my TransUnion credit report. \n\nCharged-Off Accounts I dispute the following accounts : XXXX XXXX Acct XXXX ( XX/XX/XXXX, balance {$0.00} ) XXXX XXXX Acct XXXX ( XX/XX/XXXX, balance {$1200.00} ) XXXX XXXX Acct XXXX ( XX/XX/XXXX, balance {$1000.00} ) These accounts may be inaccurately reported or negatively affecting my credit. I request TransUnion verify balances, reporting dates, and account status, and remove or correct any information that can not be substantiated. \n\nLate Payments XXXX XXXX XXXX Acct XXXX I dispute this late payment and request correction or removal.",
"Subject : DEMAND FOR IMMEDIATE REMOVAL OF INACCURATE BANKRUPTCY FCRA VIOLATIONS To Whom It May Concern, I am writing to formally dispute the bankruptcy reporting on my TransUnion credit report. I have never filed for bankruptcy, and the U.S. Bankruptcy Court in Los Angeles has confirmed this. This inaccurate reporting is a clear violation of the Fair Credit Reporting Act ( FCRA ) and must be removed immediately.\n\nDetails of the Disputed Bankruptcy Bankruptcy Court : U.S. Bankruptcy Court, Los Angeles County Filed Under : XXXX XXXX ( Incorrectly Assigned ) Case Number : XXXX Supporting Evidence Included A written confirmation from the U.S. Bankruptcy Court Clerk, Aarron, confirming that I have never filed for bankruptcy. \n\nCopies of my XXXX and XXXX credit reports, which do NOT show any bankruptcy. \n\nFCRA VIOLATIONS BY TRANSUNION 1. FCRA 1681e ( b ) Failure to Maintain Maximum Possible Accuracy TransUnion has a legal duty to ensure all reported information is accurate. Reporting a bankruptcy that does not belong to me is a direct violation.\n\n2. FCRA 1681i ( a ) ( 1 ) ( A ) Inclusion of False Information The U.S. Bankruptcy Court does not report to credit bureaus. TransUnion is reporting incorrect information obtained from a third-party source, violating federal law. \n\n3. FCRA 1681i ( a ) ( 5 ) Failure to Properly Reinvestigate If TransUnion previously \" verified '' this bankruptcy, it failed to conduct a proper reinvestigation, making the reporting unlawful.\n\n4. FCRA 1681g ( a ) ( 2 ) Failure to Disclose Source of Information I am demanding that TransUnion provide the exact source of this bankruptcy record. If it can not be verified with official court documentation, it must be deleted immediately.\n\n5. FCRA 1681c ( a ) ( 1 ) Mixed File Error The U.S. Bankruptcy Court confirmed that multiple individuals with the name \" XXXX XXXX '' have filed for bankruptcy. This is a clear mixed file violation, and the inaccurate bankruptcy must be deleted immediately. \n\nDEMAND FOR IMMEDIATE ACTION XXXX. I am formally demanding that TransUnion : XXXX. Immediately delete the inaccurate bankruptcy from my credit report. \n\nXXXX. Provide written confirmation that this bankruptcy has been permanently removed. \n\nDisclose the exact source of this incorrect information. \n\nFailure to comply within 30 days will result in formal complaints to the CFPB, FTC, and California Attorney General for willful FCRA violations. Additionally, I reserve the right to pursue legal action for damages under FCRA 1681n, which allows for statutory damages of up to {$1000.00} per violation, plus attorney fees. \n\nThis is my final notice. If TransUnion can not provide court-verified proof of this bankruptcy, it must be removed immediately. \n\nSincerely, XXXX XXXX XXXX"
]
embeddings = model.encode(sentences)
similarities = model.similarity(embeddings, embeddings)
print(similarities.shape)
# [4, 4]This is a sentence-transformers model finetuned from nomic-ai/nomic-embed-text-v1.5 on the ccdb-triplets dataset. It maps sentences & paragraphs to a 768-dimensional dense vector space and can be used for retrieval.
SentenceTransformer(
(0): Transformer({'transformer_task': 'feature-extraction', 'modality_config': {'text': {'method': 'forward', 'method_output_name': 'last_hidden_state'}}, 'module_output_name': 'token_embeddings', 'architecture': 'NomicBertModel'})
(1): Pooling({'embedding_dimension': 768, 'pooling_mode': 'mean', 'include_prompt': True})
)
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("sentence_transformers_model_id")
# Run inference
queries = [
'On XX/XX/year>. My wallet was stolen from XXXX XXXX on XXXX XXXX, CA. They spent XXXX on my my debit card somehow without my pin. Now I filed a dispute 3 times and the bank ( chime ) and they are claiming there was no error with the transactions. I clearly got scammed and they are basically saying there is nothing they can do and kick rocks. Their specialist claimed they throughly investigated but clearly they didnt do anything because I sent my police report just how they asked, and it didnt help. I needed that money and now Im left stuck',
]
documents = [
'On XX/XX/2026 @ XXXX & XXXX two fraudulent charges were made to my Chime bank account. \n\nThe amounts of {$270.00} and {$44.00} were made at a local XXXX store. \n\nMy debit card was stolen earlier that day from my driveway so I immediately called chime and they cancelled my card and assured me a new one. \n\nCreating a dispute to get my money back has been a hassle as I have been denied 3 times by Chime and keep saying no error has occurred. \n\nThey sent me their findings as to how they came to this conclusion. Which was essentially just transcripts of the previous phone calls I made to report it. No actual evidence was provided in the report. \n\nThere is also false information saying that I didnt make a police report when in fact I did, the same day of XX/XX/year>. \n\nToday I just got denied for the third time via email and am now seeking assistance from your organization. \nXX/XX/year> P.s I am willing to provide more evidence',
'Take time to review the materials ; the questions were submitted abruptly and might not be approved.',
"I am submitting this complaint regarding a medical collection account that is incorrectly appearing on my credit report, despite the CFPBs recent rule banning the inclusion of medical debt on credit reports used by lenders. \n\nOn XX/XX/year> I reviewed my credit reports and found that a medical collection account from XXXX XXXX XXXX is still being reported to EXPERIAN, EQUIFAX AND TRANSUNION. According to the CFPBs final rule effective in XXXX, medical debts should no longer appear on consumer credit reports. \n\nI've requested removal, but they have either refused or failed to take appropriate action. This incorrect reporting is negatively impacting my credit and financial opportunities.",
]
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.6088, -0.0844, -0.0697]])
triplet-evalTripletEvaluator| Metric | Value |
|---|---|
| cosine_accuracy | 1.0 |
query, positive, and negative| query | positive | negative | |
|---|---|---|---|
| type | string | string | string |
| modality | text | text | text |
| details |
|
|
|
| query | positive | negative |
|---|---|---|
Complaint Against : Citibank ( Home Depot Credit Card ) Issue : Failure to timely return funds from erroneous payment / Unreasonable delay / Refusal to escalate On XX/XX/XXXX, I attempted to make an online payment of {$49.00} to my Home Depot Credit Card account ( issued by Citibank ). Due to a payment entry error on my part, a payment of {$2200.00} was processed instead. |
Complaint Against Citibank Home Depot Credit Card I have a Home Depot credit card account serviced by Citibank. My balance is approximately {$1300.00} I had automatic payments set up on this account. In addition, my wife made additional payments to ensure the account was paid on time. Citibank returned the checks that were sent for payment. These were not bounced for insufficient funds they were returned by Citibank. We received the returned checks and redeposited them into our bank account. |
My account got deactivated because apparently I went against the terms of services |
This is a new and separate complaint regarding a {$14000.00} international wire transfer sent on XX/XX/year>. It is not related in any way to the {$200.00} wire from XX/XX/year>, which Chase mistakenly responded to in my prior CFPB complaint. Their response addressed the wrong transaction and must be disregarded. |
On XX/XX/XXXX, I requested a telephonic wire from my credit union to Chase Bank. I contacted my credit union ( XXXX XXXXXXXX XXXX XXXXXXXX XXXX XXXX XXXX XXXX ) and requested the telephonic wire. The wire 's beneficiary was listed as XXXX XXXX XXXX, with a corresponding address of XXXX XXXX XXXX, XXXX XXXX, XXXX XXXX. |
Account has been hacked and information has been released or shared |
on XX/XX/XXXX I purchased items from XXXXXXXX XXXX in XXXX, which I did not receive because the XXXX XXXX lost the package. It was " lost '' while the courier had it in his truck to deliver. Instead of stating that the package was lost in his possession, he lied and said he attempted delivery, but my building was locked and he didn't have access code. I immediately called XXXX XXXX to let them know this was impossible because we have XXXX hour concierge who is signer for all packages, and no access code because our doors are unlocked XXXX hours. I called XXXX XXXX every day for XXXX days asking for the package redelivery, and on the XXXX day spoke to supervisor XXXX who informed me that the package had been lost while in route to my address. I was told I couldn't file a claim that only the seller could do this. I contacted the seller XXXX times and got no reply, but was told by XXXX XXXX that ganga fashions had already filed a claim for the lost package. I am out XXXX for the clothing... |
In XX/XX/year>, I made a purchase from XXXX for {$370.00}. The package never arrived. Although the tracking initially showed delivered, XXXX completed an investigation and issued a written statement confirming that the package was never delivered and is irretrievably lost. |
My information was leaked in the data breach that occurred |
CachedMultipleNegativesRankingLoss with these parameters:{
"scale": 20.0,
"similarity_fct": "cos_sim",
"mini_batch_size": 4,
"gather_across_devices": false,
"directions": [
"query_to_doc"
],
"partition_mode": "joint",
"hardness_mode": null,
"hardness_strength": 0.0
}
query, positive, and negative| query | positive | negative | |
|---|---|---|---|
| type | string | string | string |
| modality | text | text | text |
| details |
|
|
|
| query | positive | negative |
|---|---|---|
Dear Sir/Madam, I am writing to dispute the following accounts reported on my credit report. These items do not accurately reflect my credit history and I respectfully request that they be reviewed for correction or removal in accordance with the Fair Credit Reporting Act ( FCRA ). Below, I have listed the accounts in dispute, separated by each credit bureau. |
Dear Sir/Madam, I am writing to dispute the following accounts on my credit report. I believe these accounts contain inaccuracies and are being reported in error. |
I had medical insurance and it should have been covered. |
My Apple Card account was closed for alleged fraud with no fraudulent activity present. I contacted Goldman Sachs XXXX XXXX ( XXXX representatives including a manager ) and was given no explanation and no path for review. I am requesting a detailed explanation and reconsideration of the closure. I opened this account XX/XX/year>. Havent had XXXX issue with this card ever. Even though you can use it anywhere I only use it at the Apple XXXX. I currently had apple subscriptions on it as well. I randomly got a notification on my XXXX my Apple Card was unavailable at XXXX est. Thats when I began to call. They sent me a generic email and nobody was providing any information. They said I could reapply. Tried that it said nope already have an account. Its crazy on the email it says call customer service for them to not tell me anything. |
I received an email from Apple stating me account was closed and I could no longer use the card. When I contacted Apple XXXX and Goldman Sachs neither would provide me with information as to why my account was closed. The email stated that it was closed due to failure to comply with customer agreement. I asked for an explanation and nothing was given. I was making payments on the account and it was still closed. I would like to find out why. |
Received a email today or yesterday about a upcoming payment. My email is not for that I get a paper statement every month for notification. I could understand if email is for confirmation of payment. To me its harassment to use my email to let me know about a upcoming payment. This is a VA backed loan. Even if you're late you get a letter which is fine. We all get enough emails we have to delete. I haven't been 30 days late on any mortgage in almost 30 years. That can be verified by my credit. And I maintain a good credit score. If im late I pay the late fee with no problem. So those emails about a upcoming payment is harassment. I suffer from a medical condition that makes this really unhealthy for me. I can provide that medical documents. |
I am submitting a complaint regarding my auto loan with XXXX XXXX XXXX My account has never been included in bankruptcy proceedings. Although I filed a XXXX XXXX bankruptcy, the case was dismissed and this auto loan was not part of that filing. I have continued making on-time payments on this account since XX/XX/year>, and the account remains active and in good standing. However, XXXX has stated that they are not reporting this account to the credit bureaus due to an internal bankruptcy flag. They also indicated that they can not remove the bankruptcy designation from the account due to internal policy. This is concerning, as the account is not currently in bankruptcy, was not included in the bankruptcy, and remains active. Maintaining a bankruptcy-related designation or suppressing reporting under these circumstances may result in incomplete or misleading credit reporting. I am requesting that XXXX review this account for accurate classification and determine whether the account can b... |
I am submitting a complaint regarding inaccurate credit reporting on an auto loan account. This account was included in my bankruptcy, and the vehicle was surrendered as part of the bankruptcy process. The debt was discharged ; however, the account is currently being reported with continued late payments after the bankruptcy discharge date. This is inaccurate and misleading. Once a debt is included in bankruptcy and discharged, it should not reflect ongoing delinquency. The account should instead be reported as Included in Bankruptcy or Discharged in Bankruptcy with a {$0.00} balance. The current reporting misrepresents the status of this account and is negatively impacting my credit profile. I am requesting that this account be corrected to accurately reflect its inclusion in bankruptcy and that all inaccurate post-discharge activity be removed. |
Sent money person never received it a few time and I never received money that was suppose to be sent to me and nothing was done about it |
CachedMultipleNegativesRankingLoss with these parameters:{
"scale": 20.0,
"similarity_fct": "cos_sim",
"mini_batch_size": 4,
"gather_across_devices": false,
"directions": [
"query_to_doc"
],
"partition_mode": "joint",
"hardness_mode": null,
"hardness_strength": 0.0
}
per_device_train_batch_size: 16num_train_epochs: 20learning_rate: 2e-05warmup_steps: 0.1bf16: Trueper_device_eval_batch_size: 16load_best_model_at_end: Trueseed: 777data_seed: 777prompts: {'query': 'search_query: ', 'positive': 'search_document: ', 'negative': 'search_document: '}batch_sampler: no_duplicatesper_device_train_batch_size: 16num_train_epochs: 20max_steps: -1learning_rate: 2e-05lr_scheduler_type: linearlr_scheduler_kwargs: Nonewarmup_steps: 0.1optim: adamw_torch_fusedoptim_args: Noneweight_decay: 0.0adam_beta1: 0.9adam_beta2: 0.999adam_epsilon: 1e-08optim_target_modules: Nonegradient_accumulation_steps: 1average_tokens_across_devices: Truemax_grad_norm: 1.0label_smoothing_factor: 0.0bf16: Truefp16: Falsebf16_full_eval: Falsefp16_full_eval: Falsetf32: Nonegradient_checkpointing: Falsegradient_checkpointing_kwargs: Nonetorch_compile: Falsetorch_compile_backend: Nonetorch_compile_mode: Noneuse_liger_kernel: Falseliger_kernel_config: Noneuse_cache: Falseneftune_noise_alpha: Nonetorch_empty_cache_steps: Noneauto_find_batch_size: Falselog_on_each_node: Truelogging_nan_inf_filter: Trueinclude_num_input_tokens_seen: nolog_level: passivelog_level_replica: warningdisable_tqdm: Falseproject: huggingfacetrackio_space_id: Nonetrackio_bucket_id: Nonetrackio_static_space_id: Noneper_device_eval_batch_size: 16prediction_loss_only: Trueeval_on_start: Falseeval_do_concat_batches: Trueeval_use_gather_object: Falseeval_accumulation_steps: Noneinclude_for_metrics: []batch_eval_metrics: Falsesave_only_model: Falsesave_on_each_node: Falseenable_jit_checkpoint: Falsepush_to_hub: Falsehub_private_repo: Nonehub_model_id: Nonehub_strategy: every_savehub_always_push: Falsehub_revision: Noneload_best_model_at_end: Trueignore_data_skip: Falserestore_callback_states_from_checkpoint: Falsefull_determinism: Falseseed: 777data_seed: 777use_cpu: Falseaccelerator_config: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}parallelism_config: Nonedataloader_drop_last: Falsedataloader_num_workers: 0dataloader_pin_memory: Truedataloader_persistent_workers: Falsedataloader_prefetch_factor: Nonedataloader_multiprocessing_context: Nonedataloader_in_order: Trueremove_unused_columns: Truelabel_names: Nonetrain_sampling_strategy: randomlength_column_name: lengthddp_find_unused_parameters: Noneddp_bucket_cap_mb: Noneddp_broadcast_buffers: Falseddp_static_graph: Noneddp_backend: Noneddp_timeout: 1800fsdp: Nonefsdp_config: Nonedeepspeed: Nonedebug: []skip_memory_metrics: Truedo_predict: Falseresume_from_checkpoint: Nonelocal_rank: -1prompts: {'query': 'search_query: ', 'positive': 'search_document: ', 'negative': 'search_document: '}batch_sampler: no_duplicatesmulti_dataset_batch_sampler: proportionalrouter_mapping: {}learning_rate_mapping: {}warmup_ratio: None| Epoch | Step | Training Loss | Validation Loss | triplet-eval_cosine_accuracy |
|---|---|---|---|---|
| -1 | -1 | - | - | 1.0 |
| 1.0 | 7806 | 0.1856 | 0.0569 | 1.0 |
| 2.0 | 15612 | 0.0472 | 0.0402 | 1.0 |
| 3.0 | 23418 | 0.0361 | 0.0347 | 1.0000 |
| 4.0 | 31224 | 0.0330 | 0.0330 | 1.0 |
| 5.0 | 39030 | 0.0321 | 0.0324 | 1.0 |
| 6.0 | 46836 | 0.0320 | 0.0319 | 1.0 |
| 7.0 | 54642 | 0.0311 | 0.0315 | 1.0 |
| -1 | -1 | - | - | 1.0 |
@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{gao2021scaling,
title={Scaling Deep Contrastive Learning Batch Size under Memory Limited Setup},
author={Luyu Gao and Yunyi Zhang and Jiawei Han and Jamie Callan},
year={2021},
eprint={2101.06983},
archivePrefix={arXiv},
primaryClass={cs.LG}
}
Base model
nomic-ai/nomic-embed-text-v1.5