nerdexam
Databricks

GENERATIVE-AI-ENGINEER-ASSOCIATE · Question #94

Which of the following is the most effective way to design a prompt that elicits a specific format in the response?

The correct answer is A. Provide clear examples of the desired format. Providing concrete examples of the desired output format (few-shot prompting) is the most reliable technique for constraining an LLM's response structure.

Prompt Engineering Fundamentals

Question

Which of the following is the most effective way to design a prompt that elicits a specific format in the response?

Options

  • AProvide clear examples of the desired format
  • BUse short and ambiguous instructions
  • CAvoid specifying any format in the prompt
  • DUse multiple tasks in a single prompt

How the community answered

(36 responses)
  • A
    92% (33)
  • C
    6% (2)
  • D
    3% (1)

Why each option

Providing concrete examples of the desired output format (few-shot prompting) is the most reliable technique for constraining an LLM's response structure.

AProvide clear examples of the desired formatCorrect

Including explicit examples of the expected format in the prompt leverages few-shot learning - the model infers the pattern from demonstrations and replicates the structure, which is consistently more effective than abstract format instructions alone.

BUse short and ambiguous instructions

Short and ambiguous instructions give the model insufficient signal about the desired format, resulting in inconsistent or unexpected output structures.

CAvoid specifying any format in the prompt

Omitting format specification entirely leaves output structure undefined, forcing the model to choose its own format which will vary across requests.

DUse multiple tasks in a single prompt

Combining multiple tasks in a single prompt divides the model's attention, increases the chance of format drift, and makes it harder for the model to apply a consistent structure to each task.

Concept tested: Few-shot prompting for structured output format elicitation

Source: https://www.promptingguide.ai/techniques/fewshot

Topics

#Prompt Engineering#Prompt Design#LLM Interaction#Generative AI Best Practices

Community Discussion

No community discussion yet for this question.

Full GENERATIVE-AI-ENGINEER-ASSOCIATE Practice