Courseiva

Best Practice for Prompt Engineering on Vertex AI: Consistent Formatting and Delimiters

Which of the following is a best practice when using Vertex AI for prompt engineering?

Quick Answer

The answer is using consistent formatting and delimiters, as this is a core best practice for prompt engineering on Vertex AI. This technique works because large language models rely on attention mechanisms to parse input; clear delimiters like triple backticks, XML tags, or section headers create distinct structural boundaries that reduce ambiguity and help the model reliably separate instructions from context or data. On the Google Cloud Generative AI Leader exam, this concept tests your understanding of how structured prompts improve output predictability and accuracy, often appearing as a straightforward correct choice among distractors like “use the longest possible prompt” or “avoid any special characters.” A common trap is assuming models prefer natural, unstructured language, but Vertex AI’s architecture actually benefits from explicit formatting to minimize hallucination and misinterpretation. Remember the mnemonic “DAD” for Delimiters, Alignment, and Distinction—consistent delimiters are the first step to keeping your prompt’s logic clean and your model’s response on track.

⚠ Common exam trap

Google Cloud often tests the misconception that 'more is better' in prompts or that deterministic settings like temperature=0 are universally optimal, leading candidates to overlook the importance of structured, concise formatting.

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

✓

Use consistent formatting and delimiters

Consistent formatting and delimiters (e.g., using triple backticks, XML tags, or clear section headers) help the model parse instructions and context reliably, reducing ambiguity and improving output quality. This is a core best practice in prompt engineering on Vertex AI because it leverages the model's attention mechanisms to focus on distinct prompt segments, leading to more predictable and accurate responses.

Answer analysis

Option-by-option breakdown

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

  • ✗

    Always set temperature to 0

    Why it's wrong here

    Temperature 0 makes outputs deterministic and repetitive, preventing the varied, creative responses prompt engineering often needs. It tempts because determinism aids reproducibility, and it would be correct for tasks requiring consistent, factual answers such as classification or extraction where variation is undesirable.

  • ✓

    Use consistent formatting and delimiters

    Why this is correct

    Consistent formatting and delimiters give the model an unambiguous structure, separating instructions from input data. This reduces parsing ambiguity and variance in outputs, satisfying the prompt engineering best practice of reproducible, predictable responses across repeated runs.

  • ✗

    Avoid using examples in the prompt

    Why it's wrong here

    Omitting examples removes few-shot guidance, degrading output quality and format adherence on complex tasks. It tempts because it shortens prompts and saves tokens, and it would be correct for simple, unambiguous requests where the model already understands the desired output without demonstration.

  • ✗

    Use very long prompts to include all possible instructions

    Why it's wrong here

    Excessively long prompts dilute key instructions, waste tokens and can exceed context limits, reducing response accuracy. It tempts because including every constraint feels thorough, and it would be correct when a task genuinely requires extensive context, such as summarising a long document with many rules.

About these practice questions

One of 1,008 original Generative AI Leader practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Same concept, more angles

1 more way this is tested on Generative AI Leader

These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.

Variation 1. Which TWO of the following are best practices for prompt engineering?

medium
  • ✓ A.Provide context and examples in the prompt
  • B.Append random noise to prompts to improve creativity
  • ✓ C.Use clear and specific instructions
  • D.Always use the maximum possible number of tokens
  • E.Use negative prompts to discourage undesired outputs

Why A: Option A is correct because supplying relevant context and few-shot examples in the prompt grounds the model, clarifies the expected format and intent, and measurably improves output relevance and accuracy. Option C is correct because clear, specific instructions reduce ambiguity, constrain the model's response space, and yield more predictable, on-target results. Together, these two practices are widely recommended in prompt engineering guidance for both large language models and generative AI services. Option B does not belong because adding random noise degrades coherence and reliability rather than improving genuine creativity. Option D does not belong because maximizing token count wastes context window and cost without improving quality; concise, purposeful prompts are preferred. Option E does not belong because negative prompts are a feature specific to certain image-generation tools and are not a general best practice for prompt engineering across LLMs.

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This Generative AI Leader practice question is part of Courseiva's free Google Cloud 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 Generative AI Leader exam.