CCAR-F Prompt Engineering and Structured Output Practice Question
A data scientist is adjusting generation parameters for a creative writing application. They want to ensure a wide variety of vocabulary while preventing the model from selecting highly improbable words. Which TWO parameters should be adjusted?
⚠ Common exam trap
Candidates often confuse Temperature and Top-P with frequency or presence penalties, which are not standard controls for balancing creativity and coherence in the context of Anthropic API parameters.
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
✓
Temperature.
Temperature and Top-P are the primary controls for balancing creativity and coherence. Temperature scales the logits to influence the probability distribution, while Top-P (nucleus sampling) cuts off the 'long tail' of low-probability tokens, ensuring that the model remains creative without drifting into nonsensical or irrelevant word choices.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
Temperature.
Why this is correct
Temperature controls the 'randomness' of the output by scaling the probability distribution of the next token. A higher temperature increases variety by making less likely tokens more probable, which is essential for creative writing, although it must be balanced to maintain the logical flow of the narrative.
- ✗
Max Tokens.
Why it's wrong here
Max tokens only limits the total length of the generated response and has no impact on the variety of vocabulary or the probability of specific words being chosen. It is a resource management parameter rather than a tool for influencing the model's creativity or linguistic coherence.
- ✓
Top-P (Nucleus Sampling).
Why this is correct
Top-P restricts the model to the smallest set of tokens whose cumulative probability exceeds a certain threshold. By adjusting this, the data scientist can ensure the model only considers reasonably likely words, preventing the 'hallucination' of nonsensical vocabulary that sometimes occurs with high temperature alone.
- ✗
Stop Sequences.
Why it's wrong here
Stop sequences are used to end the generation when a specific string is reached and do not affect the internal probability of token selection during the generation process. They are useful for controlling output structure but do not contribute to the diversity or probability of vocabulary.
- ✗
Presence Penalty.
Why it's wrong here
Presence penalty is used to discourage the model from repeating tokens that have already appeared in the text. While it can influence variety, it is not the primary mechanism for managing the probability of 'nonsense' words versus 'creative' words compared to the fundamental controls of Temperature and Top-P.
About these practice questions
Courseiva writes every CCAR-F question from scratch — 271 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 and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official Anthropic exam blueprint
This CCAR-F practice question is part of Courseiva's free Anthropic 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 CCAR-F exam.