Tonight, open a chat assistant on your phone and ask it to write a short letter to a newspaper editor about the water-logging in your neighbourhood. Press send. Within a second words start appearing on the screen, one after another, in a smooth and sensible order, as if a very quick typist were sitting on the other end.
Nobody is typing. What is happening is stranger than that, and, once you see it, simpler. A program is answering one small question over and over: given everything written so far, which piece of text is most likely to come next? It picks one piece, adds it to the page, and asks the same question again. A letter of two hundred words is that question asked about three hundred times. That is the whole trick, and this chapter takes it apart, piece by piece.
It matters for your exams, because the papers have started to ask. Who made ChatGPT? What does GPT stand for? Which architecture stands behind large language models? And in the Combined Bank Assistant Programmer paper of 31 October 2026 the written question was "Explain how Large Language Models work". A full-mark answer needs the whole path, from a typed sentence to a generated one, in the right order and with the right words.
By the end you will be able to follow one sentence through a language model: cut it into tokens with the method real tokenisers use, turn the tokens into vectors, and work self-attention by hand on three words, with scores, scaling, softmax and a weighted sum. You will see what the mask, the many heads and the position vectors do, assemble a transformer block, and tell BERT from GPT. You will say what pre-training is and how much it takes, how the model picks its words with temperature, top-k and top-p, what a context window is, and what ChatGPT is, who made it, and where it can let you down. You will also see why the same sentence costs about six times as many tokens in Bangla as in English.