nerdexam
Databricks

GENERATIVE-AI-ENGINEER-ASSOCIATE · Question #33

A Generative AI Engineer is using an LLM to classify species of edible mushrooms based on text descriptions of certain features. The model is returning accurate responses in testing and the…

The correct answer is D. Use a system prompt to instruct the model to be succinct in its answer. Since the model is already producing accurate labels, the only problem is verbosity - the model includes extra reasoning when only the label is needed. A system prompt with an explicit instruction such as 'Return only the label name with no additional text or explanation'…

Prompt Engineering

Question

A Generative AI Engineer is using an LLM to classify species of edible mushrooms based on text descriptions of certain features. The model is returning accurate responses in testing and the Generative AI Engineer is confident they have the correct list of possible labels, but the output frequently contains additional reasoning in the answer when the Generative AI Engineer only wants to return the label with no additional text. Which action should they take to elicit the desired behavior from this LLM?

Options

  • AUse few shot prompting to instruct the model on expected output format
  • BUse zero shot prompting to instruct the model on expected output format
  • CUse zero shot chain-of-thought prompting to prevent a verbose output format
  • DUse a system prompt to instruct the model to be succinct in its answer

How the community answered

(21 responses)
  • B
    5% (1)
  • C
    10% (2)
  • D
    86% (18)

Explanation

Since the model is already producing accurate labels, the only problem is verbosity - the model includes extra reasoning when only the label is needed. A system prompt with an explicit instruction such as 'Return only the label name with no additional text or explanation' directly targets this behavior. Option A (few-shot prompting) could help but is more complex than needed and may not fully suppress reasoning. Option B (zero-shot prompting alone) is already in use and hasn't solved the problem. Option C (zero-shot chain-of-thought) would make verbosity worse, as it explicitly encourages the model to show its reasoning. A direct system-level instruction is the simplest and most effective lever for controlling output format.

Topics

#Prompt Engineering#LLM Output Control#System Prompt#Few-shot Prompting

Community Discussion

No community discussion yet for this question.

Full GENERATIVE-AI-ENGINEER-ASSOCIATE Practice