At each step the LM emits a logit per vocabulary token; softmax turns logits into a probability distribution. Sampling picks one token (here, the top one).