Does changing a token name in an image caption model affect performance?

Viewed 114

If I train an image caption model then stop to rename a few tokens:

  1. Should I train the model from scratch?
  2. Or can I reload the model and continue training from the last epoch with the updated vocabulary?

Will either approach effect model accuracy/performance differently?

3 Answers

I would go for option 2.

When training the model from scratch, you are initializing the model's weights randomly and then you fit them based on your problem. However, if, instead of using random weights, you use weights that have already been trained for a similar problem, you may decrease the convergence time. This option is kind similar to the idea of transfer learning.

Just to give the other team a voice: So what is actually the difference between training from scratch and reloading a model and continuing training?

(2) will converge faster, (1) will probably have a better performance and should thus be chosen. Do we actually care about training times when we trade them off with performance - do you really? See you do not.

The further your model is already converged to a specific problem, the harder it gets to get it back into another optimum. Now you might be lucky and the chance, that you are going down the right rabid hole, rises with similar tasks and similar data. Yet with a change in your setup this can not be guaranteed.

Initializing a few epochs on other than your target domain, definitely makes sense and is beneficial, yet the question arises why you would not train on your target domain from the very beginning.

Note: For a more substantial read I'd like to refer you to this paper, where they explain in more depth why domain is of the essence and transfer learning could mess with your final performance.

It depends on the number of tokens being relabeled compared to the total amount. Just because you mentioned there are few of them, then the optimal solution in my opinion is clear.

You should start the training from scratch but initialize the weights with the values they had from wherever the previous training stopped (again mentioning that it is crucial that the samples that are being re-labeled are not of substantial amount). This way, the model will likely converge faster than starting with random weights and also better than trying to re-fit ("forget") what it managed to learn from the previous training.

Topologically speaking you are initializing in a position where the model is closer to a global minimum but has not made any steps towards a local minimum.

Hope this helps.

Related