Microsoft Certified: Azure AI Engineer AssociateImplement generative AI solutionsEasy
An AI engineer is developing a system that uses Azure OpenAI Service to generate creative short stories. They want the stories to have a high degree of variability and surprise in their narrative, encouraging the model to explore less common word choices and plot developments. Which parameter should the engineer adjust to achieve this objective?
- An
- Bfrequency_penalty
- Cpresence_penalty
- Dtemperature
Show answer & explanationAnswer & explanation
Correct answer: D. temperature
The `temperature` parameter directly controls the randomness of the model's output. A higher temperature value will make the output more varied, creative, and surprising by increasing the probability of less likely tokens, which is ideal for generating diverse short stories.
Why the other options are wrong
- A. N specifies the number of completions to generate, not the creativity of each completion.
- B. Frequency penalty reduces repetition, but doesn't primarily drive creativity or surprise.
- C. Presence penalty reduces the likelihood of any token appearing if it's already in the text, which is different from encouraging general creativity.
Temperature (Azure OpenAI)
A parameter that controls the randomness of the text generation in Azure OpenAI Service; higher values lead to more creative and varied output.
- Ranges from 0.0 to 2.0 (or similar, depending on model).
- Lower values (e.g., 0.2) make output more deterministic and focused.
- Higher values (e.g., 0.8) make output more random, creative, and surprising.
Memory trick: Turn up the heat for creative thoughts to flow.