
Explanation:
As an AWS Certified AI Practitioner expert, I'll analyze the prompt engineering strategies for sentiment analysis using an LLM on Amazon Bedrock.
Option A recommends providing examples of text passages with corresponding positive or negative labels in the prompt, followed by the new text passage to be classified. This approach is optimal because:
Contextual Learning: LLMs excel at pattern recognition. By providing labeled examples, the model can infer the task (sentiment classification) and the desired output format (positive/negative labels).
Task Specification: The examples clearly define what constitutes "positive" and "negative" sentiment within the company's specific context, reducing ambiguity.
Format Consistency: Demonstrating the expected input-output pattern helps ensure the LLM produces responses in the correct format.
Amazon Bedrock Best Practice: This aligns with AWS documentation on effective prompt engineering for classification tasks, where few-shot examples improve accuracy and reliability.
Option B: Providing a detailed explanation of sentiment analysis and how LLMs work is suboptimal because:
Option C: Providing only the new text passage without context is ineffective because:
Option D: Providing examples of unrelated tasks (like text summarization) is counterproductive because:
When implementing this on Amazon Bedrock:
This approach represents industry best practice for classification tasks with LLMs, balancing effectiveness with token efficiency.
Ultimate access to all questions.
Which prompt engineering strategy should be used to classify text passages as positive or negative sentiment using a large language model (LLM) on Amazon Bedrock?
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.
No comments yet.