TechNuggets Academy

Prompt Engineering

Free IBM Certified watsonx Generative AI Engineer - Associate practice — 6 questions on Prompt Engineering, with explanations. No sign-up. Full 12-question mixed test →

Question 1 of 6 · Prompt Engineering
A team is generating marketing copy with a watsonx.ai foundation model in Prompt Lab. Outputs must be reproducible for compliance review, but the model keeps repeating the same phrases within a single response. Which configuration BEST solves this?
Greedy decoding always selects the highest-probability token, giving reproducible output, while a repetition penalty above 1.0 explicitly down-weights tokens the model has already generated, reducing phrase repetition without introducing randomness.
Question 2 of 6 · Prompt Engineering
An engineer is prototyping a few-shot classification prompt and needs to quickly edit the instruction, add or remove multiple labeled examples, and test different inputs without rewriting the entire prompt text each time. Which Prompt Lab mode should they use?
Structured mode separates the prompt into distinct instruction, examples, and input fields, letting users edit or add few-shot examples independently and swap the test input without disturbing the rest of the prompt.
Question 3 of 6 · Prompt Engineering
A few-shot prompt uses the format 'Q: <question>\nA: <answer>' repeated for several examples, followed by a new question. During testing, after answering the new question, the model keeps generating additional fabricated Q&A pairs. Which single change BEST stops this behavior?
A stop sequence tells the model to halt generation as soon as it produces that exact string; setting it to '\nQ:' stops output right before the model would begin fabricating another question, cleanly ending the response after the real answer.
Question 4 of 6 · Prompt Engineering
A company has 400 labeled examples for a specific internal document classification task. Manual prompt engineering with few-shot examples gives inconsistent accuracy across similar inputs, and the team wants better, repeatable task performance without modifying the base model's weights. Which approach BEST fits this requirement?
Prompt tuning trains a lightweight, tunable soft prompt vector using labeled examples while keeping the base model frozen, which typically yields more consistent task performance than manual prompting when a moderate labeled dataset is available.
Question 5 of 6 · Prompt Engineering
A creative-writing use case needs varied, natural-sounding output but must avoid the model occasionally producing bizarre or incoherent tokens. Which decoding parameter combination BEST balances these two goals?
A moderate temperature of 0.7 preserves diverse, natural phrasing, while nucleus sampling at top P 0.9 restricts token selection to the most probable cumulative mass, filtering out the low-probability tail that causes bizarre or incoherent tokens.
Question 6 of 6 · Prompt Engineering
When prompted directly with a multi-step arithmetic word problem, a foundation model frequently returns an incorrect final numeric answer with no visible reasoning. Which single prompt modification is MOST likely to improve accuracy on this type of task?
Appending a zero-shot chain-of-thought cue like 'Let's think step by step' prompts the model to generate intermediate reasoning before the final answer, which measurably improves accuracy on multi-step arithmetic and logic tasks.
Ready for the real thing?

The full course has two full-length practice tests, video lessons for every exam domain, hands-on labs and detailed answer explanations.

Start my full course on Udemy →