Skip to content

Maybe lower default temp and switch to top_k 40 #42

Closed

Description

@bakkot

Per this twitter thread. See commit here.

Activity

  1. G2G2G2G commented on Mar 12, 2023

    @G2G2G2G

    --top_k N top-k sampling (default: 40)

  2. Piezoid commented on Mar 12, 2023

    @Piezoid
    Contributor

    AFAIK, there is no top k filtering in the current version. The main code uses the llama_sample_top_p, and not gpt_sample_top_k_top_p which is the only piece of code that actually uses the top_k parameter.

    The repetition penalty could maybe be ported to this sampler and used instead?

    I've seen multiple people reporting that FB's default sampler is not adequate for comparing LLaMA's outputs with davinci's. Thus, enabling top k filtering could allow people to experiment with and compare different sampling strategies.

  3. sswam commented on Mar 12, 2023

    @sswam

    It does seem to work much better with these options, based on shawwn's patch:
    --temp 0.7 --top_k 40 --top_p 0 --repeat_last_n 256 --repeat_penalty 1.1764705882352942

    I'm not sure what value is ideal for repeat_last_n, but with a little testing, 256 seems to be enough, while 128 wasn't.

  4. Piezoid commented on Mar 12, 2023

    @Piezoid
    Contributor

    --temp 0.7 --top_k 40 --top_p 0 --repeat_last_n 256 --repeat_penalty 1.1764705882352942

    llama.cpp with --top_p 0 is greedy inference, picking the highest probability token.

  5. beiller commented on Mar 12, 2023

    @beiller
    Contributor

    FYI Top K isn't used this PR tho should fix it:
    #56

  6. ggerganov commented on Mar 13, 2023

    @ggerganov
    Member

    Need a better strategy to determine default parameters.
    Single examples do not show anything of value

  7. added a commit that references this issue on Mar 21, 2023
  8. added a commit that references this issue on Oct 30, 2025
  9. added a commit that references this issue on Mar 16, 2026
  10. added a commit that references this issue on Apr 28, 2026
  11. 27 remaining items

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions