17/29
Part 4 of 5 · Precision and top-kLearn and do
A correct approximate top-k can lose tokens, but never the top one
Approximate top-k trades a little accuracy for speed. That trade has a limit, and the bug broke it.
Approximate top-k finds the top tokens fast
a probability for every token. Computed across tens of chips or more.
The post doesn't draw this order. It's the likely one.
A sampler with top-p at 0.99 needs the most likely tokens out of a large vocabulary. It needs them every step, for every sequence in the batch.
The post calls approximate top-k a performance optimization that quickly finds the highest probability tokens. Anthropic had used it because it gave substantial performance improvements.
Approximate top-k keeps the best score in each bin
Keep the best score in each of 4 bins, then the top 2 of those. Two high scores sit in the same bin. What happens?
Pick an answer above to see the rest