<s>
Triplet	B-Algorithm
loss	I-Algorithm
is	O
a	O
loss	O
function	O
for	O
machine	O
learning	O
algorithms	O
where	O
a	O
reference	O
input	O
(	O
called	O
anchor	O
)	O
is	O
compared	O
to	O
a	O
matching	O
input	O
(	O
called	O
positive	O
)	O
and	O
a	O
non-matching	O
input	O
(	O
called	O
negative	O
)	O
.	O
</s>
<s>
An	O
early	O
formulation	O
equivalent	O
to	O
triplet	B-Algorithm
loss	I-Algorithm
was	O
introduced	O
(	O
without	O
the	O
idea	O
of	O
using	O
anchors	O
)	O
for	O
metric	O
learning	O
from	O
relative	O
comparisons	O
by	O
M	O
.	O
Schultze	O
and	O
T	O
.	O
Joachims	O
in	O
2003	O
.	O
</s>
<s>
By	O
enforcing	O
the	O
order	O
of	O
distances	O
,	O
triplet	B-Algorithm
loss	I-Algorithm
models	O
embed	O
in	O
the	O
way	O
that	O
a	O
pair	O
of	O
samples	O
with	O
same	O
labels	O
are	O
smaller	O
in	O
distance	O
than	O
those	O
with	O
different	O
labels	O
.	O
</s>
<s>
Unlike	O
t-SNE	B-Algorithm
which	O
preserves	O
embedding	O
orders	O
via	O
probability	O
distributions	O
,	O
triplet	B-Algorithm
loss	I-Algorithm
works	O
directly	O
on	O
embedded	O
distances	O
.	O
</s>
<s>
It	O
is	O
often	O
used	O
for	O
learning	B-General_Concept
similarity	I-General_Concept
for	O
the	O
purpose	O
of	O
learning	O
embeddings	O
,	O
such	O
as	O
learning	O
to	O
rank	O
,	O
word	B-General_Concept
embeddings	I-General_Concept
,	O
thought	B-Algorithm
vectors	I-Algorithm
,	O
and	O
metric	O
learning	O
.	O
</s>
<s>
This	O
can	O
be	O
avoided	O
by	O
posing	O
the	O
problem	O
as	O
a	O
similarity	B-General_Concept
learning	I-General_Concept
problem	O
instead	O
of	O
a	O
classification	O
problem	O
.	O
</s>
<s>
A	O
triplet	B-Algorithm
loss	I-Algorithm
is	O
used	O
in	O
this	O
case	O
.	O
</s>
<s>
In	O
computer	B-Application
vision	I-Application
tasks	O
such	O
as	O
re-identification	O
,	O
a	O
prevailing	O
belief	O
has	O
been	O
that	O
the	O
triplet	B-Algorithm
loss	I-Algorithm
is	O
inferior	O
to	O
using	O
surrogate	B-Algorithm
losses	I-Algorithm
(	O
i.e.	O
,	O
typical	O
classification	O
losses	O
)	O
followed	O
by	O
separate	O
metric	O
learning	O
steps	O
.	O
</s>
<s>
Recent	O
work	O
showed	O
that	O
for	O
models	O
trained	O
from	O
scratch	O
,	O
as	O
well	O
as	O
pretrained	O
models	O
,	O
a	O
special	O
version	O
of	O
triplet	B-Algorithm
loss	I-Algorithm
doing	O
end-to-end	O
deep	O
metric	O
learning	O
outperforms	O
most	O
other	O
published	O
methods	O
as	O
of	O
2017	O
.	O
</s>
<s>
Additionally	O
,	O
triplet	B-Algorithm
loss	I-Algorithm
has	O
been	O
extended	O
to	O
simultaneously	O
maintain	O
a	O
series	O
of	O
distance	O
orders	O
by	O
optimizing	O
a	O
continuous	O
relevance	O
degree	O
with	O
a	O
chain	O
(	O
i.e.	O
,	O
ladder	O
)	O
of	O
distance	O
inequalities	O
.	O
</s>
<s>
In	O
Natural	O
Language	O
Processing	O
,	O
triplet	B-Algorithm
loss	I-Algorithm
is	O
one	O
of	O
the	O
loss	O
functions	O
considered	O
for	O
BERT	O
fine-tuning	O
in	O
the	O
SBERT	O
architecture	O
.	O
</s>
