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.
A: Provide examples of text passages with corresponding positive or negative labels in the prompt followed by the new text passage to be classified.
Explanation:
This strategy is known as few-shot prompting, where the prompt includes a few examples of labeled data (text passages with positive or negative sentiment) before asking the model to classify the new text passage. This helps the large language model (LLM) understand the task and align its output with the desired format.
Why not the other options?
B: Provide a detailed explanation of sentiment analysis and how LLMs work in the prompt:
Explaining the concept of sentiment analysis is unnecessary for the model, as it does not improve the model's ability to classify text.
C: Provide the new text passage to be classified without any additional context or examples:
Without examples, the LLM might not correctly infer the task or format of the output, leading to inconsistent or incorrect results.
This approach uses few-shot learning, which is highly effective with large language models. By providing examples of text passages with their corresponding sentiment classifications, the LLM learns the context and pattern needed to classify the new passage.
Explanation:
By providing examples of text passages along with their corresponding sentiment labels (positive or negative), the model can learn from these examples how to classify the sentiment of the new text passage effectively
upvoted 4 times
...
Log in to ExamTopics
Sign in:
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
Moon
1 week, 2 days agoGianiluca
2 weeks, 3 days agojove
2 months ago