Courseiva
Prompt Engineering →easyMultiple Choice

NCP-GENL Prompt Engineering Practice Question

An engineer is building a customer support assistant using an NVIDIA NIM for a Llama 3 70B model. The assistant must always respond in valid JSON containing exactly the keys "issue" and "urgency", and must never include any other text. Which prompt engineering approach most directly enforces this output contract?

⚠ Common exam trap

The trap here is assuming that sampling parameters such as temperature or top_p can enforce an output format, when they only affect randomness and token selection.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

✓

Add a system message that specifies the JSON schema and instructs the model to output only JSON, then validate responses programmatically.

The most direct way to enforce a strict JSON contract is to state the schema and the output-only requirement in the system message, which has the highest priority in the prompt hierarchy, and then validate the result programmatically. Sampling parameters and stylistic instructions do not constrain structure, so they cannot guarantee the two required keys or the absence of extra text.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    Raise the temperature to 1.0 so the model explores more possible response formats and eventually produces valid JSON.

    Why it's wrong here

    Higher temperature increases randomness, which makes the model more likely to deviate from a strict format, not less. It does not communicate the required schema at all. In a support assistant that must emit exactly two keys, this approach would increase malformed outputs and make downstream parsing fail more often.

  • ✗

    Append the phrase "Please be concise" to every user message and rely on the model to infer the JSON structure.

    Why it's wrong here

    Conciseness is unrelated to structural output constraints. The model has no way to infer that exactly two keys named "issue" and "urgency" are required. This leaves the response format entirely unconstrained, so the assistant would produce prose or arbitrary JSON, breaking the downstream parser that expects a fixed schema.

  • ✗

    Set the top_p value to 0.1 and the max_tokens parameter to 50 to force the model into a JSON-only response mode.

    Why it's wrong here

    top_p and max_tokens control sampling breadth and response length, not output structure. A low top_p narrows word choice, and a small max_tokens can truncate output, which may actually produce invalid JSON. Neither parameter communicates the required keys or the instruction to avoid extra text, so the format remains unreliable.

  • ✓

    Add a system message that specifies the JSON schema and instructs the model to output only JSON, then validate responses programmatically.

    Why this is correct

    A system message defining the exact schema and the instruction to emit only JSON constrains the model's behavior at the highest-priority level of the prompt. Because the model sees this before the user turn, it shapes every completion. Programmatic validation then catches any residual drift, making this the most direct and reliable enforcement for a strict output contract.

About these practice questions

Courseiva writes every NCP-GENL question from scratch — 352 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written and reviewed by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

Last reviewed September 2026 · checked against the official NVIDIA exam blueprint

This NCP-GENL practice question is part of Courseiva's free NVIDIA certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the NCP-GENL exam.