QuestionQ92

Fundamentals of GenAI

A company wants to use a large language model (LLM) on Amazon Bedrock for sentiment analysis. The company wants to classify the sentiment of text passages as positive or negative.

Which prompt engineering strategy meets these requirements?

  • A Provide examples of text passages with corresponding positive or negative labels in the prompt followed by the new text passage to be classified.
  • B Provide a detailed explanation of sentiment analysis and how LLMs work in the prompt.
  • C Provide the new text passage to be classified without any additional context or examples.
  • D Provide the new text passage with a few examples of unrelated tasks, such as text summarization or question answering.
Explanation

This approach uses few-shot prompting, a proven technique where labeled examples guide the model on the desired task format. Providing examples of text passages with positive/negative labels helps the model understand the classification task and generate accurate predictions on new input. Explaining sentiment analysis concepts is unnecessary (the model needs examples, not theory), classification without examples or context reduces accuracy, and unrelated task examples would confuse the model.

Learn more

Community Discussion

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