Skip to content

Instantly share code, notes, and snippets.

@chantzlarge
Last active April 27, 2023 22:24
Show Gist options
  • Save chantzlarge/e4a7d1ed568b17f9f7a4f2a274e881dc to your computer and use it in GitHub Desktop.
Save chantzlarge/e4a7d1ed568b17f9f7a4f2a274e881dc to your computer and use it in GitHub Desktop.
Heuristic Design Patterns

Heuristic Design Patterns for Engineering LLM Prompts

  1. Abstraction Principle: A design pattern that simplifies complex concepts and structures by breaking them down into smaller, more manageable components. This enables more effective heuristic classification and qualitative analysis of LLM prompts.

  2. Contextual Relevance: A pattern that considers the context in which a heuristic or LLM prompt is being applied to improve its performance and adaptability. This enhances the LLM's ability to provide meaningful and contextually appropriate responses.

  3. Dynamic Adjustment: A design pattern that allows the heuristic classification system to adapt and evolve over time by incorporating feedback and learning from past experiences. This enables the system to improve its performance and cater to changing requirements.

  4. Expert Knowledge Injection: A pattern that involves incorporating domain-specific knowledge or expert input into the heuristic classification system to improve its accuracy, precision, and overall effectiveness.

  5. Fallback Strategy: A design pattern that provides a backup or alternative approach in case the primary heuristic fails or does not produce satisfactory results. This ensures that the LLM prompt can still deliver meaningful results even in unforeseen circumstances.

  6. Granularity Control: A pattern that allows for adjusting the level of detail or specificity in heuristic classification and qualitative analysis. This enables more precise control over the trade-off between accuracy and complexity.

  7. Hybrid Approach: A design pattern that combines multiple heuristics, algorithms, or techniques to achieve better performance and adaptability. This can lead to improved classification and analysis results compared to using a single method.

  8. Incremental Refinement: A pattern that involves iteratively refining the heuristic classification system to progressively improve its performance and accuracy. This allows the system to learn from past mistakes and successes, leading to better results over time.

  9. Noise Reduction: A design pattern that involves filtering out irrelevant or extraneous information from the data, allowing the heuristic classification system to focus on the most important features and patterns.

  10. Parallel Processing: A pattern that enables the heuristic classification system to handle multiple tasks or processes simultaneously, improving overall efficiency and performance.

  11. Priority-Based Evaluation: A design pattern that assigns different levels of importance or priority to various aspects of the heuristic classification system. This allows the system to focus on more critical or relevant factors, leading to improved results.

  12. Recursive Decomposition: A pattern that involves breaking down complex problems into smaller, more manageable subproblems, which can then be tackled using the same heuristic approach. This enables the heuristic classification system to handle a wide range of problem sizes and complexities.

  13. Stimulus-Response Association: A design pattern that involves associating specific inputs or stimuli with appropriate outputs or responses. This helps the heuristic classification system to generate more accurate and contextually relevant results.

  14. Temporal Reasoning: A pattern that involves incorporating the element of time into the heuristic classification system. This can help account for temporal patterns and dependencies in the data, leading to improved performance and more accurate analysis.

  15. Weighted Scoring: A design pattern that assigns different weights to various factors or criteria in the heuristic classification system. This allows the system to consider the relative importance of different aspects, leading to more accurate and meaningful results.

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