An application parses LLM replies with code and breaks when the model adds chatty text. Which prompt technique helps most?
- Exam domain
- Model Customization and Fine-Tuning Concepts14% of the exam
- Difficulty
- Easy
- In this mock
- 7 questions on this domainPractise this domain
Why the exam asks this
Model Customization and Fine-Tuning Concepts (14% of the exam)
Objective in the exam guide: Prompt engineering and optimization: system prompts, zero-shot and few-shot prompting, chain-of-thought prompting, structured output, and prompt optimization.
Prompt techniques are listed in full.
Why A is the answer
Ask for structured output against a JSON schema
Structured output, with a schema or JSON mode where the platform supports it, makes the reply machine-readable.
Remember: Use structured output for machine-read replies.
How it works
Prompt engineering uses system prompts, zero-shot and few-shot examples, chain-of-thought and structured output.
In detail
- Specify a schema.
- Validate before use.
Every option, checked
Knowing why each wrong option fails is how you rule it out on exam day.
A. Ask for structured output against a JSON schemaRight
Use structured output for machine-read replies.
B. Add "please" to the prompt and repeat the request in capital letters at the endWrongMost tempting
Politeness and emphasis do not enforce format.
Why it tempts: Emphasis sometimes works in casual use.
C. Use a higher temperatureWrong
Higher temperature adds variation.
D. Remove the system promptWrong
The system prompt is where format rules live.
Use case
An illustrative scenario, not a real incident.
Illustrative: switching to a JSON schema removes all parsing errors in the invoice extractor.
See it in different ways
flowchart LR S0["Define schema"] --> S1["Request structured output"] --> S2["Validate"] --> S3["Retry on failure"]
How to read this chart
- Read it in order: Define schema, then Request structured output, then Validate, then Retry on failure.
mindmap
root(("Prompting"))
n1["Zero-shot"]
n2["Instructions only"]
n3["Few-shot"]
n4["Examples"]
n5["Chain-of-thought"]
n6["Reasoning steps"]
n7["Structured output"]
n8["JSON schema"]How to read this chart
- The centre is "Prompting".
- "Zero-shot" covers "Instructions only".
- "Few-shot" covers "Examples".
- "Chain-of-thought" covers "Reasoning steps".
- "Structured output" covers "JSON schema".
Related questions
Learn more
- Our lesson: Customization, fine-tuning and RAG
- Practise Model Customization and Fine-Tuning Concepts questions in the mock exam
- Source: NVIDIA certification page
- LoRA: Low-Rank Adaptation of Large Language Models (arXiv)
- QLoRA: Efficient Finetuning of Quantized LLMs (arXiv)
- Direct Preference Optimization (arXiv)
- What Is Retrieval-Augmented Generation (NVIDIA Blog)