Courseiva
Prompt Engineering →mediumMultiple Choice

NCP-GENL Prompt Engineering Practice Question

A financial analyst is using an NVIDIA NIM-hosted Llama 3.1 70B model to extract key financial metrics from quarterly earnings call transcripts. The model inconsistently returns a prose summary instead of the required structured JSON. The analyst needs the output to be reliably parseable by a downstream script that expects a fixed schema with fields "revenue", "eps", and "guidance". Which prompt engineering technique is most appropriate to enforce this output format?

⚠ Common exam trap

The trap here is assuming that a generic instruction like 'return JSON' is sufficient without providing a schema or example, when models often need concrete demonstrations to reliably adhere to complex structured formats.

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

✓

Provide a JSON schema and a completed example in the prompt, and instruct the model to return only JSON matching that schema.

Enforcing a structured output like JSON requires explicit specification of the schema and often a concrete example. Providing a schema and a completed example leverages the model's in-context learning to mimic the exact format, while the instruction to return only JSON reduces extraneous text. Other techniques like temperature adjustment or chain-of-thought do not directly control output structure and may even worsen format compliance.

Answer analysis

Option-by-option breakdown

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

  • ✗

    Increase the temperature parameter to 0.9 so the model explores more diverse output formats and may eventually produce JSON.

    Why it's wrong here

    Raising temperature increases randomness, which makes the model less likely to follow a strict format consistently. It would produce more varied prose, not more reliable JSON. The goal is deterministic, schema-compliant output, so higher temperature directly works against the requirement. Temperature tuning is not a format-enforcement mechanism; it affects creativity and diversity, not structural compliance.

  • ✗

    Use a chain-of-thought prompt asking the model to 'think step by step' before answering, which will naturally lead to JSON output.

    Why it's wrong here

    Chain-of-thought prompting encourages the model to produce intermediate reasoning steps, which typically results in even more prose, not structured JSON. It improves reasoning accuracy for complex problems but does not enforce output format. In fact, without explicit formatting constraints, the model may include its reasoning in the final answer, making parsing harder. This technique addresses a different problem than format adherence.

  • ✓

    Provide a JSON schema and a completed example in the prompt, and instruct the model to return only JSON matching that schema.

    Why this is correct

    This is correct because providing an explicit schema plus a worked example gives the model a concrete template to imitate, which strongly biases generation toward valid JSON. The instruction to return only JSON reduces the chance of prose leakage. This combination of structured format specification and demonstration is the most reliable way to enforce a fixed output schema without relying on post-processing.

  • ✗

    Add a system prompt that says 'You are a helpful assistant' and rely on the model's instruction-following ability to infer the JSON requirement.

    Why it's wrong here

    A generic system prompt does not specify the required output format or schema. The model has no information about the fields revenue, eps, and guidance, so it cannot reliably produce them. While system prompts can set behavior, they must contain explicit formatting instructions to be effective. This approach leaves the output structure entirely to chance and will likely continue producing prose summaries.

About these practice questions

This NCP-GENL question is part of Courseiva's 352-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam 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.