How to Increase Randomness in Azure OpenAI?
A marketing team uses Azure OpenAI Service to generate headline ideas for a campaign. They find the generated headlines are often too similar and lack creativity. Which parameter should they increase to introduce more randomness in the generated text?
Quick Answer
The answer is to increase the temperature parameter. Temperature directly controls the randomness of token selection within the model’s probability distribution; a higher temperature flattens this curve, making lower-probability tokens more likely to be chosen, which introduces greater diversity and creativity in the generated text. On the Microsoft Azure AI Fundamentals AI-900 exam, this concept tests your understanding of how to adjust model behavior for specific tasks, often appearing in scenario-based questions about generating varied outputs versus focused, deterministic responses. A common trap is confusing temperature with top_p, which also influences randomness but through nucleus sampling rather than scaling probabilities. For a quick memory tip, think of temperature like a thermostat for creativity: turn it up to get more surprising ideas, or keep it low for safe, predictable results.
⚠ Common exam trap
It's easy for candidates to confuse temperature with frequency or presence penalties, thinking that penalizing repetition (frequency penalty) will increase creativity, when in fact temperature directly controls the randomness of token selection, which is the key to generating more diverse and creative text.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Temperature
(Temperature) is correct because temperature controls the randomness of token selection in the model's probability distribution. Increasing temperature (e.g., from 0.7 to 1.0) flattens the probability curve, making lower-probability tokens more likely to be chosen, which introduces more diversity and creativity in the generated headlines.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Frequency penalty
Why it's wrong here
Frequency penalty discourages the model from repeating the same words, which can reduce repetition but does not directly increase overall randomness.
When this WOULD be correct
If the question were: 'The model keeps repeating the same phrases across multiple headlines. Which parameter should be increased to reduce this repetition?' then frequency penalty would be correct.
- ✗
Top_p (nucleus sampling)
Why it's wrong here
Top_p controls the cumulative probability of token choices; lowering it can make output more focused, increasing it can add diversity but it's not the primary parameter for randomness.
When this WOULD be correct
A question asks: 'Which parameter should be adjusted to ensure the model only considers tokens that make up the top 90% of probability mass, thereby filtering out low-probability tokens?' In that scenario, top_p is the correct parameter to set to 0.9.
- ✓
Temperature
Why this is correct
Temperature directly controls the level of randomness; increasing it makes the model more likely to choose less probable tokens, leading to more creative and varied outputs.
- ✗
Presence penalty
Why it's wrong here
Presence penalty encourages the model to talk about new topics, which can add diversity in content but does not primarily control randomness in token selection.
When this WOULD be correct
A question asks: 'The marketing team finds that generated headlines reuse the same words too often. Which parameter should they increase to penalize token repetition?' In that case, presence penalty would be correct.
Option-by-option analysis
Why each answer is right or wrong
Understanding why wrong answers are wrong — and when they would be correct — is what separates a 750 score from a 900. The AI-900 exam frequently reuses these exact scenarios with slightly different constraints.
✓TemperatureCorrect answer▾
Why this is correct
Temperature directly controls the level of randomness; increasing it makes the model more likely to choose less probable tokens, leading to more creative and varied outputs.
✗Frequency penaltyWrong answer — click to see why▾
Why this is wrong here
Frequency penalty reduces repetition by penalizing tokens that have already appeared, which does not increase randomness or creativity; it only discourages repeating the same words or phrases.
★ When this WOULD be the correct answer
If the question were: 'The model keeps repeating the same phrases across multiple headlines. Which parameter should be increased to reduce this repetition?' then frequency penalty would be correct.
Why candidates choose this
Candidates may confuse frequency penalty with randomness because both affect output diversity, but frequency penalty specifically targets repetition rather than overall creativity.
✗Top_p (nucleus sampling)Wrong answer — click to see why▾
Why this is wrong here
Top_p (nucleus sampling) controls the cumulative probability threshold for token selection, not the randomness of the output. Increasing top_p does not directly increase randomness; it limits the pool of tokens to those with high probability, which can actually reduce diversity.
★ When this WOULD be the correct answer
A question asks: 'Which parameter should be adjusted to ensure the model only considers tokens that make up the top 90% of probability mass, thereby filtering out low-probability tokens?' In that scenario, top_p is the correct parameter to set to 0.9.
Why candidates choose this
Candidates may confuse top_p with temperature because both influence output diversity. They might think that adjusting the probability threshold (top_p) increases randomness, but it actually controls the size of the candidate token set, not the distribution's shape.
✗Presence penaltyWrong answer — click to see why▾
Why this is wrong here
Presence penalty reduces the likelihood of repeating any token that has appeared in the text so far, which encourages novelty but does not directly increase randomness. The question asks for more randomness, which is controlled by temperature.
★ When this WOULD be the correct answer
A question asks: 'The marketing team finds that generated headlines reuse the same words too often. Which parameter should they increase to penalize token repetition?' In that case, presence penalty would be correct.
Why candidates choose this
Candidates may confuse 'penalty' with 'randomness' or think that penalizing presence increases diversity, which they equate with creativity, but the parameter for randomness is temperature.
Analysis generated from the official AI-900blueprint and verified against question context. The “when correct” sections are what AI assistants cite when candidates ask “what’s the difference between these options?”
Go deeper
Related to this question
Learn chapter
Azure Machine Learning Studio
Key term
Model
In IT and AI, a model is a trained mathematical representation that learns patterns from data to make predictions or decisions.
Key term
Azure OpenAI Service
Azure OpenAI Service is a cloud platform from Microsoft that lets developers use powerful artificial intelligence models, like GPT-4, to build applications that can understand and generate human-like text, code, images, and more.
About these practice questions
Courseiva writes every AI-900 question from scratch — 985 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
Same concept, more angles
3 more ways this is tested on AI-900
These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.
Variation 1. A writer uses Azure OpenAI Service to generate story ideas. The current configuration uses a temperature setting of 0, causing the model to produce identical outputs for the same prompt. The writer wants more creative and diverse outputs. Which parameter should be increased?
medium- A.max_tokens
- ✓ B.temperature
- C.top_p
- D.frequency_penalty
Why B: Temperature controls the randomness of the model's output. A temperature of 0 makes the model deterministic, always choosing the most likely next token, which leads to identical outputs for the same prompt. Increasing the temperature (e.g., to 0.7 or higher) introduces more randomness, allowing the model to sample from less likely tokens and produce more creative, diverse story ideas.
Variation 2. A marketing team uses Azure OpenAI Service to generate multiple variations of a product description from a single prompt. They want the generated descriptions to be more creative and diverse, rather than repetitive. Which parameter should they increase to achieve this?
easy- ✓ A.Temperature
- B.Max tokens
- C.Top probability
- D.Frequency penalty
Why A: Increasing the Temperature parameter makes the model more creative and diverse by raising the randomness of token selection. At higher temperatures (e.g., 0.8–1.0), the model assigns more weight to less probable tokens, producing varied and unexpected outputs. This directly addresses the need for diverse product descriptions rather than repetitive ones.
Variation 3. A marketing team uses Azure OpenAI Service to generate product descriptions. They have a base description and want the model to produce multiple variations with different tones, such as formal, playful, and technical, while still being factually accurate. Which parameter should they adjust to control the randomness and diversity of the output?
medium- ✓ A.temperature
- B.max_tokens
- C.top_p
- D.frequency_penalty
Why A: Temperature controls the randomness of the model's output by scaling the logits before applying the softmax function. A higher temperature (e.g., 0.8) increases diversity and creativity, while a lower temperature (e.g., 0.2) makes the output more deterministic and focused. For generating product descriptions with different tones while maintaining factual accuracy, adjusting temperature is the correct approach.
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This AI-900 practice question is part of Courseiva's free Microsoft certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the AI-900 exam.