NVIDIAPrompt Engineering

Chain-of-Thought & Output Control — NCP-GENL Practice Question

A representative NVIDIA-Certified Professional Generative AI LLMs (NCP-GENL) exam question on Chain-of-Thought & Output Control. Work through it below, then read why each option is right or wrong.

This question is part of the free NVIDIA-Certified Professional Generative AI LLMs practice test.

Short answer

The correct answer is B. Chain-of-thought reasoning to explain the recommendation logic, combined with constrained decoding to enforce JSON schema with required fields.

Chain-of-thought reasoning combined with constrained JSON decoding is the best approach. Chain-of-thought makes the recommendation logic transparent and improves quality. Constrained decoding enforces the exact schema (product ID, reason, confidence score) at generation time, guaranteeing valid, structured output. Few-shot with greedy decoding improves consistency but does not enforce structure. Zero-shot with post-processing is fragile. One-shot alone is insufficient for reliable recommendations.

The Question

Your e-commerce recommendation engine uses an LLM to generate personalized product recommendations with explanations. The output must include: (1) product ID, (2) reason for recommendation, and (3) confidence score (0.0–1.0). Outputs are currently unstructured and inconsistent. Which combination of techniques best ensures reliable, structured output?

AZero-shot prompting with a detailed instruction set and post-processing validation to extract fields
BChain-of-thought reasoning to explain the recommendation logic, combined with constrained decoding to enforce JSON schema with required fieldsCorrect
CFew-shot prompting with example recommendations and greedy decoding to minimize variation
DOne-shot prompting with a single high-quality example and temperature reduction to 0.0

Why B is correct

Chain-of-thought reasoning combined with constrained JSON decoding is the best approach. Chain-of-thought makes the recommendation logic transparent and improves quality. Constrained decoding enforces the exact schema (product ID, reason, confidence score) at generation time, guaranteeing valid, structured output. Few-shot with greedy decoding improves consistency but does not enforce structure. Zero-shot with post-processing is fragile. One-shot alone is insufficient for reliable recommendations.

Why the other options are wrong

Option A: Zero-shot prompting with a detailed instruction set and post-processing validation to extract fields

Option A does not satisfy the requirement in the scenario. Review the explanation above: the correct choice (B) is the only one that fully meets every constraint stated in the question.

Option C: Few-shot prompting with example recommendations and greedy decoding to minimize variation

Option C does not satisfy the requirement in the scenario. Review the explanation above: the correct choice (B) is the only one that fully meets every constraint stated in the question.

Option D: One-shot prompting with a single high-quality example and temperature reduction to 0.0

Option D does not satisfy the requirement in the scenario. Review the explanation above: the correct choice (B) is the only one that fully meets every constraint stated in the question.

Key idea: Chain-of-Thought & Output Control

Chain-of-thought reasoning combined with constrained JSON decoding is the best approach. Chain-of-thought makes the recommendation logic transparent and improves quality. Constrained decoding enforces the exact schema (product ID, reason, confidence score) at generation time, guaranteeing valid, structured output. Few-shot with greedy decoding improves consistency but does not enforce structure. Zero-shot with post-processing is fragile. One-shot alone is insufficient for reliable recommendations. On the NCP-GENL exam, questions in the "Prompt Engineering" domain test whether you can map a scenario's constraints to the right choice. Read the requirement carefully, eliminate options that violate any single constraint, and pick the one that satisfies all of them with the least operational overhead.

Ready to see how you'd score?

Take the free practice quiz and find out which NVIDIA-Certified Professional Generative AI LLMs domains you need to focus on. No signup required.

Practice 5 similar questions

Same cert, same or adjacent domain. Use these after reviewing the explanation.

Related NVIDIA-Certified Professional Generative AI LLMs Practice Questions

Official sources used

Verify program and exam details at the source before scheduling.