Contrastive Learning for Retrieval: InfoNCE & DPR Guide › Key Parameters

Michael BrenndoerferJanuary 23, 20261 min read
Language AI HandbookAll chapters
Part 44 of 67Retrieval-Augmented Generation
Chapter 335Contrastive Learning for Retrieval: InfoNCE & DPR Guide › Key Parameters
Reading section 8 of 12 · Key Parameters · 1 minSection 8 of 12 · 1 min

Book contents

Section 8 of 12 · 1 min read

Contrastive Learning for Retrieval: InfoNCE & DPR Guide › Key ParametersOne section · Sections in this chapter8 / 12 ↓
Reading tools Definitions & inline links

Choose your expertise level to adjust how many terms are explained. Beginners see more tooltips, experts see fewer to maintain reading flow. Hover over underlined terms for instant definitions.

Article links

Make inline references clickable

The key parameters for Dense Passage Retrieval training are:

  • temperature: Scales the similarity scores before softmax. DPR uses 1.0 (no scaling).
  • batch_size: Number of queries per batch. Critical for in-batch negatives; larger batches (e.g., 128) improve performance.
  • learning_rate: Step size for the optimizer. Common values are around 2×10−52 \times 10^{-5}.
  • weight_decay: Regularization parameter to prevent overfitting.
  • max_length: Maximum token sequence length. Queries and passages often have different limits (e.g., 32 and 128).