A developer is using the Gemini API for text generation and finds that the outputs are too repetitive. Which parameter adjustment is most likely to increase output diversity?
Higher temperature increases randomness, reducing repetitiveness.
Why this answer
Increasing the temperature parameter from 0.7 to 1.2 increases the randomness of token selection by scaling the logits before applying the softmax function, which flattens the probability distribution. This makes lower-probability tokens more likely to be chosen, directly reducing repetitiveness in generated text. In the Gemini API, temperature values above 1.0 amplify diversity, while values below 1.0 make outputs more deterministic and repetitive.
Exam trap
Cisco often tests the misconception that increasing top-k or decreasing top-p increases diversity, when in fact both restrict the token pool and reduce randomness, while temperature is the direct parameter for controlling output variability.
How to eliminate wrong answers
Option A is wrong because increasing top-k from 20 to 50 actually expands the pool of candidate tokens from the 20 most likely to the 50 most likely, which can increase diversity but is less effective than temperature for reducing repetition, and may introduce irrelevant tokens without addressing the core probability distribution. Option C is wrong because decreasing temperature from 0.7 to 0.2 sharpens the probability distribution, making the model more deterministic and likely to repeat high-probability tokens, thus worsening repetitiveness. Option D is wrong because decreasing top-p from 0.9 to 0.5 narrows the cumulative probability threshold, restricting token selection to a smaller, higher-probability set, which reduces diversity and increases repetitiveness.