Base logits
from the forward pass
Apply prompt conditioning
shifts the distribution
Apply decoding constraints
temperature, top-p, grammars
Sample token
final choice
Formally, the model defines where is the full prompt. Prompt engineering changes ; decoding parameters change how the resulting distribution is turned into a sampled token. Understanding both together explains why the same prompt can look great at temperature 0 and much worse at temperature 1.