Non-asymptotic Convergence of Training Transformers for Next-token Prediction