logoalt Hacker News

nodjatoday at 10:01 AM0 repliesview on HN

Yes, the whole list will always sum to 1 (100%) because there's lots of more sampling parameters. top_p, top_k and temperature are just the ones that affect output the most. Most parameters do math around assuming the list sums to 1 and order is not always the same, some software even lets you change the order around.

top_a is not very common and is better explained if I explain how the much more common min_p works. min_p filters out tokens below a certain threshold. The formula is <filter threshold> = <min_p> * <top token probability>. So if the top token has 0.5 probability, min_p = 0.1 would cut out tokens below 0.05. This is a tunable that lets you filter out other tokens depending on how confident the model is.

top_a is almost the same formula but you just square the <top token probability>. So <filter threshold> = <top_a> * <top token probability> ^ 2. This makes the filtering ramp up faster (cut out more tokens) if the model has a much more confident top choice, but keep more choices if the model is not so confident.