triplet loss compares against a single negative, giving sparse gradients and dependence on hard-negative mining; InfoNCE folds all in-batch negatives into the softmax denominator, far better negative utilization and gradient signal, and is structurally identical to multi-class cross-entropy (positive logit =
sim(xi,yi)/τ). Temperature controls sharpness: small
τ amplifies logits, forcing the positive to win decisively; large
τ flattens the distribution, diluting positive-negative separation. Example: positive
sim=0.9, negative
sim=0.2; with
τ=0.07 (CLIP's default) logits become
0.9/0.07≈12.86 vs
0.2/0.07≈2.86, the positive softmax probability is
≈99.99% and the loss is near zero; with
τ=1 the logits are only 0.9 vs 0.2, giving about
66.7% positive probability — the model almost loses discriminative power.