Skip to main content
Back to Library
Prompt Engineering Guide

Mastering Analyze sentiment
on Cerebras Llama 3.1 70B

Stop guessing. See how professional prompt engineering transforms Cerebras Llama 3.1 70B's output for specific technical tasks.

The "Vibe" Prompt

"Analyze the sentiment of the following text: "I absolutely loved the movie, especially the unexpected plot twists and the incredible acting." Is it positive, negative, or neutral?"
Low specificity, inconsistent output

Optimized Version

STABLE
You are a highly analytical sentiment analysis AI. Your task is to precisely determine the sentiment of provided text as either 'positive', 'negative', or 'neutral'. Follow these steps: 1. **Identify Key Sentiment Indicators**: Scan the text for words, phrases, and expressions that convey emotion or evaluative judgment. 2. **Assess Polarity**: For each indicator, determine if it suggests positive, negative, or neutral sentiment. 3. **Consider Modifiers**: Account for intensifiers (e.g., 'very', 'absolutely') or negations (e.g., 'not', 'never') that alter the strength or direction of sentiment. 4. **Synthesize Findings**: Combine the assessments of all indicators to derive an overall sentiment. If a clear prevailing sentiment exists, state it. If sentiments are mixed and balance each other, or if no strong sentiment is present, classify as 'neutral'. 5. **Output**: State the final sentiment clearly as 'positive', 'negative', or 'neutral'. Text to analyze: "I absolutely loved the movie, especially the unexpected plot twists and the incredible acting."
Structured, task-focused, reduced hallucinations

Engineering Rationale

The optimized prompt leverages Chain-of-Thought (CoT) prompting, breaking down the complex 'sentiment analysis' task into granular, logical steps. This guides the Cerebras Llama 3.1 70B model to perform a more structured and accurate analysis. By explicitly asking it to 'Identify Key Sentiment Indicators', 'Assess Polarity', 'Consider Modifiers', and 'Synthesize Findings', the model is less likely to make superficial judgments. The persona 'highly analytical sentiment analysis AI' further hones its focus. This structure reduces ambiguity and encourages a deeper understanding of the text's emotional content, leading to more reliable outputs.

-100%
Token Efficiency Gain
The optimized prompt explicitly asks for a step-by-step reasoning process.
The optimized prompt provides clear instructions on how to handle ambiguous or mixed sentiments.
The optimized prompt establishes a persona for the AI, which can influence its response style.

Ready to stop burning tokens?

Join 5,000+ developers using Prompt Optimizer to slash costs and boost LLM reliability.

Optimize My Prompts