[GH-ISSUE #1517] How to set decode mode, e.g. greedy vs sampling? #47338

Open
opened 2026-04-28 03:36:10 -05:00 by GiteaMirror · 2 comments
Owner

Originally created by @shenghu on GitHub (Dec 14, 2023).
Original GitHub issue: https://github.com/ollama/ollama/issues/1517

llama.cpp seems to choose greedy decoding when temperature < 0. Is this behavior available in ollama?

Originally created by @shenghu on GitHub (Dec 14, 2023). Original GitHub issue: https://github.com/ollama/ollama/issues/1517 llama.cpp seems to choose greedy decoding when temperature < 0. Is this behavior available in ollama?
Author
Owner

@randomstuff commented on GitHub (Jan 3, 2025):

Shouldn't top_k = 1 be greedy decoding?

<!-- gh-comment-id:2569860248 --> @randomstuff commented on GitHub (Jan 3, 2025): Shouldn't `top_k = 1` be greedy decoding?
Author
Owner

@gerardsimons commented on GitHub (Jan 13, 2026):

@shenghu I am also curious about this, in my experience setting temperature to 0 does not make it completely deterministic, nor does setting top_k=1 though, which should in any case be equivalent theoretically.

<!-- gh-comment-id:3746929558 --> @gerardsimons commented on GitHub (Jan 13, 2026): @shenghu I am also curious about this, in my experience setting temperature to 0 does not make it completely deterministic, nor does setting top_k=1 though, which should in any case be equivalent theoretically.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#47338