AWS Certified AI PractitionerAI/ML and Generative AI FundamentalsHard

A machine learning engineer is developing a generative AI model to create new musical compositions. They want to control the level of randomness or creativity in the generated music. Specifically, they want to be able to make the model produce either highly predictable, structured compositions or more experimental, surprising pieces. Which parameter is typically adjusted in generative models to achieve this control over output randomness?

  1. ATemperature
  2. BEpochs
  3. CLearning Rate
  4. DBatch Size
Show answer & explanation

Correct answer: A. Temperature

Temperature is a crucial parameter in many generative AI models (especially those based on neural networks like LLMs or music generators) that controls the randomness of the output. A high temperature value increases randomness and diversity, leading to more experimental outputs, while a low temperature value makes the output more deterministic, predictable, and closer to the most probable sequences. Learning rate, batch size, and epochs are training parameters, not generation parameters.

Why the other options are wrong

  • B. Epochs represent the number of times the entire training dataset is passed forward and backward through the neural network, a training parameter.
  • C. Learning Rate controls how much the model adjusts its weights during training, not the randomness of generation.
  • D. Batch Size is the number of training examples processed before the model's parameters are updated, a training parameter.

Temperature Parameter (Generative AI)

A hyperparameter used during the inference phase of generative AI models (especially language models) to control the randomness or 'creativity' of the generated output by scaling the logits before the softmax function.

  • Higher temperature (e.g., >1.0) increases randomness, leading to more diverse/surprising outputs.
  • Lower temperature (e.g., <1.0) makes outputs more deterministic and predictable, often closer to the training data distribution.
  • A temperature of 0 makes the model greedy, always picking the most probable token.

Memory trick: Turn up the temperature for more creative tunes.

More AI/ML and Generative AI Fundamentals questions