bert icon indicating copy to clipboard operation
bert copied to clipboard

Classification quality is depends on max_sequence_length

Open avostryakov opened this issue 8 years ago • 3 comments

We fine-tuned BERT-base on our text classification dataset which has a max token length (word pieces) around 110 tokens. What is interesting that final quality after fine-tuning highly depends on max_sequence_length value. With max_sequence_length=128 quality is much worse than with max_sequence_length=512. Why can it be so?

P.S. We didn't pre-train BERT-base LM itself on our texts

avostryakov avatar Nov 13 '18 08:11 avostryakov

This shouldn't be possible, but keep in mind there is a lot of noise in tuning so I wouldn't draw this conclusion unless you ran at least 5 runs with identical hyperparameters for each.

jacobdevlin-google avatar Nov 14 '18 05:11 jacobdevlin-google

I trained 3-4 times per dataset and results is consistent. To be precise, we have a multilabel classification, we changed your code a little to support this: loss function and input of labels. I have no idea why it's so

avostryakov avatar Nov 15 '18 05:11 avostryakov

padding id ?

nbcc avatar Dec 05 '18 10:12 nbcc