What are Token Samplers?
mainA TokenSampler is an object responsible for proposing new tokens during the generation process. Given a context sequence, a sampler generates an individual token $x$ and attaches a log importance weight $w$ to it.
Note: Samplers also return a log-probability (often denoted as logp) which corresponds to the log-probability of all random choices made by the sampler. This is intended for testing purposes and is not used during the actual generation process.