Text becomes tokens. Not words and not characters — fragments, chosen by a compression scheme fitted to a training corpus. Common words are single tokens; unusual ones split into several. This is why models are bad at counting letters in a word: they never see the letters, only the fragments.
The model predicts the next token. That is the entire mechanism. Given everything so far, it produces a probability distribution over what comes next. Everything a model appears to do — reasoning, summarising, coding, refusing — is that operation repeated, with the output appended and the process run again.
Attention decides what matters. When predicting the next token, the model weighs every previous token by relevance. This is what lets it connect a pronoun to a noun forty sentences back, and it is also why cost scales the way it does with context length.
Sampling introduces variation. The model gives a distribution; something has to pick. Picking the highest-probability token every time gives repetitive text, so a sampling strategy adds controlled randomness. That is why the same prompt gives different answers, and why lowering temperature makes output more predictable rather than more correct.
Training happened once, before you. Pre-training on a large corpus, then fine-tuning toward helpfulness and safety. The weights are frozen when you use it. It has no memory between conversations, no ability to learn from you, and no access to anything after its training cut-off unless you put it in the context.