T5 documentation for computing pretraining loss seems to have a mistake 
Dear @patrickvonplaten 

The documentation of T5 for computing loss of pretraining seems to have a mistake, where it talks on the loss formulation:
https://huggingface.co/transformers/model_doc/t5.html?highlight=decoder_input_ids 

```
input_ids = tokenizer('The <extra_id_0> walks in <extra_id_1> park', return_tensors='pt').input_ids
labels = tokenizer('<extra_id_0> cute dog <extra_id_1> the <extra_id_2>', return_tensors='pt').input_ids
# the forward function automatically creates the correct decoder_input_ids
loss = model(input_ids=input_ids, labels=labels).loss
```

1) the loss as per mt5 paper  "T5 is pre-trained on a masked language modeling “span-corruption” objective, where consecutive spans of input tokens are replaced with a mask token and the model is trained to **reconstruct the masked-out tokens.** "
https://arxiv.org/pdf/2010.11934.pdf

    So I believe you need to set the labels of masked tokens in labels to -100 then compute the loss in this example for pretraining.

2) Based on other examples in the repository, I think one need to do shift_right to compute the correct ` decoder_input_ids` before modifying the labels for the loss (before replacing -100 for the masked tokens) and pass it to the model as well, please correct me if mistaken. 

I greatly appreciate updating the documentations to show the correct procedure.

thanks. 
Hey @dorost1234,

you're right to be fully correct we should set the `<extra_id_0>` to `-100`. Maybe we could add the following lines to the doc

```python
# make sure no loss is computed on sentinel tokens. Sentinel tokens are in `additional_special_tokens`.
labels = [label if label not in tokenizer.additional_special_tokens else -100]
```

Would you like (and have the time) to open a PR for this to improve the docs maybe? Otherwise I can do it as well! :-) <|||||>This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the [contributing guidelines](https://github.com/huggingface/transformers/blob/master/CONTRIBUTING.md) are likely to be ignored.