Skip to content

New sampler: Min-P (makes sense?) #4152

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

Closed
4 tasks done
clort81 opened this issue Nov 21, 2023 · 3 comments
Closed
4 tasks done

New sampler: Min-P (makes sense?) #4152

clort81 opened this issue Nov 21, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@clort81
Copy link

clort81 commented Nov 21, 2023

Prerequisites

  • I am running the latest code. Development is very rapid so there are no tagged versions as of now.
  • I carefully followed the README.md.
  • I searched using keywords relevant to my issue to make sure that I am creating a new issue that is not already open (or closed).
  • I reviewed the Discussions, and have a new bug or useful enhancement to share.

Feature Description


min-p_sampler

"What Min P is doing is simple: we are setting a minimum value that a token must reach to be considered at all. The value changes depending on how confident the highest probability token is.

So if your Min P is set to 0.1, that means it will only allow for tokens that are at least 1/10th as probable as the best possible option. If it's set to 0.05, then it will allow tokens at least 1/20th as probable as the top token, and so on..."

Motivation

Better sampling?

@clort81 clort81 added the enhancement New feature or request label Nov 21, 2023
@KerfuffleV2
Copy link
Collaborator

llama.cpp already supports Min P.

  --min-p N             min-p sampling (default: 0.1, 0.0 = disabled)

(In fact, I think we got it before anything else.)

@kalomaze
Copy link
Contributor

kalomaze commented Nov 21, 2023

(In fact, I think we got it before anything else.)

Yup! This was a PR from me that got merged in:
#3841

In fact, you posted the same graph I used to pitch it lol.

@Green-Sky
Copy link
Collaborator

closing this as "done" :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants