EasyDeepLearn

When and how do you fine-tune an embedding model?

hard

Answer

  • Fine-tune when off-the-shelf embeddings underperform on your domain (specialized jargon, product names, code, non-English).
  • Method: (1) collect (query, positive-doc) pairs from usage logs; (2) contrastive training (info-NCE loss) with in-batch negatives or hard negatives mined from a base retriever; (3) start from a strong base (E5, BGE, Nomic) — a few thousand pairs is often enough for LoRA-style fine-tuning.
  • Gains: 5-20% recall@10 over base.
  • Watch out for retraining bias — always eval on a held-out real-query set.
Check yourself — multiple choice
  • Never fine-tune
  • Contrastive fine-tune with (query, positive) pairs + hard negatives; base = strong pretrained encoder; 5-20% recall gain
  • Same as LLM fine-tuning
  • Only for images

Embedding fine-tune: contrastive on (query, positive) pairs + hard negatives → domain adaptation.

#embeddings#fine-tuning

Practise LLMs & GenAI

214 interview questions in this topic.

Related questions