Meta prompting is a technique where an AI system itself creates, evaluates, or refines prompts that are then used to accomplish tasks. Instead of relying solely on human-designed prompts, meta prompting leverages AI’s capabilities to generate optimized instructions that can better guide subsequent AI responses. This approach involves “prompting about prompting,” creating a recursive framework that can lead to improved performance.
Here’s a simple meta prompting example for content creation:
Basic Meta Prompting
Copy
Ask AI
---provider: OpenAImodel: gpt-4otemperature: 0.7---# Meta Prompt Generator## Task DescriptionI need to generate content about: {{ topic }}For audience: {{ audience }}In tone: {{ tone }}Content type: {{ content_type }}Length: {{ length }} words## Meta Prompt Process1. Analyze the task requirements and target audience2. Create an optimized prompt that would generate the best possible content for this specific task3. Provide the optimized prompt in a clear, structured format## Generated Prompt:Generate a prompt that would help an AI create the best possible {{ content_type }} about {{ topic }} for {{ audience }}. The prompt should:- Guide the AI to use a {{ tone }} tone- Structure the content appropriately for a {{ content_type }}- Ensure comprehensive coverage of important aspects of {{ topic }}- Target the content specifically to {{ audience }} needs and knowledge level- Result in approximately {{ length }} words of content
Let’s create a more sophisticated example that uses Latitude’s chain feature to implement an iterative prompt refinement process:
Copy
Ask AI
---provider: OpenAImodel: gpt-4otemperature: 0.6---<step as="initial_prompt"># Initial Meta Prompt GenerationI need to accomplish the following task:{{ task_description }}Generate a prompt that would help an AI complete this task effectively. Consider:- The specific goal to be achieved- The expected format of the output- Any constraints that must be followed- The target audience for the result- The level of detail required## Generated Prompt:</step><step as="prompt_critique"># Meta Prompt CritiqueAnalyze the following prompt that was created to accomplish this task:## Task:{{ task_description }}## Generated Prompt:{{ initial_prompt }}Now critique this prompt based on the following criteria:1. **Clarity**: Is the prompt clear and unambiguous?2. **Specificity**: Does it provide enough guidance on what exactly is needed?3. **Constraints**: Does it properly communicate any limitations or requirements?4. **Example Guidance**: Could examples help make the expectations clearer?5. **Structure**: Is the prompt structured in a way that guides the AI's response format?## Prompt Critique:Identify at least 3 specific ways this prompt could be improved.</step><step># Final Optimized PromptBased on the initial prompt and critique, create an improved, optimized prompt:## Original Task:{{ task_description }}## Initial Prompt:{{ initial_prompt }}## Critique Points:{{ prompt_critique }}## Optimized Final Prompt:Create a new and improved version of the prompt that addresses the critique points while maintaining the core objectives of the task.</step>
In this advanced example:
Multi-Step Process: We separate prompt generation, critique, and refinement
Self-Critique: The model evaluates its own prompt against specific criteria
Iterative Improvement: The final prompt incorporates learnings from the critique
Generate multiple prompts and select the best one:
Copy
Ask AI
---provider: OpenAImodel: gpt-4otemperature: 0.8---<step as="prompt_variants"># Generate Prompt VariantsFor the following task, generate 3 different prompting approaches, each with a different strategy:## Task:{{ task_description }}## Prompt Variant 1 - Direct Instruction Style:Create a prompt that uses clear, direct instructions with step-by-step guidance.## Prompt Variant 2 - Role-Based Style:Create a prompt that assigns a specific expert role to the AI and frames the request within that context.## Prompt Variant 3 - Example-Based Style:Create a prompt that uses examples (few-shot learning) to demonstrate the expected output format and quality.</step><step as="prompt_evaluation"># Evaluate Prompt VariantsAnalyze these three prompt variants for the task:## Task:{{ task_description }}## Prompt Variants:{{ prompt_variants }}For each prompt variant, evaluate:1. **Likely Effectiveness**: How well will it guide the AI to complete the task?2. **Clarity**: How clear are the instructions?3. **Adaptability**: How well would it handle edge cases?4. **Efficiency**: How concise is the prompt without sacrificing effectiveness?Score each prompt on a scale of 1-10 for each criterion, and provide a brief explanation.## Evaluation Results:</step><step># Select Optimal PromptBased on the evaluation, select the best prompt variant or create a hybrid that combines the strengths of multiple variants.## Evaluation Summary:{{ prompt_evaluation }}## Optimal Prompt Selection:The optimal prompt for this task is:[Provide the selected or hybrid prompt here]## Reasoning:[Explain why this prompt is the best choice for the specific task]</step>
For complex tasks, implement a cascade of meta prompts:
Copy
Ask AI
---provider: OpenAImodel: gpt-4otemperature: 0.5---<step as="task_analysis"># Task DecompositionAnalyze the following complex task and break it down into sequential sub-tasks:{{ complex_task }}## Task Analysis:1. Identify the main goal2. Determine required components3. Map out a logical sequence of steps## Task Decomposition Results:List the sequence of sub-tasks needed to complete this complex task.</step><step as="prompt_generation"># Sub-Task Prompt GenerationBased on the task decomposition, create optimized prompts for each sub-task:## Complex Task:{{ complex_task }}## Decomposed Sub-Tasks:{{ task_analysis }}## Generated Sub-Task Prompts:For each sub-task, create a specialized prompt designed to accomplish that specific part of the overall process.</step><step># Meta Workflow AssemblyAssemble the sub-task prompts into a cohesive workflow that addresses the complex task:## Original Complex Task:{{ complex_task }}## Sub-Task Prompts:{{ prompt_generation }}## Workflow Integration:Create a step-by-step workflow that:1. Structures the sub-tasks in the optimal sequence2. Ensures output from earlier steps feeds correctly into later steps3. Includes validation checks between stages4. Provides a final integration step to combine results## Complete Meta Prompt Workflow:</step>
---provider: OpenAImodel: gpt-4otemperature: 0.6---<step as="initial_result"># Initial Task Execution## Task:{{ task_description }}## Initial Prompt:{{ initial_prompt }}Execute the task using the provided prompt and produce a result.## Initial Result:</step><step as="error_analysis"># Performance AnalysisAnalyze the initial result against the expected outcome:## Task:{{ task_description }}## Expected Outcome:{{ expected_outcome }}## Initial Result:{{ initial_result }}## Performance Gap Analysis:1. Identify specific areas where the result falls short2. Analyze why the initial prompt led to these shortcomings3. Determine what prompt elements could be adjusted to improve results## Analysis Results:</step><step># Prompt AdaptationBased on the performance analysis, adapt the prompt to address identified issues:## Original Prompt:{{ initial_prompt }}## Performance Issues:{{ error_analysis }}## Adapted Prompt:Create an improved prompt that specifically addresses the identified performance gaps while maintaining the original task objectives.</step>
---provider: OpenAImodel: gpt-4otemperature: 0.4---<step as="content_analysis"># Content AnalysisAnalyze the following content for optimization opportunities:{{ original_content }}## Content Assessment:1. **Purpose**: What is this content trying to achieve?2. **Audience**: Who is the target audience?3. **Structure**: How is the information organized?4. **Tone**: What is the current tone and style?5. **Weaknesses**: What aspects could be improved?## Analysis Results:</step><step as="optimization_prompt"># Optimization Prompt GenerationBased on the content analysis, create a prompt specifically designed to optimize this content:## Content Analysis:{{ content_analysis }}## Optimization Goals:- Maintain the original purpose and key information- Address identified weaknesses- Enhance clarity and engagement- Optimize for the target audience- Improve structure and flow## Content Optimization Prompt:Create a prompt that would guide an AI to transform the original content into an optimized version.</step><step># Content TransformationUsing the optimization prompt, transform the original content:## Original Content:{{ original_content }}## Optimization Prompt:{{ optimization_prompt }}## Optimized Content:Transform the original content according to the optimization prompt.</step>