Courseiva
easyMultiple Choice

Generative AI Leader Practice Question: Which parameter controls the randomness of a…

Which parameter controls the randomness of a language model's output?

⚠ Common exam trap

Google often tests the distinction between sampling parameters (temperature, top-k, top-p) and architectural parameters (embedding dimension, context window), so candidates may confuse top-k as a randomness control when it actually restricts the candidate pool rather than adjusting the probability distribution's entropy.

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 the parameter that directly controls the randomness of a language model's output by scaling the logits before applying the softmax function. A higher temperature (e.g., >1.0) makes the probability distribution more uniform, increasing randomness, while a lower temperature (e.g., <1.0) sharpens the distribution, making the model more deterministic and focused on high-probability tokens.

Answer analysis

Option-by-option breakdown

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

  • ✗

    Embedding dimension

    Why it's wrong here

    Embedding dimension is the size of the vector representation for tokens or documents, fixed at training time, and does not govern sampling randomness. It is tempting because it is a fundamental model parameter, and would be correct when selecting an embedding model for semantic search or retrieval quality.

  • ✗

    Context window

    Why it's wrong here

    The context window defines how many tokens the model can attend to, not the randomness of sampling. It is tempting because it is a core model parameter affecting output, and would be the correct choice when the requirement is handling longer inputs or retaining more conversation history within a prompt.

  • ✗

    Top-k

    Why it's wrong here

    Top-k truncates sampling to the k most probable tokens, limiting the candidate pool but not directly controlling randomness; temperature scales the probability distribution. It is tempting because it is a sampling parameter that shapes output variety, and would be correct when restricting generation to likely tokens to reduce nonsensical output.

  • ✓

    Temperature

    Why this is correct

    Temperature scales the sampling distribution's entropy: low values sharpen it toward greedy decoding, high values flatten it, increasing diversity. It is the sole parameter governing stochastic token selection, directly controlling output randomness as the stem asks.

About these practice questions

Courseiva writes every Generative AI Leader question from scratch — 1,008 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 →

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.