Courseiva
easyMultiple Choice

Generative AI Leader Practice Question: The primary purpose of the temperature parameter…

What is the primary purpose of the temperature parameter when generating text with an LLM?

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

✓

It controls the randomness or creativity of the output

Temperature controls the randomness of token selection. Higher temperature increases creativity, lower temperature makes outputs more deterministic.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    It sets the maximum number of tokens in the response

    Why it's wrong here

    That limit is set by max_tokens (or max output tokens), a hard generation cap. Temperature instead rescales logits before softmax, altering how randomly the next token is sampled. Confusing the two is easy since both shape the response, but only one bounds its length.

  • ✓

    It controls the randomness or creativity of the output

    Why this is correct

    Temperature scales the probability distribution over the model's next-token predictions before sampling. A low value sharpens the distribution, favouring high-probability tokens for deterministic, factual output; a high value flattens it, giving unlikely tokens more chance and producing varied, creative text. This directly governs the randomness the question asks about.

  • ✗

    It determines the number of most likely tokens considered at each step

    Why it's wrong here

    Top-k sampling, not temperature, caps how many candidate tokens are retained per step. Temperature rescales the logits before softmax, flattening or sharpening the probability distribution to control randomness. It is tempting because both parameters tune output diversity, but temperature never restricts the candidate set itself.

  • ✗

    It sets the cumulative probability threshold for token selection

    Why it's wrong here

    Temperature rescales the logits before the softmax, altering the shape of the probability distribution; it does not set a cumulative probability cutoff. That cutoff describes top-p (nucleus) sampling, which truncates the token set, making this option tempting when the two sampling controls are confused.

About these practice questions

One of 1,008 original Generative AI Leader practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This Generative AI Leader practice question is part of Courseiva's free Google Cloud 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 Generative AI Leader exam.