AWS Certified AI PractitionerAI/ML and Generative AI FundamentalsHard

A team is developing a generative AI model to create realistic marketing campaign texts. The initial models produce grammatically correct but often repetitive and uninspired content. To improve the diversity and creativity of the generated text, which parameter adjustment is most likely to yield better results?

  1. AAdjusting the temperature parameter
  2. BIncreasing the learning rate
  3. CDecreasing the batch size
  4. DAdding more layers to the model
Show answer & explanation

Correct answer: A. Adjusting the temperature parameter

The 'temperature' parameter in generative models, especially Large Language Models (LLMs), controls the randomness of the model's output. A higher temperature makes the output more random, creative, and diverse, potentially introducing more novel ideas. A lower temperature makes the output more deterministic and focused, often leading to repetitive or common phrases. To combat repetitive and uninspired content, increasing the temperature would be the most direct approach.

Why the other options are wrong

  • B. Increasing the learning rate might make the model converge faster or diverge, but it doesn't directly control the creativity or diversity of text generation.
  • C. Decreasing the batch size affects training stability and speed but has no direct impact on the creativity or diversity of the generated text.
  • D. Adding more layers might increase model capacity but doesn't inherently make the output more diverse or less repetitive; it could even lead to overfitting if not handled carefully.

Temperature Parameter (Generative AI)

The temperature parameter in generative AI models, particularly LLMs, controls the randomness of the generated output. It influences the probability distribution of the next token, with higher values leading to more diverse and creative outputs, and lower values leading to more deterministic and focused outputs.

  • Controls the 'creativity' or 'randomness' of text generation.
  • Higher temperature = more diverse, less predictable output.
  • Lower temperature = more deterministic, focused, potentially repetitive output.
  • Applied during sampling from the model's output probability distribution.

Memory trick: Temperature heats up creativity, cools down repetition.

More AI/ML and Generative AI Fundamentals questions