Skip to main content
Back to Library
Prompt Engineering Guide

Mastering Legal contract analysis
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 this legal contract for key clauses, risks, and obligations."
Low specificity, inconsistent output

Optimized Version

STABLE
You are a highly analytical and experienced legal counsel specializing in contract law. Your task is to perform a comprehensive analysis of the provided legal contract. Follow these steps: 1. **Identify Parties and Purpose:** Clearly state the parties involved and the overarching purpose of the contract. 2. **Extract Key Clauses:** Isolate and summarize the most critical clauses. Focus on: * Definitions * Scope of Work/Services * Payment Terms * Term and Termination * Representations and Warranties * Indemnification * Limitation of Liability * Governing Law and Dispute Resolution * Confidentiality 3. **Identify and Assess Risks:** For each party, clearly articulate potential legal, financial, or operational risks associated with the contract. Provide a probability (High, Medium, Low) and potential impact (High, Medium, Low) for each identified risk. 4. **Detail Obligations:** For each party, list their primary contractual obligations. 5. **Identify Missing/Ambiguous Clauses:** Point out any clauses that are noteworthy by their absence or any language that is unclear or open to multiple interpretations. 6. **Provide High-Level Recommendations:** Offer concise, actionable recommendations for improving the contract's clarity, reducing risk, or strengthening a party's position. Prioritize recommendations by urgency. Structure your output with clear headings for each step. Be precise, avoid jargon where simpler language suffices, and support your analysis with references to specific contract sections where possible. [CONTRACT TEXT HERE]
Structured, task-focused, reduced hallucinations

Engineering Rationale

The optimized prompt leverages several best practices for complex tasks with large language models, especially for a powerful model like Cerebras Llama 3.1 70B: 1. **Role-Playing (Persona):** Assigning the persona of 'highly analytical and experienced legal counsel' immediately sets the tone and expectation for the model's output quality and expertise. 2. **Chain-of-Thought (CoT):** Breaking down the complex 'analysis' task into sequential, numbered steps guides the model through a logical reasoning process. This reduces the likelihood of hallucination and ensures all aspects of the request are covered systematically. 3. **Specific Instructions & Sub-bullets:** Providing explicit sub-categories under 'Key Clauses' and 'Identify and Assess Risks' (e.g., Definitions, Payment Terms; Probability, Impact) focuses the model's extraction and analysis, preventing generic output. 4. **Output Format & Structure:** Requesting clear headings and a structured output helps the model organize its response, making it easier for the user to read and interpret the analysis. This also implicitly forces the model to synthesize information rather than just extract it. 5. **Constraints and Qualifiers:** Instructions like 'Be precise, avoid jargon where simpler language suffices, and support your analysis with references' enhance the quality, clarity, and verifiability of the output. 6. **Explicit Placeholder:** '[CONTRACT TEXT HERE]' clearly indicates where the model should expect the input, reducing ambiguity.

0%
Token Efficiency Gain
The optimized prompt explicitly defines the desired output structure, which will lead to more consistent and parseable results.
The optimized prompt uses chain-of-thought to guide the model through a step-by-step analysis, significantly improving accuracy and completeness compared to the naive version.
The optimized prompt specifies key elements to focus on within sections (e.g., types of clauses, risk assessment metrics), preventing the model from missing crucial details.

Ready to stop burning tokens?

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

Optimize My Prompts