Learn Before
Concept

Max-margin loss

Max-margin loss (also known as hinge loss) is a loss function used to compare the decoded score of a true pair to a negative sample. Instead of formulating the problem as a binary classification task, it compares the direct outputs of the decoders. If the score for the positive (true) pair exceeds that of the negative pair by at least a margin Δ\Delta, the loss is zero. Otherwise, a loss is incurred. This can be mathematically expressed as:

L=max(0,Δ(struesneg))\mathcal{L} = \max(0, \Delta - (s_{\text{true}} - s_{\text{neg}}))

where strues_{\text{true}} and snegs_{\text{neg}} represent the decoded scores for the true and negative pairs, respectively.

Image 0

0

1

Updated 2026-07-03

Tags

Data Science