tevatron icon indicating copy to clipboard operation
tevatron copied to clipboard

Contrastive pre-training with InfoNCE loss

Open yurinoviello opened this issue 9 months ago • 1 comments

I am trying to reproduce (with some differences), the results obtained for the e5 models family.

The second stage fine-tuning is perfectly reproducible with this repo (I am using the v2)

However, for the contrastive pre-training, I wanted to change the cross-entropy loss of the EncoderModel to the InfoNCE loss. This should be enough, right?

Also, it is not clear to me about how perform only in-batch negatives tuning with this repo. I did not found any option on the trainer, and when I have examples without negative_passages I obtain an error.

Thank you.

yurinoviello avatar May 08 '24 09:05 yurinoviello

set --train_group_size to 1 should make the training to be in-batch negatives only.

ArvinZhuang avatar May 16 '24 02:05 ArvinZhuang