Skip to main content
Back to Library
Prompt Engineering Guide

Mastering Legal contract analysis
on Phi-3.5 MoE

Stop guessing. See how professional prompt engineering transforms Phi-3.5 MoE's output for specific technical tasks.

The "Vibe" Prompt

"Analyze this legal contract. Tell me what's important, risks, and obligations."
Low specificity, inconsistent output

Optimized Version

STABLE
You are an expert legal counsel. Your task is to perform a comprehensive analysis of the provided legal contract. Follow these steps: 1. **Identify Parties and Purpose:** What are the names of the parties involved and what is the primary purpose or subject matter of this contract? 2. **Key Provisions Extraction:** Extract the following critical provisions: * Term and Termination conditions (including notice periods, cure periods, and events of default). * Payment/Consideration terms (amounts, schedule, currency, late fees). * Representations and Warranties (key assurances made by each party). * Indemnification clauses (who indemnifies whom, for what, and limitations). * Limitation of Liability (caps, exclusions, types of damages). * Governing Law and Dispute Resolution mechanisms. * Confidentiality obligations. 3. **Risk Assessment:** For each party, identify potential legal, financial, and operational risks associated with these key provisions and the contract as a whole. Quantify or qualify the severity where possible (e.g., 'High Risk: Unlimited liability exposure'). 4. **Obligations Summary:** For each party, enumerate their primary obligations and responsibilities under this contract, cross-referencing specific clauses if available. 5. **Recommendations/Actionable Insights:** Provide concise, actionable recommendations for each party based on your analysis. These could include clauses to renegotiate, areas for further diligence, or compliance steps. Contract Text: [INSERT CONTRACT TEXT HERE]
Structured, task-focused, reduced hallucinations

Engineering Rationale

The optimized prompt leverages Chain-of-Thought reasoning by breaking down the complex task of 'legal contract analysis' into smaller, manageable, and sequential steps. It explicitly instructs the model on what information to extract, how to categorize risks and obligations, and what kind of actionable insights are expected. This structured approach guides the Phi-3.5 MoE model towards a more accurate, comprehensive, and legally sound analysis, reducing hallucination and ensuring all critical aspects are covered. The explicit formatting instructions also improve readability and consistency of the output. The 'expert legal counsel' persona sets the tone and expected level of rigor.

0%
Token Efficiency Gain
The optimized prompt explicitly asks for key provisions like 'Term and Termination', 'Payment', 'Indemnification', and 'Limitation of Liability'. A correct response will extract these accurately.
The optimized prompt requires a 'Risk Assessment' that identifies potential risks and, where possible, qualifies their severity. A correct response will provide specific risks for each party.
The optimized prompt demands an 'Obligations Summary' for each party, potentially cross-referencing clauses. A correct response will clearly list responsibilities.

Ready to stop burning tokens?

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

Optimize My Prompts