I have seen Bert Argument for fine tuning on a specific task from hugging face library:
BertConfig {
"attention_probs_dropout_prob": 0.1,
"hidden_act": "gelu",
"hidden_dropout_prob": 0.1,
"hidden_size": 768,
"initializer_range": 0.02,
"intermediate_size": 3072,
"layer_norm_eps": 1e-12,
"max_position_embeddings": 512,
"model_type": "bert",
"num_attention_heads": 12,
"num_hidden_layers": 12,
"pad_token_id": 0,
"type_vocab_size": 2,
"vocab_size": 30522
}
So, my question is if the Bert model is pre-trained on a specific vocab_size, Then how can one change the vocab size as changing the vocab_size is changes the meaning and embeddings of some words which are not there in pre-trained vocabulary right, then how can the transformer model will be able to capture this difference?