Exercises / llm
Greedy vs sample
pick(logits, greedy=True) returns argmax index, or a weighted sample with random.choices. With seed 0 and greedy False, print both strategies on [0.1, 0.8, 0.1].
Live Pythonpython
Output
Run to execute this in your browser. Nothing is sent to a server.