ChatGPT is of course more sophisticated than that, and it also predicts the start of sentences, and ensures that whole documents are consistent. But the fundamental idea of predicting the next words in a sequence is still the same. (4/n)