QuestionQ39

VerifiedApplication Development

A Generative AI Engineer uses an LLM to classify species of edible mushrooms from text descriptions of particular features. The model produces accurate test responses, and the Generative AI Engineer is confident they have the correct list of possible labels, but its output often includes extra reasoning when they want to return only the label and no additional text.

What action should they take to elicit the desired behavior from this LLM?

Explanation

Few-shot prompting provides example input-output pairs that demonstrate the exact desired response pattern. Showing mushroom descriptions paired with label-only outputs steers the model to return only a valid label, without explanatory text. Google Cloud documents few-shot examples as a way to guide specific output formats and styles.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!