Most are transformer encoders trained with contrastive learning: pairs of related texts (query and relevant passage, question and answer, paraphrases) are pulled together while unrelated texts are pushed apart.
A typical loss is InfoNCE: for each query, the matching passage is the positive and the other passages in the batch (in-batch negatives) are negatives, so larger batches give a harder task.
Hard negatives (passages that look relevant but are not) improve quality a lot.
Training usually starts with large weakly supervised pairs from the web, followed by fine-tuning on curated labeled data.
Loading…