How LLMs learn and generate text

The pipeline from prompt to answer: tokenize text into subword IDs, embed them, run them through stacked transformer layers, and read a probability distribution off the top. Everything an LLM does — chat, code, reasoning — is this loop applied one token at a time.