Skip to main content
Back to Library
Prompt Engineering Guide

Mastering Legal contract analysis
on Llama 3.1 405B

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

The "Vibe" Prompt

"Analyze this legal contract. Tell me everything important."
Low specificity, inconsistent output

Optimized Version

STABLE
You are Llama 3.1 405B, a highly advanced AI specializing in legal text analysis. You will perform a comprehensive analysis of the provided legal contract. Your goal is to extract key information, identify potential risks, and summarize critical clauses. **Contract Text:** [INSERT CONTRACT TEXT HERE] **Chain of Thought Analysis Steps:** 1. **Identify Parties and Effective Date:** Extract the full legal names of all parties involved and the contract's effective date. 2. **Determine Contract Type and Purpose:** Based on the language, infer the primary type of contract (e.g., Service Agreement, NDA, Lease) and its main objective. 3. **Extract Key Obligations and Deliverables:** List the primary duties, responsibilities, and expected outcomes for each party. 4. **Identify Financial Terms:** Locate and summarize all monetary aspects, including payment schedules, fees, penalties, and currency. 5. **Identify Termination Clauses:** Detail the conditions under which the contract can be terminated by either party, including notice periods and cure provisions. 6. **Identify Indemnification and Limitation of Liability Clauses:** Explain the scope of indemnification and any caps or exclusions on liability. 7. **Identify Governing Law and Dispute Resolution:** Determine the jurisdiction whose laws apply and the prescribed method for resolving disputes (e.g., arbitration, litigation). 8. **Identify Confidentiality Provisions:** Summarize the scope of confidential information, obligations regarding its protection, and duration of confidentiality. 9. **Identify Intellectual Property Rights:** Determine ownership, licensing, or usage rights related to intellectual property created or utilized under the contract. 10. **Flag Ambiguities and Potential Risks:** Point out any vague language, conflicting clauses, or terms that could lead to future disputes or adverse outcomes for any party. 11. **Draft a concise Executive Summary:** Provide a high-level overview of the contract's essence, key implications, and main takeaways. **Output Format:** Present your analysis using clear headings for each step outlined above, followed by bullet points or concise paragraphs. Use bold text for key terms or amounts. Conclude with the 'Executive Summary'.
Structured, task-focused, reduced hallucinations

Engineering Rationale

The optimized prompt leverages several best practices for complex task processing. First, it establishes a clear 'persona' for the AI (Llama 3.1 405B, legal specialist), which primes the model for a specific output style and level of detail. Second, it utilizes a detailed 'chain of thought' breakdown, guiding the model through a structured, multi-step analysis process. This prevents the model from missing critical aspects and ensures a comprehensive review. Each step is a specific instruction, reducing ambiguity. Third, it explicitly defines the 'output format,' which is crucial for consistency and readability for the end-user. By requesting specific types of information (e.g., 'potential risks,' 'ambiguities'), it directs the model to perform critical thinking beyond simple extraction. The combination of persona, structured steps, and specified output leads to a more accurate, complete, and useful analysis compared to a vague 'vibe' prompt.

0%
Token Efficiency Gain
The optimized prompt explicitly asks for 'potential risks', which the naive prompt completely misses.
The optimized prompt mandates an 'Executive Summary', ensuring a high-level overview is always provided.
The optimized prompt specifies 'Governing Law and Dispute Resolution', critical legal details often overlooked by general prompts.

Ready to stop burning tokens?

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

Optimize My Prompts