Share via

How to implement 'Regenerate' button on ChatGPT 3.5 model?

Karuna Tiwari 100 Reputation points
2024-03-12T17:32:05.37+00:00

Hi,
We have created a BYOD Chatbot using ChatGPT 3.5 16K model. Now I want to add a button in frontend named 'Regenerate' which the user clicks when he/she is not happy with the response generated and wants to run the query again.

What code should be written in the backend to enable this feature?

Foundry Tools
Foundry Tools

Formerly known as Azure AI Services or Azure Cognitive Services is a unified collection of prebuilt AI capabilities within the Microsoft Foundry platform


Answer accepted by question author

  1. navba-MSFT 27,620 Reputation points Microsoft Employee Moderator
    2024-03-14T05:49:49.6333333+00:00

    @Karuna Tiwari Thanks for your question. Regarding the temperature parameter value ( default is 1 ). This parameter explains, what sampling temperature to use, between 0 and 2. Higher values mean the model takes more risks. Try 0.9 for more creative applications, and 0 (argmax sampling) for ones with a well-defined answer.

    More info ***here ***and here.

    To answer your question, Yes, you’re correct. If the temperature is set to 0, the model becomes completely deterministic and will generate the same response every time for a given input. This is because a temperature of 0 makes the model always choose the most likely next word when generating text.

    Please note, it’s important to note that even with a temperature of 0, there might be slight variations in the responses due to the inherent randomness in the model’s architecture. But these variations are usually minimal and the overall intent of the response remains the same.

    Recommendation:

    So, if you’re implementing a ‘Regenerate’ button and you want to see different responses, you might want to consider using a higher temperature value. This will introduce more randomness into the generated responses, giving you a wider variety of potential outputs for the same prompt. But remember, a higher temperature also means the responses might be less focused and coherent. It’s all about finding the right balance for your specific use case.

    Hope this answers.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.