1Z0-1127-25 Fundamentals of Large Language Models Practice Question
A data scientist is designing a prompt to extract structured information (e.g., JSON) from text using an instruct model on OCI Generative AI. The model sometimes outputs additional text beyond the JSON, breaking parsing. Which prompt engineering technique is most effective to enforce structured output?
⚠ Common exam trap
Oracle often tests the misconception that lowering temperature or increasing tokens can enforce output format, when in reality only explicit formatting examples (few-shot) reliably constrain the model's output structure.
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
✓
Include a few-shot example of the expected JSON output in the prompt.
Few-shot prompting provides explicit examples of the desired output format, which instructs the model to follow the exact JSON structure and reduces the likelihood of extraneous text. This technique leverages the model's in-context learning ability to adhere to formatting constraints, making it the most effective for enforcing structured output in OCI Generative AI instruct models.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Use a base model instead of an instruct model.
Why it's wrong here
Base models are less likely to follow format instructions reliably.
- ✗
Set the temperature to 0.0 to reduce randomness.
Why it's wrong here
Lower temperature reduces creativity but does not guarantee strict formatting; model may still deviate.
- ✓
Include a few-shot example of the expected JSON output in the prompt.
Why this is correct
Few-shot examples teach the model to output precisely in the desired format.
- ✗
Increase max_tokens to allow for additional output.
Why it's wrong here
More tokens could result in more unwanted text, not less.
Go deeper
Related to this question
About these practice questions
Courseiva writes every 1Z0-1127-25 question from scratch — 768 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 →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This 1Z0-1127-25 practice question is part of Courseiva's free Oracle 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 1Z0-1127-25 exam.