How to control response diversity with top_p
How to control response diversity with top_p
How to control response diversity with top_p
The top_p parameter controls how much of the probability space the model uses when selecting the next word — this is called nucleus sampling.
Range: 0 to 1
Default: 1.0
top_p → model chooses from a smaller set of highly likely words → more focusedtop_p → model chooses from a broader set of words → more diverseFirst, install the SDK:
Then use the following Python code: