Skip to content

Instantly share code, notes, and snippets.

@ruvnet
Last active October 11, 2024 21:58
Show Gist options
  • Save ruvnet/6a368b9d3409fa6403a462b66200bf4d to your computer and use it in GitHub Desktop.
Save ruvnet/6a368b9d3409fa6403a462b66200bf4d to your computer and use it in GitHub Desktop.

Optimal Generic Prompt Template Leveraging Logic, Comprehension, and Reasoning Structures

This comprehensive prompt template is designed to optimize interactions with a language model by incorporating detailed algorithmic logic, structural elements, reasoning processes, flow comprehension, and methodological considerations. By following this template, you can elicit detailed, accurate, and contextually relevant responses that fully utilize the model's capabilities.


Template Overview

  1. Contextual Background
  2. Clear Instruction of Task
  3. Specific Requirements and Constraints
  4. Desired Output Structure
  5. Reasoning and Justification
  6. Tone and Style Preferences
  7. Examples and Analogies
  8. Additional Considerations
  9. Final Topic for Execution

Detailed Template Breakdown

1. Contextual Background

Purpose: Provide the model with necessary background information to fully understand the situation or topic.

Structure:

  • Introduce the Topic: Briefly explain the subject matter.
    • Example: "I'm interested in learning about [Insert Topic]..."
  • Specify the Audience or Perspective: Indicate any specific viewpoint or audience.
    • Example: "...from the perspective of [Insert Perspective/Audience]."

2. Clear Instruction of Task

Purpose: Clearly state what you want the model to do to avoid ambiguity.

Structure:

  • Action Verb: Begin with verbs like "Explain," "Describe," "Compare," "List," etc.
    • Example: "Explain..."
  • Specific Topic or Question: Detail the exact subject or query.
    • Example: "...the key factors that influence [Insert Specific Aspect]."

3. Specific Requirements and Constraints

Purpose: Define the boundaries and limitations to focus the response.

Structure:

  • Scope Limitations: Specify what to include or exclude.
    • Example: "Focus on [Insert Scope], and exclude [Insert Exclusions]."
  • Length Constraints: Indicate desired response length.
    • Example: "Provide approximately [Insert Word Count] words."
  • Time Frame: If relevant, mention any temporal considerations.
    • Example: "Consider developments up to the year [Insert Year]."

4. Desired Output Structure

Purpose: Guide the model on how to organize the response.

Structure:

  • Formatting Instructions: Specify the format (e.g., bullet points, numbered lists, paragraphs).
    • Example: "Present the information in [Insert Format]."
  • Sections and Subheadings: Request division into parts if necessary.
    • Example: "Divide the answer into sections: [Insert Sections]."
  • Data Presentation: Indicate preferences for data inclusion.
    • Example: "Include relevant statistics where appropriate."

5. Reasoning and Justification

Purpose: Encourage the model to provide logical reasoning and explanations.

Structure:

  • Ask for Explanations: Request detailed justifications.
    • Example: "Provide reasons for each point made."
  • Cause and Effect Relationships: Highlight logical connections.
    • Example: "Explain how [Insert Cause] leads to [Insert Effect]."

6. Tone and Style Preferences

Purpose: Ensure the response matches the desired communication style.

Structure:

  • Tone Specification: Indicate formal, informal, technical, or conversational tone.
    • Example: "Maintain a [Insert Tone] tone throughout."
  • Language Level: Specify complexity or simplicity.
    • Example: "Use language suitable for [Insert Audience Level], avoiding jargon."

7. Examples and Analogies

Purpose: Enhance understanding through illustrative content.

Structure:

  • Request Examples: Ask for specific instances or case studies.
    • Example: "Include examples to illustrate key points."
  • Analogies and Metaphors: Encourage comparative explanations if helpful.
    • Example: "Use analogies to clarify complex ideas."

8. Additional Considerations

Purpose: Address any other factors that may influence the response.

Structure:

  • Cultural Sensitivity: Mention any cultural aspects to be aware of.
    • Example: "Be mindful of cultural differences in [Insert Region]."
  • Assumptions to Avoid: Specify any biases or assumptions to exclude.
    • Example: "Avoid assuming prior knowledge of [Insert Topic]."
  • Formatting Preferences: Any other presentation guidelines.
    • Example: "Use bullet points for clarity."

9. Final Topic for Execution

Purpose: Provide the specific topic or question for the model to address using the above guidelines.

Structure:

  • Insert Final Topic: Clearly state the topic or question.
    • Example: "[Insert Final Topic or Question Here]"

Algorithmic Logic and Reasoning Flow

The model processes the prompt by:

  1. Parsing the Input:
    • Tokenizes the text to understand instructions and context.
  2. Contextual Understanding:
    • Activates relevant knowledge based on the provided background.
  3. Identifying Key Instructions:
    • Recognizes action verbs and specific tasks.
  4. Applying Constraints:
    • Adjusts the response according to length, scope, and formatting requirements.
  5. Generating Structured Output:
    • Organizes the response based on desired structure and style.
  6. Incorporating Reasoning:
    • Provides explanations and justifications with logical connections.
  7. Reviewing for Coherence:
    • Ensures the response flows logically and cohesively.

Methodological Approach

  • Start Broad, Then Focus:
    • Begin with general concepts before delving into specifics.
  • Logical Sequencing:
    • Present information in a logical order (e.g., cause and effect, chronological).
  • Evidence-Based Responses:
    • Incorporate data and examples to support statements.
  • Clarity and Precision:
    • Use clear language and define complex terms.
  • Feedback Loop:
    • Be open to refining the prompt based on the initial response.

Generic Example Prompt Using the Template


Prompt:

Contextual Background:

"I am interested in understanding the fundamental principles of [Insert Topic: Artificial Intelligence]."

Clear Instruction of Task:

"Explain the key components that constitute [Insert Specific Aspect: Machine Learning Algorithms]."

Specific Requirements and Constraints:

"Focus on the top three components, and exclude overly technical mathematical explanations."

Desired Output Structure:

"Present the information in a numbered list with brief descriptions for each component."

Reasoning and Justification:

"Provide reasons why each component is essential to [Insert Topic: Machine Learning]."

Tone and Style Preferences:

"Maintain an informative and accessible tone suitable for readers new to the subject."

Examples and Analogies:

"Include simple analogies to illustrate complex concepts."

Additional Considerations:

"Avoid industry-specific jargon, and ensure explanations are concise."

Final Topic for Execution:

"Explain the key components that constitute machine learning algorithms."


Expected Response:

  1. Data Input:

    • Description: Data serves as the foundational element upon which machine learning models are built.
    • Reasoning: Without data, algorithms have nothing to learn from; it's akin to experience for humans.
    • Analogy: Just as a student needs textbooks to study, algorithms need data to learn patterns.
  2. Model Architecture:

    • Description: This refers to the structure of the algorithm that processes input data to make predictions.
    • Reasoning: The architecture determines how data is interpreted and influences the accuracy of outcomes.
    • Analogy: It's like the blueprint of a building that defines its structure and functionality.
  3. Learning Process (Training):

    • Description: The method by which the algorithm adjusts its parameters to better fit the data.
    • Reasoning: Through training, the algorithm improves its performance, similar to practicing a skill.
    • Analogy: Just as an athlete trains to enhance performance, algorithms undergo training to improve predictions.

Benefits of This Template

  • Maximizes Relevance:
    • Detailed instructions help the model provide precise answers.
  • Enhances Depth and Quality:
    • Encouraging reasoning and justifications leads to insightful responses.
  • Improves Clarity:
    • Specifying structure and tone ensures the response meets your needs.
  • Saves Time:
    • Reduces the need for follow-up prompts or clarifications.

Tips for Effective Use

  • Be Explicit:
    • Clearly state all expectations to minimize ambiguity.
  • Keep It Structured:
    • Use headings or bullet points for readability.
  • Iterate as Needed:
    • Refine the prompt if the initial response doesn't meet your needs.
  • Leverage Model Strengths:
    • Provide sufficient context to enable the model to synthesize information effectively.

Conclusion

This optimal generic prompt template is designed to harness the full potential of the language model's logic, comprehension, and reasoning abilities. By meticulously detailing each component of the prompt, you can receive responses that are not only accurate and informative but also tailored to your specific needs and preferences.


Remember: The key to effective communication with a language model lies in the clarity and completeness of your prompt. By investing time in crafting your request using this template, you enable the model to provide the most helpful and relevant responses possible.

Logic Bomb Prompt Template Leveraging Logic, Comprehension, and Reasoning Structures

This comprehensive prompt template is designed to maximize the effectiveness of interactions with a language model by incorporating detailed algorithmic logic, structural elements, reasoning processes, flow comprehension, and methodological considerations. By following this template, users can elicit detailed, accurate, and contextually relevant responses that fully utilize the model's capabilities.


Template Overview

  1. Contextual Background
  2. Clear Instruction of Task
  3. Specific Requirements and Constraints
  4. Desired Output Structure
  5. Reasoning and Justification
  6. Tone and Style Preferences
  7. Examples and Analogies
  8. Additional Considerations

Detailed Template Breakdown

1. Contextual Background

Purpose: Provide the model with necessary background information to understand the situation or topic fully.

Structure:

  • Introduce the Topic: Briefly explain the subject matter.
    • Example: "I'm researching the impact of renewable energy sources on global economies..."
  • Specify the Audience or Perspective: Indicate any specific viewpoint.
    • Example: "...from the perspective of emerging markets in Southeast Asia."

2. Clear Instruction of Task

Purpose: Clearly state what you want the model to do to avoid ambiguity.

Structure:

  • Action Verb: Begin with verbs like "Explain," "Describe," "Compare," "List," etc.
    • Example: "Explain the advantages and disadvantages..."
  • Specific Topic or Question: Detail the exact subject or query.
    • Example: "...of implementing solar energy solutions in rural communities."

3. Specific Requirements and Constraints

Purpose: Define the boundaries and limitations to focus the response.

Structure:

  • Scope Limitations: Specify what to include or exclude.
    • Example: "Focus on economic factors rather than technical specifications."
  • Length Constraints: Indicate desired response length.
    • Example: "Provide approximately 300 words."
  • Time Frame: If relevant, mention any temporal considerations.
    • Example: "Consider developments up to the year 2023."

4. Desired Output Structure

Purpose: Guide the model on how to organize the response.

Structure:

  • Formatting Instructions: Specify the format (e.g., bullet points, numbered lists, paragraphs).
    • Example: "Present the information in a numbered list."
  • Sections and Subheadings: Request division into parts if necessary.
    • Example: "Divide the answer into 'Economic Advantages' and 'Economic Disadvantages.'"
  • Data Presentation: Indicate preferences for data inclusion.
    • Example: "Include relevant statistics or data points where appropriate."

5. Reasoning and Justification

Purpose: Encourage the model to provide logical reasoning and explanations.

Structure:

  • Ask for Explanations: Request detailed justifications.
    • Example: "Explain why solar energy is cost-effective in these regions."
  • Cause and Effect Relationships: Highlight logical connections.
    • Example: "Discuss how government policies influence adoption rates."

6. Tone and Style Preferences

Purpose: Ensure the response matches the desired communication style.

Structure:

  • Tone Specification: Indicate formal, informal, technical, or conversational tone.
    • Example: "Maintain a formal academic tone."
  • Language Level: Specify complexity or simplicity.
    • Example: "Use language suitable for readers with a basic understanding of economics."

7. Examples and Analogies

Purpose: Enhance understanding through illustrative content.

Structure:

  • Request Examples: Ask for specific instances or case studies.
    • Example: "Provide examples of countries where solar energy has significantly impacted the economy."
  • Analogies and Metaphors: Encourage comparative explanations if helpful.
    • Example: "Use analogies to compare energy adoption to other technological advancements."

8. Additional Considerations

Purpose: Address any other factors that may influence the response.

Structure:

  • Cultural Sensitivity: Mention any cultural aspects to be aware of.
    • Example: "Be mindful of local customs and practices in Southeast Asia."
  • Assumptions to Avoid: Specify any biases or assumptions to exclude.
    • Example: "Avoid assuming access to advanced technological infrastructure."
  • Formatting Preferences: Any other presentation guidelines.
    • Example: "Use APA citation style for any references."

Algorithmic Logic and Reasoning Flow

The model processes the prompt by:

  1. Parsing the Input:
    • Tokenizes the text to understand the instructions and context.
  2. Contextual Understanding:
    • Utilizes the provided background to activate relevant knowledge.
  3. Identifying Key Instructions:
    • Recognizes action verbs and specific tasks.
  4. Applying Constraints:
    • Adjusts the response according to length, scope, and formatting requirements.
  5. Generating Structured Output:
    • Organizes the response based on the desired structure and style.
  6. Incorporating Reasoning:
    • Uses logical connections to provide explanations and justifications.
  7. Reviewing for Coherence:
    • Ensures the response flows logically and cohesively.

Methodological Approach

  • Start Broad, Then Focus:
    • Begin with general concepts before delving into specifics.
  • Logical Sequencing:
    • Present information in a logical order (e.g., cause and effect, chronological).
  • Evidence-Based Responses:
    • Incorporate data and examples to support statements.
  • Clarity and Precision:
    • Use clear language and define any complex terms.
  • Feedback Loop:
    • Be open to refining the prompt based on the initial response.

Example Prompt Using the Template


Prompt:

Contextual Background:

"I am preparing a report for a graduate-level course on environmental economics, focusing on renewable energy implementation in developing countries."

Clear Instruction of Task:

"Analyze the economic impacts of adopting solar energy in rural areas of Southeast Asia."

Specific Requirements and Constraints:

"Concentrate on the period from 2015 to 2023, and exclude technical aspects of solar technology."

Desired Output Structure:

"Provide the analysis in three paragraphs: an introduction, main impacts, and a conclusion summarizing key points."

Reasoning and Justification:

"Explain the reasons behind each economic impact, referencing relevant economic theories."

Tone and Style Preferences:

"Maintain an academic tone with formal language."

Examples and Analogies:

"Include real-world examples of specific countries or communities."

Additional Considerations:

"Avoid discussing non-economic factors such as political or social implications."


Expected Response:

(The model generates a structured, detailed analysis adhering to all specified instructions.)


Benefits of This Template

  • Maximizes Relevance:
    • By providing detailed instructions, the model can deliver more precise answers.
  • Enhances Depth and Quality:
    • Encouraging reasoning and justifications leads to more insightful responses.
  • Improves Clarity:
    • Specifying structure and tone ensures the response meets your communication needs.
  • Saves Time:
    • Reduces the need for follow-up prompts or clarifications.

Tips for Effective Use

  • Be Explicit:
    • Clearly state all expectations to minimize ambiguity.
  • Keep It Structured:
    • Use headings or bullet points in the prompt for readability.
  • Iterate as Needed:
    • Refine the prompt if the initial response doesn't meet your needs.
  • Leverage Model Strengths:
    • The model excels at synthesizing information, so provide sufficient context.

Conclusion

This optimal prompt template is designed to harness the full potential of the language model's logic, comprehension, and reasoning abilities. By meticulously detailing each component of the prompt, users can receive responses that are not only accurate and informative but also tailored to their specific needs and preferences.


Remember: The key to effective communication with a language model lies in the clarity and completeness of your prompt. By investing time in crafting your request using this template, you enable the model to provide the most helpful and relevant responses possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment