AI Prompts
It's not what you know, but knowing what to ask that matters most.
Everyone needs to Learn Prompting
Evolve Ideas
The evolution feedback loop.
Related
Professional Services
How long before we prompters become the prompted?
Prompt Engineering
Best practices for engineering more effective prompts.
Anthropic Console and Guide Docs
- Setup Account (free credit)
- Generate a Prompt
- Replace variables
{{change-me}}
Principles
- Provide multiple examples of desired output
- Break tasks into steps
- Give AI confidence by "flattering" it
- Edit AI-generated content rather than relying on it entirely
- Avoid prompts that result in long essays
- Break large subjects down into several separate prompts
- Figure out the topic focus, then relevant keywords for the topic
- Use constraints, e.g "In less than 500 words, explain why..."
See roadmap diagram and interactive tutorial to progress down the path towards mastery.
Formatting
XML is favoured in prompt engineering for several reasons:
- Structure and Hierarchy: XML allows for organizing data in a structured and hierarchical manner using tags. This makes prompts more readable, maintainable, and easier to process by AI models.
- Flexibility and Extensibility: XML is highly flexible and extensible, allowing developers to define custom tags that suit their specific prompt engineering needs. This adaptability enables the creation of prompts tailored to various contexts and applications.
- Platform Independence: XML is platform-independent, meaning it can be used across different systems and applications. This facilitates the exchange of prompts between various AI models and tools, enhancing interoperability.
Some tags commonly used in XML prompts include:
- Context: Defines the background information or setting for the prompt. It helps provide the AI model with the necessary context to generate more relevant and accurate responses.
- Behaviour: Specifies the desired behavior or actions the AI model should exhibit when responding to the prompt. This tag guides the model's output, ensuring it aligns with the intended purpose.
- Knowledge: Encapsulates the domain-specific knowledge or information required for the AI model to generate informed responses. It helps scope the model's knowledge base to the relevant subject matter.
- Instructions: Offers detailed instructions or guidelines for the AI model on how to approach and fulfil the prompt. It serves as a roadmap for the model, outlining the steps to follow in generating the response.
- Output: Defines the expected format, style, or structure of the AI model's response. This tag helps maintain consistency and readability in the generated outputs.
- Examples: Provides illustrative examples or scenarios to clarify the prompt's requirements and expectations. This tag aids in formalizing abstract concepts and guiding the AI model's response generation.
Best practices for using XML tags in prompt engineering:
- Descriptive Names: Use meaningful and self-explanatory tag names that clearly convey their purpose, enhancing readability and maintainability.
- Consistent Usage: Ensure consistent usage of tags throughout the prompts to maintain clarity and reduce ambiguity.
- Hierarchical Nesting: Leverage the hierarchical nature of XML by nesting tags appropriately to represent the structure and relationships within the prompt data.
Official Resources:
Follow-up
Once you receive an answer, you can ask follow-up prompts to improve responses. Three tactics to improve results include:
- requesting expanded answers
- requesting simplified answers
- redirecting focus with keywords
Expansion:
- can you expand on...
- can you explain more about...
Simplification:
- can you simplify that answer for me?
- can you explain that to me like I'm 5 years old?