There is no different. “AutoModel(ForXXX)” automatically selects the right model depending on the model that you request. Because you ask for xlnet-base-cased it will know to load XLNetForSequenceClassification. You can use either.