Transformer similarity (fine-tuned on classification) too sensitive
I fine-tuned a transformer for classification to compute similarity between names. This is a toy example:name0 name1 label
 Test  Test  y
 Test  Hi    nI fined-tuned the model using the label and feeding it with pairs of names astokenizerallows to feed 2 pieces of text.I found a really weird behavior. At prediction times, there exist pairs that have very high chances to be predicted as similar just because they have repeated words. For example,name0        name1       label
   Hi Hi Hi     dsfds       ?has a high chance to be predicted asy!In general there exist some names that no matter what you pair them with, the pairs gets predicted asy.Did anyone notice this behavior?At the moment, I am trying to augment my data with:Empty namesRandom chars (always the same)E.g.name0 name1 label
 Test        n
       Test  n
 Test  dsfsd n
 dsfsd Test  nUnfortunately, I still see the same behavior.
2022-02-22T15:34:14Z
I’m not directly answering your question, but have you tried adding some negative examples of these cases in your training set?For example, adding the tuples (‘Test’, ‘’, n) (‘dsfs’, ‘Test’, n) and some others like these.At least for the empty names, the model should learn this!
2022-03-06T09:35:14Z
Yes, it actually helps a bit. Though, I sometimes see strange behavior with random strings of chars. I guess I am fine tuning on too little data.