ChatGPT is trained using AI and machine learning techniques. It undergoes unsupervised pre-training to understand human language structure and supervised fine-tuning to optimize its performance using deep learning algorithms.