Skip to main content
Back to Library
Prompt Engineering Guide

Mastering Legal contract analysis
on Llama 3.1 70B

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

The "Vibe" Prompt

"Analyze this legal contract and tell me everything important about it."
Low specificity, inconsistent output

Optimized Version

STABLE
You are a highly skilled AI specializing in legal contract analysis. Your task is to meticulously analyze the provided legal contract and extract the following specific information: **I. Key Contractual Parties:** - Identify and list all named parties involved. - For each party, determine their role (e.g., 'Lessor', 'Lessee', 'Vendor', 'Purchaser', 'Service Provider', 'Client'). **II. Core Agreement Details:** - **Contract Title/Type:** What kind of contract is this (e.g., 'Lease Agreement', 'Service Agreement', 'Purchase Agreement', 'Non-Disclosure Agreement')? - **Effective Date:** What is the official start date of the contract? - **Duration/Term:** How long is the contract valid? Specify if it's a fixed term, evergreen, or indefinite. - **Governing Law:** Which jurisdiction's laws govern this contract? **III. Financial Obligations (if applicable):** - **Payment Amounts/Structure:** Describe any monetary obligations, including fixed fees, hourly rates, percentages, etc. - **Payment Schedule:** When are payments due? - **Currency:** What currency is specified for payments? **IV. Key Rights and Obligations of Each Party:** - For each identified party, summarize their primary rights. - For each identified party, summarize their primary obligations. **V. Important Clauses/Sections to Highlight:** - **Termination Provisions:** Summarize conditions under which the contract can be terminated by either party, including notice periods. - **Indemnification:** Are there any clauses where one party agrees to compensate the other for losses? If so, briefly explain. - **Confidentiality:** Are there confidentiality obligations? If so, what do they cover? - **Limitation of Liability:** Is there a cap on liability? If so, what are the key details? - **Dispute Resolution:** How are disputes to be resolved (e.g., arbitration, mediation, litigation)? Specify the forum. **VI. Potential Risks/Red Flags:** - Based on the above analysis, highlight any clauses that appear ambiguous, overly broad, one-sided, or potentially unfavorable to one party. **VII. Summary and Recommendations (Concise):** - Provide a brief, high-level summary of the contract's purpose and key takeaways. - Offer 1-2 actionable recommendations or points for further legal review. **Chain of Thought Steps:** 1. **Initial Scan & Identify Structure:** Read through the contract quickly to understand its overall structure, sections, and headings. Identify the main parties and the approximate subject matter. 2. **Party Identification & Roles:** Systematically go through the 'Parties' section or the preamble to identify all named entities and assign their roles. 3. **Core Agreement Extraction:** Locate the 'Definitions', 'Recitals', 'Term', and 'Governing Law' sections to extract the contract type, effective date, duration, and governing jurisdiction. 4. **Financial Analysis:** Search for keywords like 'payment', 'fee', 'remuneration', 'invoice', 'currency' to identify all financial obligations, amounts, and schedules. 5. **Rights and Obligations Mapping:** For each party, carefully read through the relevant sections that detail what they **must do** (obligations) and what they **are entitled to do** (rights). 6. **Clause Deep Dive:** Specifically search for and analyze sections titled 'Termination', 'Indemnification', 'Confidentiality', 'Limitation of Liability', and 'Dispute Resolution'. Extract the core requirements and implications of each. 7. **Risk Assessment:** After extracting all the structured information, re-read potentially tricky clauses or those that seem unbalanced. Look for vague language, onerous conditions, or areas susceptible to misinterpretation. 8. **Synthesize & Summarize:** Consolidate all extracted information into a concise summary. Formulate targeted recommendations based on the findings and identified risks. Present the analysis using clear headings and bullet points for readability. If a section is not applicable or information is not found, state 'N/A'. [Legal Contract Text Here]
Structured, task-focused, reduced hallucinations

Engineering Rationale

The optimized prompt works by leveraging several advanced prompting techniques. Firstly, it establishes a clear 'persona' ('highly skilled AI specializing in legal contract analysis'), which sets the expectation for the level of detail and accuracy. Secondly, it employs 'structured output instructions' by prescribing exact sections (I, II, III, etc.) and sub-points. This guides the model to extract specific data types rather than generating a generic summary. Thirdly, the integration of a 'Chain of Thought' (CoT) section explicitly outlines the step-by-step reasoning process the AI should follow. This internal monologue helps the model to break down the complex task, ensuring comprehensive coverage and reducing the likelihood of omissions. Finally, the use of markdown for headings and bullet points further reinforces the desired output format, making the results highly readable and actionable. This structured approach significantly reduces ambiguity and the cognitive load on the model, leading to more accurate, thorough, and consistent analyses.

0%
Token Efficiency Gain
The optimized prompt will consistently extract all specified categories of information (parties, dates, financial, rights/obligations, key clauses, risks).
The optimized prompt's output will be structured as requested, with clear headings and bullet points.
The optimized prompt will identify potential risks or red flags more accurately than the naive prompt.

Ready to stop burning tokens?

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

Optimize My Prompts