Loading...
const res = await llm.generate({
prompt,
top_p: 40,
temperature: 1.5,
});const res = await llm.generate({
prompt,
top_p: 0.9,
});Top-p is a probability between 0 and 1, and only one sampling setting is tuned while temperature stays at its default.
Top-k keeps a fixed number of the most likely tokens. Top-p keeps the smallest set whose probabilities add up to 'p', so the set size changes for each token.
Most apps keep the default. Lower values such as '0.5' make output more focused; values near '1' allow more variety.
Yes. A value of '1' keeps all tokens, so it does not filter anything.