A company wants to use an LLM on Amazon Bedrock to classify text as positive or negative sentiment. Which prompt-engineering technique is most appropriate?
Choose an answer
Tap an option to check your answer.
Correct answer: Include labeled examples of passages with positive or negative tags in the prompt, then provide the new passage to classify..
Why this is the answer
Including labeled examples (few-shot prompting) is the most appropriate technique because it provides the LLM with direct demonstrations of the desired input-output format and the specific task (sentiment classification). This guides the model to produce accurate classifications for new, unseen passages. Including a long explanation of LLM function is unhelpful; the model already understands its own architecture and doesn't need a theoretical explanation. Submitting only the passage without context (zero-shot prompting) might work for very simple tasks, but for sentiment classification, providing examples significantly improves accuracy by clarifying the expected output format and criteria. Providing unrelated examples (e.g., summarization) confuses the model and dilutes the focus on the sentiment classification task.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed