0
0
Prompt Engineering / GenAIml~20 mins

Prompt templates in Prompt Engineering / GenAI - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Prompt Template Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Understanding the purpose of prompt templates

What is the main benefit of using prompt templates in generative AI models?

AThey reduce the model's computational complexity.
BThey help standardize inputs to improve model consistency.
CThey increase the size of the training dataset automatically.
DThey guarantee 100% accurate outputs from the model.
Attempts:
2 left
💡 Hint

Think about how prompt templates affect the way you ask questions to the model.

Predict Output
intermediate
2:00remaining
Output of a prompt template with variable substitution

Given the prompt template 'Translate the following sentence to French: {sentence}' and the input sentence = 'Good morning', what is the final prompt sent to the model?

Prompt Engineering / GenAI
template = 'Translate the following sentence to French: {sentence}'
sentence = 'Good morning'
final_prompt = template.format(sentence=sentence)
print(final_prompt)
ATranslate the following sentence to French: sentence
BTranslate the following sentence to French: {sentence}
CTranslate the following sentence to French: Good morning
DTranslate the following sentence to French: Good morning.
Attempts:
2 left
💡 Hint

Look at how the format method replaces placeholders.

Model Choice
advanced
2:00remaining
Choosing a model for prompt template testing

You want to test a prompt template that generates short creative stories. Which type of generative AI model is best suited for this task?

AA large language model trained on diverse text data.
BA convolutional neural network trained on images.
CA reinforcement learning model for game playing.
DA clustering algorithm for grouping data points.
Attempts:
2 left
💡 Hint

Consider which model type understands and generates text.

Hyperparameter
advanced
2:00remaining
Effect of temperature on prompt template outputs

When using a prompt template with a generative AI model, how does increasing the temperature parameter affect the output?

AIt makes the output more deterministic and repetitive.
BIt increases the speed of the model's response.
CIt reduces the length of the generated output.
DIt makes the output more random and creative.
Attempts:
2 left
💡 Hint

Think about how temperature controls randomness in text generation.

Metrics
expert
3:00remaining
Evaluating prompt template effectiveness

You have two prompt templates for the same task. Template A yields 85% accuracy and Template B yields 90% accuracy on a test set. However, Template A produces more diverse outputs. Which metric should you consider to decide the better template for a creative writing AI?

AUse a diversity metric alongside accuracy to balance creativity and correctness.
BChoose the template with the highest accuracy only.
CIgnore accuracy and choose the template with the longest outputs.
DSelect the template that runs faster regardless of output quality.
Attempts:
2 left
💡 Hint

Think about what matters most for creative writing: correctness or creativity?