v148 · origin trial · on-device AI
TopK Visualizer
See exactly how temperature and topK sampling parameters shape the token probability distribution. The chart shows raw logits scaled by temperature, then the topK cutoff that discards the long tail. Adjust both sliders and watch which tokens survive sampling.
Divides logits before softmax. Low temperature → distribution peaks sharply at the top token. High temperature → distribution flattens, all tokens get more equal probability.
Keep only the K highest-probability tokens. Tokens ranked below K are zeroed out before sampling. topK=1 means always pick the single most likely token (greedy decoding).
the math behind sampling
references
implementation reference
Need the exact API surface, compatibility boundaries, errors, lifecycle, and source links? Read the matching gendn reference ↗