Seeded explicitly so a run is reproducible: the same seed and the samelogits must produce the same token sequence, which is what makes samplingtestable at all. xorshift64* has a period of 2^64-1 and passes the usualbatteries for sampling use; it is not cryptographic and is not used foranything that needs to be.
Softmax over logits / temperature, with the max subtracted first.
Subtracting the max is what keeps exp in range: raw logits from a modelroutinely reach 30+, and exp(30) in Float is already near the top of therange, so a larger value would overflow to infinity and make thedistribution all-NaN.