
Ultimate access to all questions.
Deep dive into the quiz with AI chat providers.
We prepare a focused prompt with your quiz and certificate details so each AI can offer a more tailored, in-depth explanation.
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:
Option A is correct because this approach uses few-shot learning or in-context learning, which is an effective prompt engineering strategy for classification tasks like sentiment analysis. By providing examples of text passages with their corresponding labels (positive/negative), you're teaching the LLM the pattern it needs to follow for the new text passage.
Why other options are incorrect:
Key Concept: In prompt engineering for classification tasks, few-shot learning (providing examples with labels) is typically more effective than zero-shot or unrelated examples because it demonstrates the exact pattern the model should follow.