1Z0-1127-25 Prompt Engineering Practice Question
A data scientist is designing a prompt for code generation and needs to reduce the likelihood of the model generating incorrect or hallucinated code. Which two parameter adjustments are most effective? (Choose two.)
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
✓
Set frequency_penalty to a moderate value (e.g., 0.5)
Lowering temperature reduces randomness, making outputs more deterministic and less prone to hallucinations. Frequency penalty reduces repetitive mistakes. Top-k and presence penalty are less directly effective.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Set top-k to a high value (e.g., 100)
Why it's wrong here
High top-k includes more tokens, increasing randomness.
- ✓
Set frequency_penalty to a moderate value (e.g., 0.5)
Why this is correct
Frequency penalty discourages repetition of tokens, which can reduce hallucinated patterns.
- ✗
Increase max_tokens significantly
Why it's wrong here
Increasing max_tokens allows longer outputs but does not reduce hallucinations.
- ✗
Set presence_penalty to 0
Why it's wrong here
Presence penalty at 0 has no effect on reducing hallucinations.
- ✓
Set temperature to a low value (e.g., 0.1)
Why this is correct
Lower temperature makes output more focused and deterministic, reducing hallucinations.
Go deeper
Related to this question
About these practice questions
This 1Z0-1127-25 question is part of Courseiva's 768-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 →
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.