-
Notifications
You must be signed in to change notification settings - Fork 591
Add Top H Sampler #1853
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Top H Sampler #1853
Conversation
|
Can't find any more redundancies or more ways to optimize it. Done about as best I could with my skill level. |
|
Set back to draft to test some cleaned up AI generated optimizations. Edit: No problems during testing. Sampler should be good to go now. |
|
tbh this looks kind of dubious and i'm very skeptical of the claims it's making. functionally I don't think it offers any benefit over min_p. Considering that there is basically zero adoption or notice of this "sampler", their github is dead and has 0 activity and 8 stars, and the math looks dodgy, I think I will hold off on it until it get some critical consideration. I don't want to add clutter. |
Top H's official github.
Top H's paper.
Github README Excerpt:
Top-H Decoding:
Top-H is a training-free decoding method that balances creativity and coherence in open-ended text generation by constraining entropy at each step. It solves an entropy-constrained mass maximization problem with an efficient greedy procedure, yielding robust, high-temperature generations that remain coherent.
Overview:
Classic truncated sampling (temperature, top-k, top-p, min-p) trades off diversity vs. coherence but often ignores the shape of the next-token distribution. Top-H makes this trade-off explicit by upper-bounding the entropy of the truncated distribution relative to the original model distribution — exploring more when the model is unsure, and tightening when it is confident.
At a glance:
Key Features
📊 Results Summary
Example (from paper)