Your phone guesses the next word
Type "See you" on your phone, and the keyboard suggests the next word: "tomorrow", "soon", "later". It has learned which words usually come next.
A chatbot works the same way: it writes its answer one word at a time, each time choosing what comes next. Yet ask it the same question twice and you may get two different answers. How does it choose, and why not always the same word?
Schéma
Four cards: you type "See you"; the phone suggests tomorrow, soon, later; a chatbot also writes one word at a time; ask twice, get two different answers. Below: how does it choose the next word?