179 questions
No questions match those filters.
How do you actually train a competitive dense bi-encode...
This is one of the questions in the full AI/ML interview bank. Pro unlocks all 1789 questions; Premium includes the same bank plus the highest daily Practice limit.
See plansWith labels, the central lever is negative selection, not batch size. Under a softmax-style contrastive loss, a negative’s gradient weight falls off roughly exponentially with how far its score sits behind the positive, so one hard negative pulled from the model’s own top retrieved results (ANCE-style) can carry orders of magnitude more training signal than a random in-batch negative — matching one hard negative with in-batch negatives alone would require an impractically large batch. The catch is staleness: as the model’s parameters move, its retrieval list moves too, so mined negatives need periodic re-encoding of the corpus and refreshed mining, which is real but bounded compute, run asynchronously rather than inline with training. There’s also a false-negative trap — mining from your own top-k pulls in unlabeled positives as often as true negatives when relevance judgments are sparse, actively teaching the model to push correct answers away, which is why RocketQA-style pipelines filter mined candidates through a cross-encoder first and keep only ones it confidently rejects.
Without labels at all, contrastive pretraining (Contriever/MoCo-style) manufactures positive pairs from independent crops of the same document rather than from relevance judgments, and uses a momentum-updated key encoder to maintain a large negative queue cheaply without huge batches. Treat this as an initializer, not an endpoint — fine-tuning with real hard negatives on top consistently beats either approach alone — and evaluate an unsupervised retriever on recall@100 against BM25, not nDCG@10, since it’s feeding a reranker rather than serving top-of-list precision directly.