title: Problem with batch_encode_plus method of tokenizer
body: <p>I am encountering a strange issue in the <code>batch_encode_plus</code> method of the tokenizers. I have recently switched from transformer version 3.3.0 to 4.5.1. (I am creating my databunch for NER).</p>
  <p>I have 2 sentences whom I need to encode, and I have a case where the sentences are already tokenized, but since both the sentences differs in length so I need to <code>pad [PAD]</code> the shorter sentence in order to have my batch of uniform lengths.</p>
  <p>Here is the code below of I did with 3.3.0 version of transformers</p>
  <pre><code>from transformers import AutoTokenizer
  
  pretrained_model_name = 'distilbert-base-cased'
  tokenizer = AutoTokenizer.from_pretrained(pretrained_model_name, add_prefix_space=True)
  
  sentences = [&quot;He is an uninvited guest.&quot;, &quot;The host of the party didn't sent him the invite.&quot;]
  
  # here we have the complete sentences
  encodings = tokenizer.batch_encode_plus(sentences, max_length=20, padding=True)
  batch_token_ids, attention_masks = encodings[&quot;input_ids&quot;], encodings[&quot;attention_mask&quot;]
  print(batch_token_ids[0])
  print(tokenizer.convert_ids_to_tokens(batch_token_ids[0]))
  
  # And the output
  # [101, 1124, 1110, 1126, 8362, 1394, 5086, 1906, 3648, 119, 102, 0, 0, 0, 0]
  # ['[CLS]', 'He', 'is', 'an', 'un', '##in', '##vi', '##ted', 'guest', '.', '[SEP]', '[PAD]', '[PAD]', '[PAD]', '[PAD]']
  
  # here we have the already tokenized sentences
  encodings = tokenizer.batch_encode_plus(batch_token_ids, max_length=20, padding=True, truncation=True, is_split_into_words=True, add_special_tokens=False, return_tensors=&quot;pt&quot;)
  
  batch_token_ids, attention_masks = encodings[&quot;input_ids&quot;], encodings[&quot;attention_mask&quot;]
  print(batch_token_ids[0])
  print(tokenizer.convert_ids_to_tokens(batch_token_ids[0])) 
  
  # And the output 
  tensor([ 101, 1124, 1110, 1126, 8362, 1394, 5086, 1906, 3648,  119,  102, 0, 0, 0, 0])
  ['[CLS]', 'He', 'is', 'an', 'un', '##in', '##vi', '##ted', 'guest', '.', '[SEP]', '[PAD]', [PAD]', '[PAD]', '[PAD]']
  </code></pre>
  <p>But if I try to mimic the same behavior in transformer version 4.5.1, I get different output</p>
  <pre><code>from transformers import AutoTokenizer
      
  pretrained_model_name = 'distilbert-base-cased'
  tokenizer = AutoTokenizer.from_pretrained(pretrained_model_name, add_prefix_space=True)
  
  sentences = [&quot;He is an uninvited guest.&quot;, &quot;The host of the party didn't sent him the invite.&quot;]
  
  # here we have the complete sentences
  encodings = tokenizer.batch_encode_plus(sentences, max_length=20, padding=True)
  batch_token_ids, attention_masks = encodings[&quot;input_ids&quot;], encodings[&quot;attention_mask&quot;]
  print(batch_token_ids[0])
  print(tokenizer.convert_ids_to_tokens(batch_token_ids[0]))
  
  # And the output
  #[101, 1124, 1110, 1126, 8362, 1394, 5086, 1906, 3648, 119, 102, 0, 0, 0, 0]
  #['[CLS]', 'He', 'is', 'an', 'un', '##in', '##vi', '##ted', 'guest', '.', '[SEP]', '[PAD]', '[PAD]', '[PAD]', '[PAD]']
  
  # here we have the already tokenized sentences, Note we cannot pass the batch_token_ids 
  # to the batch_encode_plus method in the newer version, so need to convert them to token first
  tokens1 = tokenizer.tokenize(sentences[0], add_special_tokens=True)
  tokens2 = tokenizer.tokenize(sentences[1], add_special_tokens=True)
  
  encodings = tokenizer.batch_encode_plus([tokens1, tokens2], max_length=20, padding=True, truncation=True, is_split_into_words=True, add_special_tokens=False, return_tensors=&quot;pt&quot;)
  
  batch_token_ids, attention_masks = encodings[&quot;input_ids&quot;], encodings[&quot;attention_mask&quot;]
  print(batch_token_ids[0])
  print(tokenizer.convert_ids_to_tokens(batch_token_ids[0]))
  
  # And the output (not the desired one)
  tensor([  101,  1124,  1110,  1126,  8362,   108,   108,  1107,   108,   108,
            191,  1182,   108,   108, 21359,  1181,  3648,   119,   102])
  ['[CLS]', 'He', 'is', 'an', 'un', '#', '#', 'in', '#', '#', 'v', '##i', '#', '#', 'te', '##d', 'guest', '.', '[SEP]']
  </code></pre>
  <p>Not sure how to handle this, or what I am doing wrong here.</p>