Courseiva
easyMultiple Select

Generative AI Leader Practice Question: A developer is using the Gemini API to generate…

A developer is using the Gemini API to generate text summaries. They want to control the creativity and diversity of the output. Which THREE parameters can they adjust?

⚠ Common exam trap

Often, the distinction between parameters that affect input processing (context window, embedding dimension) versus those that control output generation (temperature, top-k, top-p) is tested, leading candidates to mistakenly select context window as a creativity parameter.

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

✓

Top-p

Temperature (E) is correct because it scales the logits before sampling, so lower values make the output more deterministic and higher values increase randomness and creativity. Top-p (B), or nucleus sampling, is correct because it restricts sampling to the smallest set of tokens whose cumulative probability exceeds p, directly controlling diversity. Top-k (D) is correct because it limits sampling to the k most likely tokens, which also tunes creativity and variety. Context window (A) only defines the maximum number of tokens the model can consider, and embedding dimension (C) is a fixed property of the embedding model, so neither controls generation creativity.

Answer analysis

Option-by-option breakdown

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

  • ✗

    Context window

    Why it's wrong here

    Context window defines how many tokens the model can accept as input, not the randomness or diversity of generated output. It is tempting because it is a configurable generation setting, and would be correct when handling longer input documents that must fit within the model's token limit.

  • ✓

    Top-p

    Why this is correct

    Top-p (nucleus sampling) restricts token selection to the smallest cumulative-probability set, directly controlling output diversity. Adjusting it satisfies the requirement to tune creativity, since lower values yield focused summaries and higher values broaden word choice.

  • ✗

    Embedding dimension

    Why it's wrong here

    Embedding dimension sets the size of the vector representation used for semantic search and similarity, and has no effect on generated text creativity. It is tempting because it is a tunable model parameter, and would be correct when configuring embeddings for retrieval or clustering rather than controlling summarisation output diversity.

  • ✓

    Top-k

    Why this is correct

    Top-k restricts sampling to the k most probable tokens at each step, discarding the rest before selection. Lowering k narrows output to high-probability continuations, reducing diversity; raising it admits more candidates, increasing variety. This directly satisfies the stem's requirement to control creativity and diversity of generated summaries.

  • ✓

    Temperature

    Why this is correct

    Temperature scales the randomness of token sampling, so lower values yield focused, deterministic summaries while higher values increase creativity and diversity. It is one of the three Gemini API generation parameters, alongside top-P and top-K, that directly govern output variability.

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.