22/29
Part 5 of 6 · The whole samplerWatch
Watch · 11 min
Raschka folds top-k and temperature into one generate function, with a draw from torch.multinomial and the argmax when the temperature is 0. His code runs top-k first, which gives the same result, because the two commute.
Build an LLM from Scratch 5: Pretraining on Unlabeled Data · Sebastian Raschka · Mar 2025YouTube