This repository was archived by the owner on Jul 22, 2025. It is now read-only.
Replies: 1 comment
-
Hi, you're misunderstanding the meaning of Top K, it doesn't have anything to do with returning multiple choices. See https://www.perplexity.ai/search/how-is-top-k-filtering-differe-W32IKed7SpWojTugdrrx0g |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Issue Description
The Perplexity AI API is not returning multiple responses when the top_k parameter is set to a value greater than 1 and the top_p parameter is close to 1. This behavior is inconsistent with the expected functionality of these parameters.
Steps to Reproduce
Example python Code
Expected Behavior
When top_k is set to a value greater than 1, the API should return multiple choices in the response, representing different possible completions.
Actual Behavior
The API consistently returns only a single choice in the response, regardless of the top_k value. The response structure looks like this:
json
Additional Information
This behavior has been observed across all available models.
The top_p parameter was not explicitly set in the request, but it's assumed to be close to 1 by default.
Questions
Impact
This issue impacts applications that rely on generating multiple alternative responses from the Perplexity AI API, limiting the diversity of outputs and potentially affecting the quality of downstream tasks that depend on varied AI-generated content.
Beta Was this translation helpful? Give feedback.
All reactions