Courseiva

AI-102 Implement generative AI solutions Practice Question

You are using Azure OpenAI Service to generate product descriptions. The output is often too verbose. You need to reduce the length of generated text without changing the model. Which parameter should you adjust?

⚠ Common exam trap

Many candidates confuse parameters that affect output style (temperature, top-p, frequency penalty) with the one parameter that directly controls output length (max tokens), leading them to choose a parameter that changes how the model writes rather than how much it writes.

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

✓

Max tokens

Max tokens controls the total length of the generated response by capping the number of tokens (words/subwords) the model can output. Reducing this value directly truncates the output, making descriptions shorter without altering the model or its behavior. Other parameters influence randomness or repetition but do not enforce a strict length limit.

Answer analysis

Option-by-option breakdown

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

  • ✓

    Max tokens

    Why this is correct

    Max tokens caps the total tokens the model may generate, directly truncating verbose completions without altering the deployed model. Setting a lower value constrains output length, satisfying the requirement to shorten product descriptions while leaving the model itself unchanged.

  • ✗

    Frequency penalty

    Why it's wrong here

    Frequency penalty discourages repeated tokens by scaling their logits down, which curbs looping but not overall verbosity; a description can stay long using varied words. It suits reducing repetition, not length. The max_tokens parameter caps output length directly, which is what this scenario requires.

  • ✗

    Temperature

    Why it's wrong here

    Temperature rescales the probability distribution, changing randomness and creativity, not the number of tokens produced. A low value makes output more deterministic but still potentially verbose. It suits controlling variability. Limiting length requires max_tokens, which caps the generated token count directly.

  • ✗

    Top-p (nucleus sampling)

    Why it's wrong here

    Top-p restricts sampling to the smallest token set whose cumulative probability exceeds the threshold, altering word choice diversity rather than output length. It suits tuning creativity and randomness. Reducing verbosity requires max_tokens, which truncates generation at a set token count.

About these practice questions

This AI-102 question is part of Courseiva's 761-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam 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 AI-102 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-102 exam.